public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Paint paint = getTypePaint(type); g2.setPaint(paint); g2.setStroke(new BasicStroke(3)); int midY = y + (height / 2); g2.drawLine(x + 2, midY, x + width - 4, midY); } };
/** * Returns the paint to use for the arc. Checks if the arc type has a color mapped to it, if so * that color/paint is returned. Otherwise the default arc color is returned. * @param arc the arc whose paint/color will be returned * @return the paint or color for the arc */ public Paint getPaint(GraphArc arc) { return getTypePaint(arc.getType()); }