Search in sources :

Example 46 with IFigure

use of org.eclipse.draw2d.IFigure in project tdi-studio-se by Talend.

the class BusinessItemRelationshipNameEditPart method createFigure.

/**
     * @generated
     */
protected IFigure createFigure() {
    IFigure label = createFigurePrim();
    defaultText = getLabelTextHelper(label);
    return label;
}
Also used : IFigure(org.eclipse.draw2d.IFigure)

Example 47 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class AbstractBasicPart method propertyChange.

public void propertyChange(PropertyChangeEvent evt) {
    String property = evt.getPropertyName();
    if (PropertyChangeProvider.CHILD_CHANGE.equals(property)) {
        handleChildChange(evt);
    } else if (PropertyChangeProvider.REORDER_CHANGE.equals(property)) {
        handleReorderChange(evt);
    } else if (PropertyChangeProvider.OUTPUT_CHANGE.equals(property)) {
        handleOutputChange(evt);
    } else if (PropertyChangeProvider.INPUT_CHANGE.equals(property)) {
        handleInputChange(evt);
    } else if (PropertyChangeProvider.TEXT_CHANGE.equals(property)) {
        handleLabelChange(evt);
    } else if (PropertyChangeProvider.BOUNDS_CHANGE.equals(property)) {
        handleBoundsChange(evt);
    } else if (PropertyChangeProvider.LAYOUT_CHANGE.equals(property)) {
        handleLayoutChange(evt);
    } else if (PropertyChangeProvider.AUTO_LAYOUT_TEMP.equals(property)) {
        handleTmpAutoLayout(evt);
    } else if (PropertyChangeProvider.VIEW_MODEL_CHANGE.equals(property)) {
        handleViewModelChange(evt);
    } else if (PropertyChangeProvider.RELATION_MAP_CHANGE.equals(property)) {
        handleRelationMapChange(evt);
    }
    if (PropertyChangeProvider.TEXT_CHANGE.equals(property)) {
        GraphicalEditPart graphicalEditPart = (GraphicalEditPart) (getViewer().getContents());
        IFigure partFigure = graphicalEditPart.getFigure();
        partFigure.getUpdateManager().performUpdate();
    }
    postSchemaDataChanged(evt);
}
Also used : AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IFigure(org.eclipse.draw2d.IFigure)

Example 48 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class ERScalableFreeformRootEditPart method getLayer.

public IFigure getLayer(Object key) {
    IFigure innerLayer = innerLayers == null ? null : innerLayers.getLayer(key);
    if (innerLayer != null) {
        return innerLayer;
    }
    LayeredPane scaledLayers = getScaledLayers();
    IFigure layer = scaledLayers == null ? null : scaledLayers.getLayer(key);
    if (layer != null) {
        return layer;
    }
    if (getPrintableLayers() == null) {
        return null;
    }
    return getPrintableLayers().getLayer(key);
}
Also used : FreeformLayeredPane(org.eclipse.draw2d.FreeformLayeredPane) LayeredPane(org.eclipse.draw2d.LayeredPane) IFigure(org.eclipse.draw2d.IFigure)

Example 49 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class SchemaXYLayoutPolicy method getCurrentConstraintFor.

@Override
public Rectangle getCurrentConstraintFor(GraphicalEditPart child) {
    IFigure fig = child.getFigure();
    Rectangle rectangle = (Rectangle) fig.getParent().getLayoutManager().getConstraint(fig);
    if (rectangle == null) {
        rectangle = fig.getBounds();
    }
    return rectangle;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) IFigure(org.eclipse.draw2d.IFigure)

Example 50 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method addHoverListener.

/**
	 * Add hovering listener for the figure
	 */
protected void addHoverListener() {
    final IFigure figure = this.getFigure();
    hoverListener = new MouseMotionListener() {

        public void mouseEntered(MouseEvent me) {
            setHoverState(true);
            setRelationLinesFocus(true);
        }

        public void mouseExited(MouseEvent me) {
            setHoverState(false);
            setRelationLinesFocus(false);
            setSelectedTableColor();
        }

        public void mouseHover(MouseEvent me) {
        }

        public void mouseDragged(MouseEvent me) {
        }

        public void mouseMoved(MouseEvent me) {
        }
    };
    figure.addMouseMotionListener(hoverListener);
}
Also used : MouseEvent(org.eclipse.draw2d.MouseEvent) MouseMotionListener(org.eclipse.draw2d.MouseMotionListener) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

IFigure (org.eclipse.draw2d.IFigure)225 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)61 Rectangle (org.eclipse.draw2d.geometry.Rectangle)42 Point (org.eclipse.draw2d.geometry.Point)36 Dimension (org.eclipse.draw2d.geometry.Dimension)30 PropertyChangeEvent (java.beans.PropertyChangeEvent)25 PropertyChangeListener (java.beans.PropertyChangeListener)25 List (java.util.List)20 Figure (org.eclipse.draw2d.Figure)17 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)13 DefaultSizeNodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure)12 NodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure)12 StackLayout (org.eclipse.draw2d.StackLayout)11 Iterator (java.util.Iterator)10 VType (org.diirt.vtype.VType)10 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)9 OPIColor (org.csstudio.opibuilder.util.OPIColor)9 EditPart (org.eclipse.gef.EditPart)9 ArrayList (java.util.ArrayList)7 Label (org.eclipse.draw2d.Label)7