Search in sources :

Example 6 with RoundRectangle2D

use of java.awt.geom.RoundRectangle2D in project poi by apache.

the class SLGraphics method drawRoundRect.

/**
     * Draws an outlined round-cornered rectangle using this graphics
     * context's current color. The left and right edges of the rectangle
     * are at <code>x</code> and <code>x&nbsp;+&nbsp;width</code>,
     * respectively. The top and bottom edges of the rectangle are at
     * <code>y</code> and <code>y&nbsp;+&nbsp;height</code>.
     * @param      x the <i>x</i> coordinate of the rectangle to be drawn.
     * @param      y the <i>y</i> coordinate of the rectangle to be drawn.
     * @param      width the width of the rectangle to be drawn.
     * @param      height the height of the rectangle to be drawn.
     * @param      arcWidth the horizontal diameter of the arc
     *                    at the four corners.
     * @param      arcHeight the vertical diameter of the arc
     *                    at the four corners.
     * @see        java.awt.Graphics#fillRoundRect
     */
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
    RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight);
    draw(rect);
}
Also used : RoundRectangle2D(java.awt.geom.RoundRectangle2D)

Example 7 with RoundRectangle2D

use of java.awt.geom.RoundRectangle2D in project poi by apache.

the class PPGraphics2D method fillRoundRect.

/**
     * Fills the specified rounded corner rectangle with the current color.
     * The left and right edges of the rectangle
     * are at <code>x</code> and <code>x&nbsp;+&nbsp;width&nbsp;-&nbsp;1</code>,
     * respectively. The top and bottom edges of the rectangle are at
     * <code>y</code> and <code>y&nbsp;+&nbsp;height&nbsp;-&nbsp;1</code>.
     * @param       x the <i>x</i> coordinate of the rectangle to be filled.
     * @param       y the <i>y</i> coordinate of the rectangle to be filled.
     * @param       width the width of the rectangle to be filled.
     * @param       height the height of the rectangle to be filled.
     * @param       arcWidth the horizontal diameter
     *                     of the arc at the four corners.
     * @param       arcHeight the vertical diameter
     *                     of the arc at the four corners.
     * @see         java.awt.Graphics#drawRoundRect
     */
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
    RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight);
    fill(rect);
}
Also used : RoundRectangle2D(java.awt.geom.RoundRectangle2D)

Example 8 with RoundRectangle2D

use of java.awt.geom.RoundRectangle2D in project poi by apache.

the class PPGraphics2D method drawRoundRect.

/**
     * Draws an outlined round-cornered rectangle using this graphics
     * context's current color. The left and right edges of the rectangle
     * are at <code>x</code> and <code>x&nbsp;+&nbsp;width</code>,
     * respectively. The top and bottom edges of the rectangle are at
     * <code>y</code> and <code>y&nbsp;+&nbsp;height</code>.
     * @param      x the <i>x</i> coordinate of the rectangle to be drawn.
     * @param      y the <i>y</i> coordinate of the rectangle to be drawn.
     * @param      width the width of the rectangle to be drawn.
     * @param      height the height of the rectangle to be drawn.
     * @param      arcWidth the horizontal diameter of the arc
     *                    at the four corners.
     * @param      arcHeight the vertical diameter of the arc
     *                    at the four corners.
     * @see        java.awt.Graphics#fillRoundRect
     */
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
    RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight);
    draw(rect);
}
Also used : RoundRectangle2D(java.awt.geom.RoundRectangle2D)

Example 9 with RoundRectangle2D

use of java.awt.geom.RoundRectangle2D in project hid-serial by rayshobby.

the class GScrollbar method updateBuffer.

protected void updateBuffer() {
    if (bufferInvalid) {
        bufferInvalid = false;
        Graphics2D g2d = buffer.g2;
        buffer.beginDraw();
        if (opaque) {
            buffer.background(buffer.color(255, 0));
            buffer.fill(palette[6]);
            buffer.noStroke();
            buffer.rect(8, 0, width - 16, height);
        } else
            buffer.background(buffer.color(255, 0));
        // Draw the track
        buffer.fill(palette[TRACK]);
        buffer.noStroke();
        buffer.rect(8, 3, width - 8, height - 5);
        g2d.setStroke(pen_1_0);
        // Draw the low cap
        buffer.strokeWeight(1.2f);
        if (currSpot == 1) {
            g2d.setColor(jpalette[OVER_FILL]);
            g2d.fill(lowCap);
            g2d.setColor(jpalette[OVER_STROKE]);
            g2d.draw(lowCap);
        } else {
            g2d.setColor(jpalette[OFF_FILL]);
            g2d.fill(lowCap);
            g2d.setColor(jpalette[OFF_STROKE]);
            g2d.draw(lowCap);
        }
        // Draw the high cap
        if (currSpot == 2) {
            g2d.setColor(jpalette[OVER_FILL]);
            g2d.fill(highCap);
            g2d.setColor(jpalette[OVER_STROKE]);
            g2d.draw(highCap);
        } else {
            g2d.setColor(jpalette[OFF_FILL]);
            g2d.fill(highCap);
            g2d.setColor(jpalette[OFF_STROKE]);
            g2d.draw(highCap);
        }
        // draw thumb
        float thumbWidth = (width - 32) * filler;
        RoundRectangle2D thumb = new RoundRectangle2D.Float(1, 1, thumbWidth - 1, height - 2, 6, 6);
        buffer.translate((width - 32) * value + 16, 0);
        if (currSpot == 10 || isValueChanging) {
            g2d.setColor(jpalette[OVER_FILL]);
            g2d.fill(thumb);
            g2d.setColor(jpalette[OVER_STROKE]);
            g2d.draw(thumb);
        } else {
            g2d.setColor(jpalette[OFF_FILL]);
            g2d.fill(thumb);
            g2d.setColor(jpalette[OFF_STROKE]);
            g2d.draw(thumb);
        }
        buffer.endDraw();
    }
}
Also used : RoundRectangle2D(java.awt.geom.RoundRectangle2D) Graphics2D(java.awt.Graphics2D)

Example 10 with RoundRectangle2D

use of java.awt.geom.RoundRectangle2D in project scriptographer by scriptographer.

the class AbstractGraphics2D method drawRoundRect.

/**
     * Draws an outlined round-cornered rectangle using this graphics
     * context's current color. The left and right edges of the rectangle
     * are at <code>x</code> and <code>x&nbsp;+&nbsp;width</code>,
     * respectively. The top and bottom edges of the rectangle are at
     * <code>y</code> and <code>y&nbsp;+&nbsp;height</code>.
     * @param      x the <i>x</i> coordinate of the rectangle to be drawn.
     * @param      y the <i>y</i> coordinate of the rectangle to be drawn.
     * @param      width the width of the rectangle to be drawn.
     * @param      height the height of the rectangle to be drawn.
     * @param      arcWidth the horizontal diameter of the arc
     *                    at the four corners.
     * @param      arcHeight the vertical diameter of the arc
     *                    at the four corners.
     * @see        java.awt.Graphics#fillRoundRect
     */
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
    RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight);
    draw(rect);
}
Also used : RoundRectangle2D(java.awt.geom.RoundRectangle2D)

Aggregations

RoundRectangle2D (java.awt.geom.RoundRectangle2D)15 BasicStroke (java.awt.BasicStroke)4 Paint (java.awt.Paint)3 Stroke (java.awt.Stroke)3 Area (java.awt.geom.Area)3 Graphics2D (java.awt.Graphics2D)2 Rectangle2D (java.awt.geom.Rectangle2D)2 Density (com.android.resources.Density)1 ScreenRatio (com.android.resources.ScreenRatio)1 ScreenSize (com.android.resources.ScreenSize)1 JBColor (com.intellij.ui.JBColor)1 Color (java.awt.Color)1 Container (java.awt.Container)1 GradientPaint (java.awt.GradientPaint)1 Point (java.awt.Point)1 Ellipse2D (java.awt.geom.Ellipse2D)1 Line2D (java.awt.geom.Line2D)1 BufferedImage (java.awt.image.BufferedImage)1 AttributedString (java.text.AttributedString)1 ArrayList (java.util.ArrayList)1