Search in sources :

Example 6 with RoundedRectangle

use of org.eclipse.draw2d.RoundedRectangle in project webtools.sourceediting by eclipse.

the class BaseDragAndDropCommand method getFeedbackFigure.

public IFigure getFeedbackFigure() {
    Figure panel = new Figure();
    panel.setLayoutManager(new FreeformLayout());
    panel.setOpaque(false);
    Polyline feedbackFigure = new Polyline();
    feedbackFigure.setLineWidth(2);
    drawLines(feedbackFigure);
    originalLocation = new Rectangle(feedbackFigure.getBounds());
    panel.add(feedbackFigure);
    polyLine = new Polyline();
    polyLine.setLineStyle(Graphics.LINE_DASHDOT);
    polyLine.setLineWidth(1);
    panel.add(polyLine);
    panel.setBounds(originalLocation);
    addConnectorToParent(panel);
    if (parentEditPart != null && parentEditPart.getFigure() instanceof GenericGroupFigure) {
        GenericGroupFigure fig = (GenericGroupFigure) parentEditPart.getFigure();
        Rectangle iconBounds = getZoomedBounds(fig.getIconFigure().getBounds());
        RoundedRectangle roundedRectangle = new RoundedRectangle();
        roundedRectangle.setFill(false);
        roundedRectangle.setOpaque(true);
        // roundedRectangle.setBounds(new Rectangle(iconBounds.x, iconBounds.y, iconBounds.width - 1, iconBounds.height - 1));
        roundedRectangle.setBounds(iconBounds);
        panel.add(roundedRectangle);
    }
    return panel;
}
Also used : FreeformLayout(org.eclipse.draw2d.FreeformLayout) GenericGroupFigure(org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure) Polyline(org.eclipse.draw2d.Polyline) Rectangle(org.eclipse.draw2d.geometry.Rectangle) RoundedRectangle(org.eclipse.draw2d.RoundedRectangle) IFigure(org.eclipse.draw2d.IFigure) GenericGroupFigure(org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure) Figure(org.eclipse.draw2d.Figure) RoundedRectangle(org.eclipse.draw2d.RoundedRectangle)

Example 7 with RoundedRectangle

use of org.eclipse.draw2d.RoundedRectangle in project statecharts by Yakindu.

the class TreeLayoutEditPolicy method getFeedbackFigure.

private IFigure getFeedbackFigure() {
    if (feedbackFigure == null) {
        final RoundedRectangle pl = new RoundedRectangle();
        pl.setForegroundColor(ColorConstants.black);
        pl.setBackgroundColor(ColorConstants.black);
        pl.setBounds(getFeedbackFigureBounds());
        feedbackFigure = pl;
    }
    return feedbackFigure;
}
Also used : RoundedRectangle(org.eclipse.draw2d.RoundedRectangle)

Aggregations

RoundedRectangle (org.eclipse.draw2d.RoundedRectangle)7 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)3 Figure (org.eclipse.draw2d.Figure)2 IFigure (org.eclipse.draw2d.IFigure)2 Dimension (org.eclipse.draw2d.geometry.Dimension)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 AbstractDiagramModelObjectFigure (com.archimatetool.editor.diagram.figures.AbstractDiagramModelObjectFigure)1 IFigureDelegate (com.archimatetool.editor.diagram.figures.IFigureDelegate)1 IRoundedRectangleFigure (com.archimatetool.editor.diagram.figures.IRoundedRectangleFigure)1 PortletColumnElement (com.liferay.ide.layouttpl.core.model.PortletColumnElement)1 ColumnFigure (com.liferay.ide.layouttpl.ui.draw2d.ColumnFigure)1 Iterator (java.util.Iterator)1 ActionEvent (org.eclipse.draw2d.ActionEvent)1 ActionListener (org.eclipse.draw2d.ActionListener)1 FreeformLayout (org.eclipse.draw2d.FreeformLayout)1 ImageFigure (org.eclipse.draw2d.ImageFigure)1 Polyline (org.eclipse.draw2d.Polyline)1 RectangleFigure (org.eclipse.draw2d.RectangleFigure)1 Point (org.eclipse.draw2d.geometry.Point)1 PrecisionPoint (org.eclipse.draw2d.geometry.PrecisionPoint)1