org.eclipse.draw2d.SimpleRaisedBorder Java Examples

The following examples show how to use org.eclipse.draw2d.SimpleRaisedBorder. 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: TableViewGraphicalNodeEditPolicy.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
@Override
public void showTargetFeedback(final Request request) {
    final ERDiagram diagram = (ERDiagram) getHost().getRoot().getContents().getModel();

    if (diagram.isTooltip()) {
        final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
        final double zoom = zoomManager.getZoom();

        final TableView tableView = (TableView) getHost().getModel();
        final Rectangle tableBounds = getHostFigure().getBounds();

        final String name = TableViewEditPart.getTableViewName(tableView, diagram);

        final Label label = new Label();
        label.setText(name);
        label.setBorder(new SimpleRaisedBorder());
        label.setBackgroundColor(ColorConstants.orange);
        label.setOpaque(true);

        final Dimension dim = FigureUtilities.getTextExtents(name, Display.getCurrent().getSystemFont());

        label.setBounds(new Rectangle((int) (zoom * (tableBounds.x + 33)), (int) (zoom * (tableBounds.y + 5)), (int) (dim.width * 1.5), 20));

        addFeedback(label);
    }
    super.showTargetFeedback(request);
}
 
Example #2
Source File: TableViewGraphicalNodeEditPolicy.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public void showTargetFeedback(Request request) {
    final ERDiagram diagram = ERModelUtil.getDiagram(getHost().getRoot().getContents());

    if (diagram.isTooltip()) {
        final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
        final double zoom = zoomManager.getZoom();

        final TableView tableView = (TableView) getHost().getModel();
        final Rectangle tableBounds = getHostFigure().getBounds();

        final String name = TableViewEditPart.getTableViewName(tableView, diagram);

        final Label label = new Label();
        label.setText(name);
        label.setBorder(new SimpleRaisedBorder());
        label.setBackgroundColor(ColorConstants.orange);
        label.setOpaque(true);

        final Dimension dim = FigureUtilities.getTextExtents(name, Display.getCurrent().getSystemFont());

        label.setBounds(new Rectangle(
                (int) (zoom * (tableBounds.x + 33)),
                (int) (zoom * (tableBounds.y + 5)),
                (int) (dim.width * 1.5), 20));

        addFeedback(label);
    }
    super.showTargetFeedback(request);
}
 
Example #3
Source File: TableViewGraphicalNodeEditPolicy.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
@Override
public void showTargetFeedback(Request request) {
	ERDiagram diagram = ERModelUtil.getDiagram(this.getHost().getRoot().getContents());

	if (diagram.isTooltip()) {
		ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
				.getHost().getRoot()).getZoomManager();
		double zoom = zoomManager.getZoom();

		TableView tableView = (TableView) this.getHost().getModel();
		Rectangle tableBounds = this.getHostFigure().getBounds();

		String name = TableViewEditPart.getTableViewName(tableView, diagram);

		Label label = new Label();
		label.setText(name);
		label.setBorder(new SimpleRaisedBorder());
		label.setBackgroundColor(ColorConstants.orange);
		label.setOpaque(true);

		Dimension dim = FigureUtilities.getTextExtents(name, Display
				.getCurrent().getSystemFont());

		label.setBounds(new Rectangle((int) (zoom * (tableBounds.x + 33)),
				(int) (zoom * (tableBounds.y + 5)),
				(int) (dim.width * 1.5), 20));

		this.addFeedback(label);
	}
	super.showTargetFeedback(request);
}