Java 类org.eclipse.gef.RootEditPart 实例源码

项目:PDFReporter-Studio    文件:JDReportOutlineView.java   
/**
 * Initialize overview.
 */
protected void initializeOverview() {
    LightweightSystem lws = new J2DLightweightSystem(overview);

    RootEditPart rep = editor.getGraphicalViewer().getRootEditPart();
    if (rep instanceof MainDesignerRootEditPart) {
        ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
        thumbnail = new JSSScrollableThumbnail((Viewport) root.getFigure(), (MRoot)getViewer().getContents().getModel());
        thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(thumbnail);
        disposeListener = new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                if (thumbnail != null) {
                    thumbnail.deactivate();
                    thumbnail = null;
                }
            }
        };
        editor.getEditor().addDisposeListener(disposeListener);
    }
    lws.setControl(overview);
}
项目:seg.jUCMNav    文件:UrnOutlinePage.java   
/**
 * Initialize the graphical overview.
 * 
 */
protected void initializeOverview() {
    if (multieditor.getCurrentPage() == null) {
        overview.setVisible(false);
        thumbnail.deactivate();
        thumbnail = null;
        return;
    }

    RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        refreshThumbnail((ScalableFreeformRootEditPart) rep);

        disposeListener = new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                if (thumbnail != null) {
                    thumbnail.deactivate();
                    thumbnail = null;
                }
            }
        };
        ((FigureCanvas) multieditor.getCurrentPage().getGraphicalViewer().getControl()).addDisposeListener(disposeListener);
    }
}
项目:seg.jUCMNav    文件:UrnOutlinePage.java   
/**
 * Refresh the overview thumbnail when the map changes.
 */
public void pageChanged() {
    if (multieditor.getCurrentPage() == null) {
        overview.setVisible(false);
        thumbnail.deactivate();
        thumbnail = null;
        return;
    }

    RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        refreshThumbnail((ScalableFreeformRootEditPart) rep);
    }

    refreshDefinitions(false);

}
项目:gw4e.project    文件:GraphTreeEditPart.java   
public EditPartViewer getViewer() {
    RootEditPart root = getRoot();
    if (root == null) {
        return null;
    }
    return root.getViewer();
}
项目:subclipse    文件:RevisionGraphEditor.java   
protected OverviewOutlinePage getOverviewOutlinePage() {
    if(null == overviewOutlinePage && null != getGraphicalViewer()) {
        RootEditPart rootEditPart = getGraphicalViewer().getRootEditPart();
        if(rootEditPart instanceof ScalableRootEditPart) {
            overviewOutlinePage =
                new OverviewOutlinePage(
                        (ScalableRootEditPart) rootEditPart);
        }
    }
    return overviewOutlinePage;
}
项目:NEXCORE-UML-Modeler    文件:ProjectUtil.java   
/**
 * 
 * platformUi에서 다이어그램 EditPart를 가져온다.
 * 
 * @return EditPart
 */
public static EditPart getDiagramEditPart() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    if (!checkNull(workbench)) {
        return null;
    }
    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
    if (!checkNull(workbenchWindow)) {
        return null;
    }
    IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
    if (!checkNull(workbenchPage)) {
        return null;
    }
    IEditorPart editorPart = workbenchPage.getActiveEditor();
    if (!checkNull(editorPart)) {
        return null;
    }
    if (!(editorPart instanceof AbstractDiagramEditor)) {
        return null;
    }
    GraphicalViewer graphicalViewer = ((AbstractDiagramEditor) editorPart).getDiagramGraphicalViewer();
    if (!checkNull(graphicalViewer)) {
        return null;
    }
    RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
    if (!checkNull(rootEditPart)) {
        return null;
    }
    EditPart editPart = rootEditPart.getContents();
    if (!checkNull(editPart)) {
        return null;
    }

    return editPart;
}
项目:NEXCORE-UML-Modeler    文件:ScrollableEditPart.java   
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
 */
@Override
public RootEditPart getRoot() {
    if (getParent() != null && getParent().getParent() != null) {
        return super.getRoot();
    } else {
        return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow()
            .getActivePage()
            .getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
    }
    // return super.getRoot();
}
项目:NEXCORE-UML-Modeler    文件:LifeLineEditPart.java   
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
 */
@Override
public RootEditPart getRoot() {
    if (getParent() != null && getParent().getParent() != null) {
        return super.getRoot();
    } else {
        return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow()
            .getActivePage()
            .getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
    }
}
项目:statecharts    文件:FeedbackGraphicalNodeEditPolicy.java   
protected IMapMode getMapMode() {
    RootEditPart root = getHost().getRoot();
    if (root instanceof DiagramRootEditPart) {
        DiagramRootEditPart dgrmRoot = (DiagramRootEditPart) root;
        return dgrmRoot.getMapMode();
    }

    return MapModeUtil.getMapMode();
}
项目:PDFReporter-Studio    文件:JDRulerComposite.java   
/**
 * @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
 */
public void appendSelection(EditPart editpart) {
    if (editpart instanceof RootEditPart)
        editpart = ((RootEditPart) editpart).getContents();
    setFocus(editpart);
    super.appendSelection(editpart);
}
项目:PDFReporter-Studio    文件:ContainerTreeEditPart.java   
/**
 * Creates and installs pertinent EditPolicies.
 */
@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
    installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
    //Overwrite the policy that handle the delete, so i have a custom delete command to close the subeditor
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new CloseSubeditorDeletePolicy());
    // If this editpart is the contents of the viewer, then it is not deletable!
    if (getParent() instanceof RootEditPart)
        installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
项目:PDFReporter-Studio    文件:NotDragableContainerTreeEditPart.java   
/**
 * Creates and installs pertinent EditPolicies.
 */
@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
    installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
    // If this editpart is the contents of the viewer, then it is not deletable!
    if (getParent() instanceof RootEditPart)
        installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
项目:PDFReporter-Studio    文件:StyleContainerTreeEditPart.java   
/**
 * Creates and installs pertinent EditPolicies.
 */
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDStyleContainerEditPolicy());
    installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDStyleTreeContainerEditPolicy());
    // If this editpart is the contents of the viewer, then it is not deletable!
    if (getParent() instanceof RootEditPart)
        installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
项目:OpenSPIFe    文件:TimelineTool.java   
@Override
protected boolean handleMove() {
    try {
        EditPartViewer viewer = getCurrentViewer();
        if (viewer instanceof TimelineViewer) {
            TimelineViewer timelineViewer = (TimelineViewer) viewer;
            RootEditPart rootEditPart = timelineViewer.getRootEditPart();
            List children = rootEditPart.getChildren();
            if ((children.size() != 1) || !(children.get(0) instanceof SplitScroller)) {
                // Don't update the cursor time while in the horizontal scroller.
                // Scrolling and updating the cursor time together interact very poorly.
                // The effect seen was that the scrollbar would follow the cursor until
                // the mouse was released at which point the scrollbar would snap to the
                // right, hiding what the user had revealed.
                TimelineUtils.updateCursorTime(timelineViewer, this);
            }
        }
        String tooltipPreference = TimelineConstants.TIMELINE_PREFERENCES.getString(TimelinePreferencePage.P_TOOLTIP_SPEED);
        Tooltip value = Tooltip.valueOf(tooltipPreference);
        if (value == Tooltip.FAST) {
            handleHover();
        }
    } catch (Exception e) {
        LogUtil.error("handleMove", e);
    }       
    return super.handleMove();
}
项目:OpenSPIFe    文件:TimelineViewerEditPart.java   
@Override
public RootEditPart getRoot() {
    if (getParent() == null) {
        return null;
    }
    return super.getRoot();
}
项目:OpenSPIFe    文件:TimelineViewerEditPart.java   
/**
 * Convenience method to retrieve the casted viewer.
 */
@Override
public TimelineViewer getViewer() {
    RootEditPart root = getRoot();
    if (root == null) {
        return null;
    }
    return (TimelineViewer) root.getViewer();
}
项目:gef-gwt    文件:AbstractEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getRoot()
 */
public RootEditPart getRoot() {
    if (getParent() == null) {
        return null;
    }
    return getParent().getRoot();
}
项目:gef-gwt    文件:AbstractEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getViewer()
 */
public EditPartViewer getViewer() {
    RootEditPart root = getRoot();
    if (root == null) {
        return null;
    }
    return root.getViewer();
}
项目:gef-gwt    文件:AbstractEditPartViewer.java   
/**
 * @see EditPartViewer#setRootEditPart(RootEditPart)
 */
public void setRootEditPart(RootEditPart editpart) {
    if (rootEditPart != null) {
        if (rootEditPart.isActive())
            rootEditPart.deactivate();
        rootEditPart.setViewer(null);
    }
    rootEditPart = editpart;
    rootEditPart.setViewer(this);
    if (getControl() != null)
        rootEditPart.activate();
}
项目:gef-gwt    文件:RulerComposite.java   
/**
 * @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
 */
public void appendSelection(EditPart editpart) {
    if (editpart instanceof RootEditPart)
        editpart = ((RootEditPart) editpart).getContents();
    setFocus(editpart);
    super.appendSelection(editpart);
}
项目:gef-gwt    文件:GwtRulerComposite.java   
/**
 * @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
 */
public void appendSelection(EditPart editpart) {
    if (editpart instanceof RootEditPart)
        editpart = ((RootEditPart) editpart).getContents();
    setFocus(editpart);
    super.appendSelection(editpart);
}
项目:birt    文件:EditorRulerComposite.java   
/**
 * @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
 */
public void appendSelection( EditPart editpart )
{
    if ( editpart instanceof RootEditPart )
        editpart = ( (RootEditPart) editpart ).getContents( );
    setFocus( editpart );
    super.appendSelection( editpart );
}
项目:seg.jUCMNav    文件:KPIRootEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getRoot()
 */
public RootEditPart getRoot() {
    if (getParent() == null)
        return null;
    else
        return getParent().getRoot();
}
项目:seg.jUCMNav    文件:KPIUrnModelElementTreeEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getRoot()
 */
public RootEditPart getRoot() {
    if (getParent() == null)
        return null;
    else
        return getParent().getRoot();
}
项目:seg.jUCMNav    文件:StrategyUrnModelElementTreeEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getRoot()
 */
public RootEditPart getRoot() {
    if (getParent() == null)
        return null;
    else
        return getParent().getRoot();
}
项目:seg.jUCMNav    文件:StrategyRootEditPart.java   
/**
 * @see org.eclipse.gef.EditPart#getRoot()
 */
public RootEditPart getRoot() {
    if (getParent() == null)
        return null;
    else
        return getParent().getRoot();
}
项目:seg.jUCMNav    文件:UCMNavMultiPageEditor.java   
/**
 * Returns the zoom manager of the specified viewer.
 * 
 * @param viewer
 *            the viewer to get the zoom manager from
 * @return the zoom manager
 */
protected ZoomManager getZoomManager(GraphicalViewer viewer) {
    // get zoom manager from root edit part
    RootEditPart rootEditPart = viewer.getRootEditPart();
    ZoomManager zoomManager = null;
    if (rootEditPart instanceof ScalableFreeformRootEditPart) {
        zoomManager = ((ScalableFreeformRootEditPart) rootEditPart).getZoomManager();
    } else if (rootEditPart instanceof ScalableRootEditPart) {
        zoomManager = ((ScalableRootEditPart) rootEditPart).getZoomManager();
    }
    return zoomManager;
}
项目:lunifera-sharky-m2m    文件:DiagramTreeEditPart.java   
protected void createEditPolicies() {
    // If this editpart is the root content of the viewer, then disallow
    // removal
    if (getParent() instanceof RootEditPart) {
        installEditPolicy(EditPolicy.COMPONENT_ROLE,
                new RootComponentEditPolicy());
    }
}
项目:lunifera-sharky-m2m    文件:DiagramTreeEditPart.java   
protected void createEditPolicies() {
    // If this editpart is the root content of the viewer, then disallow
    // removal
    if (getParent() instanceof RootEditPart) {
        installEditPolicy(EditPolicy.COMPONENT_ROLE,
                new RootComponentEditPolicy());
    }
}
项目:ForgedUI-Eclipse    文件:DiagramOutlinePage2.java   
public DiagramOutlinePage2(GUIEditor editor,EditPartViewer viewer, Diagram diagram, RootEditPart rep){
    super(viewer);
    this.rep = rep;
    this.diagram = diagram;
    this.editor = editor;
}
项目:NEXCORE-UML-Modeler    文件:RealizationEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                    }
                }
            }
        }
    });
    // PolygonDecoration polygonDecoreation = new PolygonDecoration();
    // polygonDecoreation.setScale(10,5);
    // connection.setTargetDecoration(polygonDecoreation);
    // connection.setLineStyle(SWT.LINE_DOT);
    // connection.addRoutingListener(RoutingAnimator.getDefault());
    // connection.setConnectionRouter(new BendpointConnectionRouter());

    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    polygonDecoreation.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    polygonDecoreation.setScale(10, 5);
    connection.setLineStyle(SWT.LINE_DOT);
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:DependencyEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setLineStyle(Graphics.LINE_DOT);
    ArrowDecoration arrow = new ArrowDecoration();
    connection.setTargetDecoration(arrow);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                    }
                }
            }
        }
    });

    return connection;
}
项目:NEXCORE-UML-Modeler    文件:AssociationEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {

    settingLineCondition();

    PolylineConnection polylineConnection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    polylineConnection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }

                    }
                }
            }
        }
    });

    return drawDecoration(polylineConnection);

}
项目:NEXCORE-UML-Modeler    文件:ControlFlowEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                    }
                }
            }
        }
    });
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:IncludeEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }
                    }
                }
            }
        }
    });

    connection.setTargetDecoration(new ArrowDecoration());
    connection.setLineStyle(Graphics.LINE_DOT);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:ExtendEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }
                    }
                }
            }
        }
    });

    connection.setTargetDecoration(new ArrowDecoration());
    connection.setLineStyle(Graphics.LINE_DOT);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
项目:statecharts    文件:StatechartDiagramEditPartProvider.java   
public RootEditPart createRootEditPart(Diagram diagram) {
    return new SCTRenderedDiagramRootEditPart(diagram.getMeasurementUnit());
}
项目:gef-gwt    文件:SimpleRootEditPart.java   
/**
 * @see EditPart#getRoot()
 */
public RootEditPart getRoot() {
    return this;
}
项目:gef-gwt    文件:GraphicalViewerImpl.java   
/**
 * @see org.eclipse.gef.EditPartViewer#setRootEditPart(org.eclipse.gef.RootEditPart)
 */
public void setRootEditPart(RootEditPart editpart) {
    super.setRootEditPart(editpart);
    setRootFigure(((GraphicalEditPart) editpart).getFigure());
}
项目:gef-gwt    文件:AbstractEditPartViewer.java   
/**
 * @see EditPartViewer#getRootEditPart()
 */
public RootEditPart getRootEditPart() {
    return rootEditPart;
}