use of java.awt.geom.RoundRectangle2D in project archi by archimatetool.
the class GraphicsToGraphics2DAdaptor method fillRoundRectangle.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.draw2d.Graphics#fillRoundRectangle(org.eclipse.draw2d.geometry
* .Rectangle, int, int)
*/
@Override
public void fillRoundRectangle(Rectangle rect, int arcWidth, int arcHeight) {
RoundRectangle2D roundRect = new RoundRectangle2D.Float(rect.x + transX, rect.y + transY, rect.width, rect.height, arcWidth, arcHeight);
checkState();
getGraphics2D().setPaint(getColor(swtGraphics.getBackgroundColor()));
getGraphics2D().fill(roundRect);
}
use of java.awt.geom.RoundRectangle2D in project airavata by apache.
the class NodeGUI method getComponentShape.
protected Shape getComponentShape() {
Point position = getNode().getPosition();
RoundRectangle2D completeComponentBoundaryRect = new RoundRectangle2D.Float(position.x, position.y, this.dimension.width, this.dimension.height, DrawUtils.ARC_SIZE, DrawUtils.ARC_SIZE);
return completeComponentBoundaryRect;
}
use of java.awt.geom.RoundRectangle2D in project airavata by apache.
the class NodeGUI method getComponentHeaderShape.
protected Shape getComponentHeaderShape() {
Point position = getNode().getPosition();
RoundRectangle2D headerBoundaryRect = new RoundRectangle2D.Double(position.x, position.y, this.dimension.width, this.headHeight, DrawUtils.ARC_SIZE, DrawUtils.ARC_SIZE);
return headerBoundaryRect;
}
use of java.awt.geom.RoundRectangle2D in project pool by Maharramoff.
the class Game method tableRender.
private void tableRender(Graphics2D graphics2D) {
// Borders
RoundRectangle2D roundedRectangle = new RoundRectangle2D.Float(0, 0, Helper.SW, Helper.SH, 30, 30);
graphics2D.setColor(Helper.BC);
graphics2D.fill(roundedRectangle);
// Table
graphics2D.setColor(Helper.TC);
graphics2D.fillRect(Helper.TB, Helper.TB, Helper.SW - Helper.TB * 2, Helper.SH - Helper.TB * 2);
// Table white line and dot
graphics2D.setColor(Helper.BALL_WHITE);
graphics2D.drawLine(Helper.SW - Helper.SW / 4, Helper.TB, Helper.SW - Helper.SW / 4, Helper.SH - Helper.TB);
graphics2D.drawOval(Helper.SW / 4, Helper.SH / 2, 2, 2);
// Holes
Helper.HOLES.forEach((String key, int[] value) -> {
graphics2D.setColor(Color.BLACK);
graphics2D.fillOval(Helper.HOLES.get(key)[0], Helper.HOLES.get(key)[1], Helper.HR * 2, Helper.HR * 2);
// Hole arcs
graphics2D.setColor(Helper.HAC);
graphics2D.setStroke(new BasicStroke(2));
graphics2D.drawArc(Helper.HOLES.get(key)[0], Helper.HOLES.get(key)[1], Helper.HR * 2, Helper.HR * 2, Helper.ARCS.get(key)[0], Helper.ARCS.get(key)[1]);
});
reDrawBalls(graphics2D);
}
use of java.awt.geom.RoundRectangle2D in project TrakEM2 by trakem2.
the class Node method paintTags.
private void paintTags(final Graphics2D g, final int x, final int y, Color background_color) {
final int ox = x + 20;
int oy = y + 20;
Color fontcolor = Color.blue;
if (Color.red == background_color || Color.blue == background_color)
fontcolor = Color.white;
else
background_color = Taggable.TAG_BACKGROUND;
// so the Color indicated in the parameter background_color is used only as a flag
final Stroke stroke = g.getStroke();
g.setStroke(Taggable.DASHED_STROKE);
g.setColor(background_color);
g.drawLine(x, y, ox, oy);
g.setStroke(stroke);
final Tag[] tags = this.tags instanceof Tag[] ? (Tag[]) this.tags : new Tag[] { (Tag) this.tags };
for (final Tag ob : tags) {
final String tag = ob.toString();
final Dimension dim = Utils.getDimensions(tag, g.getFont());
final int arc = (int) (dim.height / 3.0f);
final RoundRectangle2D rr = new RoundRectangle2D.Float(ox, oy, dim.width + 4, dim.height + 2, arc, arc);
g.setColor(background_color);
g.fill(rr);
g.setColor(fontcolor);
g.drawString(tag, ox + 2, oy + dim.height - 1);
oy += dim.height + 3;
}
}
Aggregations