use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class RoundedTitleTabBorder method calculateInsets.
@Override
protected Insets calculateInsets(IFigure figure) {
Insets insets = new Insets(LINE_WIDTH);
Dimension textExtents = getTextExtents(figure);
insets.top += textExtents.height;
return insets;
}
use of org.eclipse.draw2d.geometry.Insets 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);
}
};
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class UnderlineStyledBorder method getInsets.
public Insets getInsets(IFigure figure) {
Insets insets = getInsets();
int lw = getLineWidth();
return new Insets(0, 0, lw, 0).add(insets);
}
use of org.eclipse.draw2d.geometry.Insets in project dbeaver by serge-rider.
the class ERDEditorPart method printDiagram.
public void printDiagram() {
GraphicalViewer viewer = getGraphicalViewer();
PrintDialog dialog = new PrintDialog(viewer.getControl().getShell(), SWT.NULL);
PrinterData data = dialog.open();
if (data != null) {
IFigure rootFigure = rootPart.getLayer(ScalableFreeformRootEditPart.PRINTABLE_LAYERS);
// EntityDiagramFigure diagramFigure = findFigure(rootFigure, EntityDiagramFigure.class);
if (rootFigure != null) {
PrintFigureOperation printOp = new PrintFigureOperation(new Printer(data), rootFigure);
// Set print preferences
DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();
printOp.setPrintMode(store.getInt(ERDUIConstants.PREF_PRINT_PAGE_MODE));
printOp.setPrintMargin(new Insets(store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_TOP), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_LEFT), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_BOTTOM), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_RIGHT)));
// Run print
printOp.run("Print ER diagram");
}
}
// new PrintAction(this).run();
}
use of org.eclipse.draw2d.geometry.Insets in project dbeaver by serge-rider.
the class EditableLabel method getSelectionRectangle.
private Rectangle getSelectionRectangle() {
Rectangle bounds = getTextBounds().getCopy();
bounds.expand(new Insets(2, 2, 0, 0));
translateToParent(bounds);
bounds.intersect(getBounds());
return bounds;
}
Aggregations