use of java.awt.BasicStroke in project processdash by dtuma.
the class WrappedSearchIcon method paintIcon.
@Override
protected void paintIcon(Graphics2D g2, Shape clip, float scale) {
g2.setStroke(new BasicStroke(1 / scale));
g2.setColor(line);
g2.draw(arrow);
g2.fill(arrow);
g2.draw(loop);
}
use of java.awt.BasicStroke in project processdash by dtuma.
the class DeleteFilterIcon method paintIcon.
@Override
protected void paintIcon(Graphics2D g2, Shape clip, float scale) {
g2.setStroke(new BasicStroke(1 / scale));
g2.setColor(line);
g2.drawLine(0, 0, 6, 6);
g2.drawLine(0, 6, 6, 0);
}
use of java.awt.BasicStroke in project processdash by dtuma.
the class EnterKeyToggleIcon method paintIcon.
@Override
protected void paintIcon(Graphics2D g2, Shape clip, float scale) {
// fill the enter key
g2.setColor(fill);
g2.fill(shape);
// draw the beveled edges on each side of the key
g2.setStroke(bevel);
for (int i = edges.length; i-- > 0; ) {
g2.setClip(edges[i]);
g2.setColor(edgeColors[i]);
g2.draw(shape);
}
g2.setClip(clip);
// draw a thin border around the outside
g2.setStroke(new BasicStroke(1 / scale));
g2.setColor(scale > 0 ? edge : shadow);
g2.draw(shape);
// create a pixel-precise graphics context to draw the arrow
Graphics2D g3 = (Graphics2D) g2.create();
g3.scale(1 / scale, 1 / scale);
// draw the shaft of the arrow
int r = (int) (11.5 * scale + 0.4);
int l = (int) (4 * scale);
g3.setColor(arrow);
g3.setStroke(new BasicStroke(1));
g3.drawLine(r, (int) (8 * scale), r, r);
g3.drawLine(l, r, r, r);
// draw the arrowhead
int dy = (int) (scale + 0.3);
int dx = (dy == 1 ? 1 : 2 * dy);
Shape arrowhead = shape(l, r, l + dx, r - dy, l + dx, r + dy);
g3.fill(arrowhead);
g3.draw(arrowhead);
// paint the sparkle
g2.translate(4, 4);
sparkle.paintIcon(g2, clip, scale);
}
use of java.awt.BasicStroke in project processdash by dtuma.
the class ProxyBucketIcon method paintIcon.
@Override
protected void paintIcon(Graphics2D g2, Shape clip, float scale) {
// fill the background
g2.setColor(fill);
g2.fillRect(0, -1, width - 1, height + 2);
// draw the edges and tick marks
g2.setStroke(new BasicStroke(1 / scale));
g2.setColor(line);
g2.drawLine(0, -1, 0, height + 1);
g2.drawLine(width - 1, -1, width - 1, height + 1);
g2.drawLine(0, height / 2, width / 2, height / 2);
g2.drawLine(0, height / 4, width / 4, height / 4);
g2.drawLine(0, height * 3 / 4, width / 4, height * 3 / 4);
}
use of java.awt.BasicStroke in project processdash by dtuma.
the class FolderIcon method paintIcon.
@Override
protected void paintIcon(Graphics2D g2, Shape clip, float scale) {
// paint the back of the folder
g2.setColor(shadow);
g2.fill(back);
g2.setStroke(new BasicStroke(1 / scale));
g2.setColor(edge);
g2.draw(back);
// paint the front of the folder
g2.setPaint(new GradientPaint(12, 7, fill, 13, 12, shadow));
g2.fill(front);
g2.setColor(edge);
g2.draw(front);
}
Aggregations