Search in sources :

Example 31 with Insets

use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.

the class EntityLabel method getPreferredSize.

// TODO end
@Override
public Dimension getPreferredSize(int wHint, int hHint) {
    if (prefSize == null) {
        Dimension d = calculateLabelSize(getTextSize());
        Insets insets = getInsets();
        prefSize = new BaselinedDimension(d, insets.left, getAscent(), false);
        prefSize.expand(insets.getWidth(), insets.getHeight());
        if (getLayoutManager() != null)
            prefSize.union(getLayoutManager().getPreferredSize(this, wHint, hHint));
    }
    return prefSize;
}
Also used : Insets(org.eclipse.draw2d.geometry.Insets) BaselinedDimension(org.whole.lang.ui.layout.BaselinedDimension) Dimension(org.eclipse.draw2d.geometry.Dimension) BaselinedDimension(org.whole.lang.ui.layout.BaselinedDimension)

Example 32 with Insets

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);
        }
    };
}
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 33 with Insets

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);
        }
    };
}
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 34 with Insets

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);
        }
    };
}
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 35 with Insets

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);
}
Also used : Insets(org.eclipse.draw2d.geometry.Insets)

Aggregations

Insets (org.eclipse.draw2d.geometry.Insets)39 Rectangle (org.eclipse.draw2d.geometry.Rectangle)17 Dimension (org.eclipse.draw2d.geometry.Dimension)14 IFigure (org.eclipse.draw2d.IFigure)10 Graphics (org.eclipse.draw2d.Graphics)5 List (java.util.List)4 AbstractBorder (org.eclipse.draw2d.AbstractBorder)4 MarginBorder (org.eclipse.draw2d.MarginBorder)3 PrintDialog (org.eclipse.swt.printing.PrintDialog)3 Printer (org.eclipse.swt.printing.Printer)3 PrinterData (org.eclipse.swt.printing.PrinterData)3 ExtendedViewportAutoexposeHelper (com.archimatetool.editor.diagram.util.ExtendedViewportAutoexposeHelper)2 Border (org.eclipse.draw2d.Border)2 PrintFigureOperation (org.eclipse.draw2d.PrintFigureOperation)2 Node (org.eclipse.draw2d.graph.Node)2 RootEditPart (org.eclipse.gef.RootEditPart)2 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 EntityPart (org.jkiss.dbeaver.ext.erd.part.EntityPart)2 AbsoluteBendpoint (org.eclipse.draw2d.AbsoluteBendpoint)1