List of utility methods to do Graphics Draw Arrow
void | paintArrow(Graphics g, Color color, int startX, int startY, int width, int orientation) paint Arrow Color oldColor = g.getColor(); g.setColor(color); width = width / 2 * 2 + 1; if (orientation == 0) { for (int i = 0; i < (width + 1) / 2; i++) { g.drawLine(startX + i, startY + i, startX + width - i - 1, startY + i); else if (orientation == 1) { for (int i = 0; i < (width + 1) / 2; i++) { g.drawLine(startX + i, startY + i, startX + i, startY + width - i - 1); g.setColor(oldColor); |
void | paintArrow(Graphics g, int x0, int y0, int x1, int y1) paint Arrow int deltaX = x1 - x0; int deltaY = y1 - y0; double frac = 0.2; g.drawLine(x0, y0, x1, y1); g.drawLine(x0 + (int) ((1 - frac) * deltaX + frac * deltaY), y0 + (int) ((1 - frac) * deltaY - frac * deltaX), x1, y1); g.drawLine(x0 + (int) ((1 - frac) * deltaX - frac * deltaY), y0 + (int) ((1 - frac) * deltaY + frac * deltaX), x1, y1); ... |