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 + width</code>,
* respectively. The top and bottom edges of the rectangle are at
* <code>y</code> and <code>y + 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);
}
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 + width - 1</code>,
* respectively. The top and bottom edges of the rectangle are at
* <code>y</code> and <code>y + height - 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);
}
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 + width</code>,
* respectively. The top and bottom edges of the rectangle are at
* <code>y</code> and <code>y + 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);
}
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();
}
}
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 + width</code>,
* respectively. The top and bottom edges of the rectangle are at
* <code>y</code> and <code>y + 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);
}
Aggregations