Search in sources :

Example 41 with BasicStroke

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);
}
Also used : BasicStroke(java.awt.BasicStroke)

Example 42 with BasicStroke

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);
}
Also used : BasicStroke(java.awt.BasicStroke)

Example 43 with BasicStroke

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);
}
Also used : BasicStroke(java.awt.BasicStroke) Shape(java.awt.Shape) Graphics2D(java.awt.Graphics2D)

Example 44 with BasicStroke

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);
}
Also used : BasicStroke(java.awt.BasicStroke)

Example 45 with BasicStroke

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);
}
Also used : BasicStroke(java.awt.BasicStroke) GradientPaint(java.awt.GradientPaint)

Aggregations

BasicStroke (java.awt.BasicStroke)563 Graphics2D (java.awt.Graphics2D)179 Color (java.awt.Color)160 Stroke (java.awt.Stroke)137 GradientPaint (java.awt.GradientPaint)95 Test (org.junit.Test)93 Rectangle2D (java.awt.geom.Rectangle2D)67 Paint (java.awt.Paint)64 Font (java.awt.Font)61 Line2D (java.awt.geom.Line2D)46 Point (java.awt.Point)45 BufferedImage (java.awt.image.BufferedImage)43 Shape (java.awt.Shape)38 Point2D (java.awt.geom.Point2D)38 JFreeChart (org.jfree.chart.JFreeChart)34 AffineTransform (java.awt.geom.AffineTransform)33 Rectangle (java.awt.Rectangle)27 RectangleInsets (org.jfree.ui.RectangleInsets)27 Ellipse2D (java.awt.geom.Ellipse2D)25 NumberAxis (org.jfree.chart.axis.NumberAxis)25