Search in sources :

Example 1 with AbstractBorder

use of org.eclipse.draw2d.AbstractBorder in project whole by wholeplatform.

the class ParallelFigure 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);
        }
    };
}
Also used : Graphics(org.eclipse.draw2d.Graphics) Insets(org.eclipse.draw2d.geometry.Insets) Rectangle(org.eclipse.draw2d.geometry.Rectangle) AbstractBorder(org.eclipse.draw2d.AbstractBorder) IFigure(org.eclipse.draw2d.IFigure)

Example 2 with AbstractBorder

use of org.eclipse.draw2d.AbstractBorder 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);
        }
    };
}
Also used : Graphics(org.eclipse.draw2d.Graphics) Insets(org.eclipse.draw2d.geometry.Insets) Rectangle(org.eclipse.draw2d.geometry.Rectangle) AbstractBorder(org.eclipse.draw2d.AbstractBorder) IFigure(org.eclipse.draw2d.IFigure)

Example 3 with AbstractBorder

use of org.eclipse.draw2d.AbstractBorder 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);
        }
    };
}
Also used : Graphics(org.eclipse.draw2d.Graphics) Insets(org.eclipse.draw2d.geometry.Insets) Rectangle(org.eclipse.draw2d.geometry.Rectangle) AbstractBorder(org.eclipse.draw2d.AbstractBorder) IFigure(org.eclipse.draw2d.IFigure)

Example 4 with AbstractBorder

use of org.eclipse.draw2d.AbstractBorder 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);
        }
    };
}
Also used : Graphics(org.eclipse.draw2d.Graphics) Insets(org.eclipse.draw2d.geometry.Insets) Rectangle(org.eclipse.draw2d.geometry.Rectangle) AbstractBorder(org.eclipse.draw2d.AbstractBorder) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

AbstractBorder (org.eclipse.draw2d.AbstractBorder)4 Graphics (org.eclipse.draw2d.Graphics)4 IFigure (org.eclipse.draw2d.IFigure)4 Insets (org.eclipse.draw2d.geometry.Insets)4 Rectangle (org.eclipse.draw2d.geometry.Rectangle)4