private void drawArrows(final Graphics2D g2d,final int x,final int y,final int width,final int height,final EnumSet<Direction> directions,final Color lineColor){
  int arrowHeight=6 + 2 * (height / 23 - 1);
  int arrowWidth=3 + (width / 34 - 1);
  if (directions.contains(Direction.LEFT)) {
    g2d.setColor(Color.RED);
    g2d.fillPolygon(new int[]{x + 1,x - arrowWidth,x + 1},new int[]{y + (height / 2) - (arrowHeight / 2),y + (height / 2),y + (height / 2) + (arrowHeight / 2)},3);
    g2d.setColor(lineColor);
    g2d.drawPolyline(new int[]{x,x - arrowWidth,x},new int[]{y + (height / 2) - (arrowHeight / 2),y + (height / 2),y + (height / 2) + (arrowHeight / 2)},3);
  }
  if (directions.contains(Direction.RIGHT)) {
    g2d.setColor(Color.RED);
    g2d.fillPolygon(new int[]{x + width,x + width + arrowWidth,x + width},new int[]{y + (height / 2) - (arrowHeight / 2),y + (height / 2),y + (height / 2) + (arrowHeight / 2)},3);
    g2d.setColor(lineColor);
    g2d.drawPolyline(new int[]{x + width,x + width + arrowWidth,x + width},new int[]{y + (height / 2) - (arrowHeight / 2),y + (height / 2),y + (height / 2) + (arrowHeight / 2)},3);
  }
  if (directions.contains(Direction.UP)) {
    g2d.setColor(Color.RED);
    g2d.fillPolygon(new int[]{x + (width / 2) - (arrowHeight / 2),x + (width / 2),x + (width / 2) + (arrowHeight / 2)},new int[]{y + 1,y - arrowWidth,y + 1},3);
    g2d.setColor(lineColor);
    g2d.drawPolyline(new int[]{x + (width / 2) - (arrowHeight / 2),x + (width / 2),x + (width / 2) + (arrowHeight / 2)},new int[]{y,y - arrowWidth,y},3);
  }
  if (directions.contains(Direction.DOWN)) {
    g2d.setColor(Color.RED);
    g2d.fillPolygon(new int[]{x + (width / 2) - (arrowHeight / 2),x + (width / 2),x + (width / 2) + (arrowHeight / 2)},new int[]{y + height,y + height + arrowWidth,y + height},3);
    g2d.setColor(lineColor);
    g2d.drawPolyline(new int[]{x + (width / 2) - (arrowHeight / 2),x + (width / 2),x + (width / 2) + (arrowHeight / 2)},new int[]{y + height,y + height + arrowWidth,y + height},3);
  }
}

private void drawArrows ( final Graphics2D g2d , final int x , final int y , final int width , final int height , final EnumSet < Direction > directions , final Color lineColor ) { int arrowHeight = 6 + 2 * ( height / 23 - 1 ) ; int arrowWidth = 3 + ( width / 34 - 1 ) ; if ( directions . contains ( Direction . LEFT ) ) { g2d . setColor ( Color . RED ) ; g2d . fillPolygon ( new int [ ] { x + 1 , x - arrowWidth , x + 1 } , new int [ ] { y + ( height / 2 ) - ( arrowHeight / 2 ) , y + ( height / 2 ) , y + ( height / 2 ) + ( arrowHeight / 2 ) } , 3 ) ; g2d . setColor ( lineColor ) ; g2d . drawPolyline ( new int [ ] { x , x - arrowWidth , x } , new int [ ] { y + ( height / 2 ) - ( arrowHeight / 2 ) , y + ( height / 2 ) , y + ( height / 2 ) + ( arrowHeight / 2 ) } , 3 ) ; } if ( directions . contains ( Direction . RIGHT ) ) { g2d . setColor ( Color . RED ) ; g2d . fillPolygon ( new int [ ] { x + width , x + width + arrowWidth , x + width } , new int [ ] { y + ( height / 2 ) - ( arrowHeight / 2 ) , y + ( height / 2 ) , y + ( height / 2 ) + ( arrowHeight / 2 ) } , 3 ) ; g2d . setColor ( lineColor ) ; g2d . drawPolyline ( new int [ ] { x + width , x + width + arrowWidth , x + width } , new int [ ] { y + ( height / 2 ) - ( arrowHeight / 2 ) , y + ( height / 2 ) , y + ( height / 2 ) + ( arrowHeight / 2 ) } , 3 ) ; } if ( directions . contains ( Direction . UP ) ) { g2d . setColor ( Color . RED ) ; g2d . fillPolygon ( new int [ ] { x + ( width / 2 ) - ( arrowHeight / 2 ) , x + ( width / 2 ) , x + ( width / 2 ) + ( arrowHeight / 2 ) } , new int [ ] { y + 1 , y - arrowWidth , y + 1 } , 3 ) ; g2d . setColor ( lineColor ) ; g2d . drawPolyline ( new int [ ] { x + ( width / 2 ) - ( arrowHeight / 2 ) , x + ( width / 2 ) , x + ( width / 2 ) + ( arrowHeight / 2 ) } , new int [ ] { y , y - arrowWidth , y } , 3 ) ; } if ( directions . contains ( Direction . DOWN ) ) { g2d . setColor ( Color . RED ) ; g2d . fillPolygon ( new int [ ] { x + ( width / 2 ) - ( arrowHeight / 2 ) , x + ( width / 2 ) , x + ( width / 2 ) + ( arrowHeight / 2 ) } , new int [ ] { y + height , y + height + arrowWidth , y + height } , 3 ) ; g2d . setColor ( lineColor ) ; g2d . drawPolyline ( new int [ ] { x + ( width / 2 ) - ( arrowHeight / 2 ) , x + ( width / 2 ) , x + ( width / 2 ) + ( arrowHeight / 2 ) } , new int [ ] { y + height , y + height + arrowWidth , y + height } , 3 ) ; } }
function to draw the arrows on the attack / being attacked ring .
