Search in sources :

Example 41 with GraphicalEditPart

use of org.eclipse.gef.GraphicalEditPart in project tdi-studio-se by Talend.

the class DataBusinessItemNameEditPart method createDefaultEditPolicies.

/**
     * @generated
     */
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {

        protected List createSelectionHandles() {
            List handles = new ArrayList();
            NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
            return handles;
        }

        public Command getCommand(Request request) {
            return null;
        }

        public boolean understandsRequest(Request request) {
            return false;
        }
    });
}
Also used : LabelDirectEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy) Command(org.eclipse.gef.commands.Command) ArrayList(java.util.ArrayList) Request(org.eclipse.gef.Request) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) List(java.util.List) ArrayList(java.util.ArrayList) NonResizableEditPolicy(org.eclipse.gef.editpolicies.NonResizableEditPolicy) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)

Example 42 with GraphicalEditPart

use of org.eclipse.gef.GraphicalEditPart in project tdi-studio-se by Talend.

the class ConnectionResumingEditPart method addChildVisual.

protected void addChildVisual(EditPart childEditPart, int index) {
    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
    getContentPane().add(child, index);
}
Also used : AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IFigure(org.eclipse.draw2d.IFigure)

Example 43 with GraphicalEditPart

use of org.eclipse.gef.GraphicalEditPart in project tdi-studio-se by Talend.

the class MapperRootEditPart method addChildVisual.

@Override
protected void addChildVisual(EditPart childEditPart, int index) {
    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
    if (childEditPart instanceof InputTablePart) {
        /* get first figure to put all input tables figures in */
        Object model = childEditPart.getModel();
        index = getRootModelManager().getInputTables().indexOf(model);
        if (index != -1) {
            leftFigure.add(child, index);
        } else {
            leftFigure.add(child);
        }
    }
    if (childEditPart instanceof OutputTablePart) {
        /* get third figure to put all output tables figures in */
        Object model = childEditPart.getModel();
        index = getRootModelManager().getOutputTables().indexOf(model);
        if (index != -1) {
            rightFigure.add(child, index);
        } else {
            rightFigure.add(child);
        }
    }
    if (childEditPart instanceof VarTablePart) {
        Object model = childEditPart.getModel();
        index = getRootModelManager().getVarTables().indexOf(model);
        if (index != -1) {
            // had added search figure when inited the center figure.
            if (centerFigure.getChildren() != null && centerFigure.getChildren().size() != 0) {
                centerFigure.add(child, index + centerFigure.getChildren().size());
            } else {
                centerFigure.add(child, index);
            }
        } else {
            centerFigure.add(child);
        }
    }
}
Also used : GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IFigure(org.eclipse.draw2d.IFigure)

Example 44 with GraphicalEditPart

use of org.eclipse.gef.GraphicalEditPart in project tdi-studio-se by Talend.

the class DocumentBusinessItemNameEditPart method createDefaultEditPolicies.

/**
     * @generated
     */
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {

        protected List createSelectionHandles() {
            List handles = new ArrayList();
            NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
            return handles;
        }

        public Command getCommand(Request request) {
            return null;
        }

        public boolean understandsRequest(Request request) {
            return false;
        }
    });
}
Also used : LabelDirectEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy) Command(org.eclipse.gef.commands.Command) ArrayList(java.util.ArrayList) Request(org.eclipse.gef.Request) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) List(java.util.List) ArrayList(java.util.ArrayList) NonResizableEditPolicy(org.eclipse.gef.editpolicies.NonResizableEditPolicy) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)

Example 45 with GraphicalEditPart

use of org.eclipse.gef.GraphicalEditPart in project tdi-studio-se by Talend.

the class GearBusinessItemNameEditPart method createDefaultEditPolicies.

/**
     * @generated
     */
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy() {

        protected List createSelectionHandles() {
            List handles = new ArrayList();
            NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
            return handles;
        }

        public Command getCommand(Request request) {
            return null;
        }

        public boolean understandsRequest(Request request) {
            return false;
        }
    });
}
Also used : LabelDirectEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy) Command(org.eclipse.gef.commands.Command) ArrayList(java.util.ArrayList) Request(org.eclipse.gef.Request) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) List(java.util.List) ArrayList(java.util.ArrayList) NonResizableEditPolicy(org.eclipse.gef.editpolicies.NonResizableEditPolicy) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)

Aggregations

GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)53 ArrayList (java.util.ArrayList)17 List (java.util.List)16 Rectangle (org.eclipse.draw2d.geometry.Rectangle)15 Command (org.eclipse.gef.commands.Command)15 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)13 Point (org.eclipse.draw2d.geometry.Point)12 Request (org.eclipse.gef.Request)12 IFigure (org.eclipse.draw2d.IFigure)11 NonResizableEditPolicy (org.eclipse.gef.editpolicies.NonResizableEditPolicy)11 DirectEditRequest (org.eclipse.gef.requests.DirectEditRequest)11 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)11 LabelDirectEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy)11 EditPart (org.eclipse.gef.EditPart)7 Dimension (org.eclipse.draw2d.geometry.Dimension)6 ConnectionContainerEditPart (org.knime.workbench.editor2.editparts.ConnectionContainerEditPart)4 Iterator (java.util.Iterator)3 ConnectionEditPart (org.eclipse.gef.ConnectionEditPart)3 EditPartViewer (org.eclipse.gef.EditPartViewer)3 AbstractWorkflowPortBarEditPart (org.knime.workbench.editor2.editparts.AbstractWorkflowPortBarEditPart)3