/** * Returns the background paint for the node. If the node's type has a mapped color/paint then * that is returned, otherwise the default node background paint is returned. */ public Paint getBackgroundPaint(GraphNode node) { return getTypePaint(node.getType()); }
public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setPaint(getTypePaint(type)); g2.fillRoundRect(x + 1, y + 1, width - 2, height - 2, 5, 5); g2.setPaint(borderPaint); g2.setStroke(new BasicStroke(1)); g2.drawRoundRect(x + 1, y + 1, width - 2, height - 2, 5, 5); } };