Search in sources :

Example 11 with GraphicalEditPart

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

the class NodeProgressBarPart method refreshVisuals.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
     */
@Override
protected void refreshVisuals() {
    Node node = ((NodeContainer) ((NodeContainerPart) getParent()).getModel()).getNode();
    NodeLabel nodeLabel = node.getNodeLabel();
    NodeProgressBarFigure progressFig = (NodeProgressBarFigure) this.getFigure();
    Point loc = node.getLocation().getCopy();
    NodeError nodeError = node.getNodeError();
    Dimension size = progressFig.getSize();
    loc.x = loc.x + (node.getSize().width - size.width) / 2 + size.width / 7;
    loc.y = loc.y + node.getSize().height + nodeLabel.getLabelSize().height + nodeError.getErrorSize().height;
    Rectangle rectangle = new Rectangle(loc, size);
    ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), rectangle);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer) Point(org.eclipse.draw2d.geometry.Point) Dimension(org.eclipse.draw2d.geometry.Dimension) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart)

Example 12 with GraphicalEditPart

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

the class ConnectionPart method addChildVisual.

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

Example 13 with GraphicalEditPart

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

the class SubjobContainerPart method refreshVisuals.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
     */
@Override
public void refreshVisuals() {
    Boolean isDisplaySubjobs = ((SubjobContainer) this.getModel()).isDisplayed();
    if (getParent() == null || !isDisplaySubjobs) {
        return;
    }
    Rectangle rectangle = ((SubjobContainer) this.getModel()).getSubjobContainerRectangle();
    if (rectangle == null) {
        return;
    }
    ((SubjobContainerFigure) getFigure()).initializeSubjobContainer(rectangle);
    // added for bug 4005
    if (getFigure().getParent() != null) {
        ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), rectangle);
    }
}
Also used : SparkStreamingSubjobContainerFigure(org.talend.designer.core.ui.editor.subjobcontainer.sparkstreaming.SparkStreamingSubjobContainerFigure) Rectangle(org.eclipse.draw2d.geometry.Rectangle) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart)

Example 14 with GraphicalEditPart

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

the class ConnectionTraceEditPart 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 15 with GraphicalEditPart

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

the class RowSelectionEditPolicy method createSelectionHandles.

@Override
protected List createSelectionHandles() {
    List list = new ArrayList();
    list.add(new RowMoveHandler((GraphicalEditPart) getHost()));
    return list;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart)

Aggregations

GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)36 ArrayList (java.util.ArrayList)14 List (java.util.List)14 Command (org.eclipse.gef.commands.Command)13 Request (org.eclipse.gef.Request)12 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)12 Rectangle (org.eclipse.draw2d.geometry.Rectangle)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 IFigure (org.eclipse.draw2d.IFigure)10 Point (org.eclipse.draw2d.geometry.Point)10 Dimension (org.eclipse.draw2d.geometry.Dimension)6 EditPart (org.eclipse.gef.EditPart)3 HANode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HANode)2 HANodePart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart)2 Iterator (java.util.Iterator)2 UnexecutableCommand (org.eclipse.gef.commands.UnexecutableCommand)2 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)2