Java Code Examples for org.eclipse.draw2d.Graphics#drawRoundRectangle()
The following examples show how to use
org.eclipse.draw2d.Graphics#drawRoundRectangle() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RoundedRectangleBorder.java From nebula with Eclipse Public License 2.0 | 6 votes |
@Override public void paint(IFigure figure, Graphics graphics, Insets insets) { tempRect.setBounds(getPaintRectangle(figure, insets)); if ((getWidth() % 2) == 1) { tempRect.width--; tempRect.height--; } tempRect.shrink(getWidth() / 2, getWidth() / 2); graphics.setLineWidth(getWidth()); graphics.setLineStyle(getStyle()); if (getColor() != null) graphics.setForegroundColor(getColor()); graphics.drawRoundRectangle(tempRect, fArcWidth, fArcHeight); }
Example 2
Source File: RoundedNode.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
@Override public void paintFigure(Graphics graphics) { float lineInset = .5f; int inset1 = (int) Math.floor(lineInset); int inset2 = (int) Math.ceil(lineInset); Rectangle r = Rectangle.SINGLETON.setBounds(getBounds()); r.x += inset1; r.y += inset1; r.width -= inset1 + inset2; r.height -= inset1 + inset2; graphics.fillRoundRectangle(r, Math.max(0, ILayoutConstants.ROUNDED_RECTANGLE_RADIUS - (int) lineInset), Math.max(0, ILayoutConstants.ROUNDED_RECTANGLE_RADIUS - (int) lineInset)); graphics.drawRoundRectangle(r, Math.max(0, ILayoutConstants.ROUNDED_RECTANGLE_RADIUS - (int) lineInset), Math.max(0, ILayoutConstants.ROUNDED_RECTANGLE_RADIUS - (int) lineInset)); }
Example 3
Source File: DropShadowRectangle.java From ermasterr with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected void outlineShape(final Graphics graphics) { final Rectangle f = Rectangle.SINGLETON.setBounds(getBounds()); final Insets shadowInset = new Insets(getLineWidth() / 2, getLineWidth() / 2, getLineWidth() + SHADOW_INSET, getLineWidth() + SHADOW_INSET); shrink(f, shadowInset); final Dimension cornerDimensions = getCornerDimensions(); graphics.drawRoundRectangle(f, cornerDimensions.width, cornerDimensions.height); }
Example 4
Source File: DropShadowRectangle.java From erflute with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") @Override protected void outlineShape(Graphics graphics) { final Rectangle f = Rectangle.SINGLETON.setBounds(getBounds()); final Insets shadowInset = new Insets(getLineWidth() / 2, getLineWidth() / 2, getLineWidth() + SHADOW_INSET, getLineWidth() + SHADOW_INSET); shrink(f, shadowInset); graphics.drawRoundRectangle(f, corner.width, corner.height); }
Example 5
Source File: DropShadowRectangle.java From ermaster-b with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected void outlineShape(Graphics graphics) { Rectangle f = Rectangle.SINGLETON.setBounds(getBounds()); Insets shadowInset = new Insets(getLineWidth() / 2, getLineWidth() / 2, getLineWidth() + SHADOW_INSET, getLineWidth() + SHADOW_INSET); shrink(f, shadowInset); graphics.drawRoundRectangle(f, corner.width, corner.height); }