use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class PickControlFigure method createBorder.
protected AbstractBorder createBorder(final boolean isHorizontal) {
return new AbstractBorder() {
private final Insets /*static*/
INSETS = new Insets(10, 10, 20, 10);
public Insets getInsets(IFigure figure) {
return INSETS;
}
public void paint(IFigure figure, Graphics graphics, Insets insets) {
Rectangle rect = getPaintRectangle(figure, insets).resize(-1, -1);
graphics.setForegroundColor(ColorConstants.lightGray);
// graphics.setLineStyle(SWT.LINE_CUSTOM);
// graphics.setLineDash(new int[] {8,3});
graphics.drawRoundRectangle(rect, 10, 10);
}
};
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class SequenceFigure method createBorder.
protected AbstractBorder createBorder(final boolean isHorizontal) {
return new AbstractBorder() {
private final Insets /*static*/
INSETS = new Insets(10, 20, 10, 20);
public Insets getInsets(IFigure figure) {
return INSETS;
}
public void paint(IFigure figure, Graphics graphics, Insets insets) {
Rectangle rect = getPaintRectangle(figure, insets).resize(-1, -1);
graphics.setForegroundColor(ColorConstants.lightGray);
// graphics.setLineStyle(SWT.LINE_CUSTOM);
// graphics.setLineDash(new int[] {8,3});
graphics.drawRoundRectangle(rect, 10, 10);
}
};
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class SwitchControlFigure method createBorder.
protected AbstractBorder createBorder(final boolean isHorizontal) {
return new AbstractBorder() {
private final Insets /*static*/
INSETS = new Insets(10, 10, 10, 10);
public Insets getInsets(IFigure figure) {
return INSETS;
}
public void paint(IFigure figure, Graphics graphics, Insets insets) {
Rectangle rect = getPaintRectangle(figure, insets).resize(-1, -1);
graphics.setForegroundColor(ColorConstants.lightGray);
// graphics.setLineStyle(SWT.LINE_CUSTOM);
// graphics.setLineDash(new int[] {8,3});
graphics.drawRoundRectangle(rect, 10, 10);
}
};
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class AbstractStyledBorder method getInsets.
public Insets getInsets(IFigure figure) {
Insets insets = getInsets();
int lw = getLineWidth();
return new Insets(lw).add(insets);
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class EllipseStyledBorder method getInsets.
@Override
public Insets getInsets(IFigure figure) {
Insets result = super.getInsets(figure);
Rectangle bounds = figure.getBounds();
if (bounds.width > 0 && bounds.height > 0) {
int rectWidth = (int) (bounds.width / Math.sqrt(2));
int rectHeight = (int) (bounds.height / Math.sqrt(2));
int dw = (bounds.width - rectWidth) / 2;
int dh = (bounds.height - rectHeight) / 2;
result.top += dh;
result.bottom += dh;
result.left += dw;
result.right += dw;
}
return result;
}
Aggregations