Examples of GraphController


Examples of com.dubture.composer.ui.controller.GraphController

    Composite body = form.getBody();
    body.setLayout(new FillLayout());
   
    project = getComposerEditor().getProject();
    composerProject = ComposerPlugin.getDefault().getComposerProject(project);
    graphController = new GraphController(composerProject);
    graphController.setComposerProject(composerProject);
    viewer = new GraphViewer(body, SWT.NO_REDRAW_RESIZE);
    viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
    viewer.setContentProvider(graphController);
    viewer.setLabelProvider(graphController);
View Full Code Here

Examples of de.hpi.eworld.networkview.GraphController

  /**
   * Creates an instance of each possible model element and calls createViewItem with it to check if the correct ViewModel element is created from it
   */
  @Test
  public void testCreateViewItem() {
    networkView = new GraphController(null);
    // networkView.onModelCleared();
    Assert.assertEquals(0, networkView.getGraphModel().items().length);
    testAddModelElements();
    testRemoveModelElements();
    networkView = null;
View Full Code Here

Examples of diva.graph.GraphController

     * any deleted nodes.
     */
    public void actionPerformed(ActionEvent e) {
        JGraph jgraph = (JGraph) e.getSource();
        GraphPane graphPane = jgraph.getGraphPane();
        GraphController controller = graphPane.getGraphController();
        GraphModel graphModel = controller.getGraphModel();
        SelectionModel model = controller.getSelectionModel();
        Object[] selection = model.getSelectionAsArray();
        Object[] userObjects = new Object[selection.length];

        // First remove the selection.
        for (int i = 0; i < selection.length; i++) {
            userObjects[i] = ((Figure) selection[i]).getUserObject();
            model.removeSelection(selection[i]);
        }

        // Remove all the edges first, since if we remove the nodes first,
        // then removing the nodes might remove some of the edges.
        for (int i = 0; i < userObjects.length; i++) {
            Object userObject = userObjects[i];

            if (graphModel.isEdge(userObject)) {
                controller.removeEdge(userObject);
            }
        }

        for (int i = 0; i < selection.length; i++) {
            Object userObject = userObjects[i];

            if (graphModel.isNode(userObject)) {
                controller.removeNode(userObject);
            }
        }
    }
View Full Code Here

Examples of diva.graph.GraphController

        getContentPane().add(_divaPanel);

        _graph = _constructDivaGraph();

        // display the graph.
        final GraphController gc = new LocalZenoGraphController();
        final GraphPane gp = new GraphPane(gc, _graph);
        _jgraph = new JGraph(gp);
        _divaPanel.add(_jgraph);

        StateListener listener = new StateListener((GraphPane) _jgraph
View Full Code Here

Examples of diva.graph.GraphController

     */
    protected void _doLayout(GraphModel graph, GraphPane gp) {
        // Do the layout
        try {
            final GraphModel layoutGraph = graph;
            final GraphController gc = gp.getGraphController();
            final GraphPane pane = gp;
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    // Layout is a bit stupid
                    LayoutTarget target = new BasicLayoutTarget(gc);
View Full Code Here

Examples of diva.graph.GraphController

     *  and connections. The created typed composite actor is transparent.
     *  The resulting topology is the same in the sense
     *  of deep connectivities.
     */
    public void createHierarchy() {
        GraphController controller = _getGraphController();
        SelectionModel model = controller.getSelectionModel();
        AbstractBasicGraphModel graphModel = (AbstractBasicGraphModel) controller
                .getGraphModel();
        Object[] selection = model.getSelectionAsArray();

        // A set, because some objects may represent the same
        // ptolemy object.
View Full Code Here

Examples of diva.graph.GraphController

     */
    public void delete() {
        // Note that we previously a delete was handled at the model level.
        // Now a delete is handled by generating MoML to carry out the delete
        // and handing that MoML to the parser
        GraphController controller = _getGraphController();
        SelectionModel model = controller.getSelectionModel();
        AbstractBasicGraphModel graphModel = (AbstractBasicGraphModel) controller
                .getGraphModel();
        Object[] selection = model.getSelectionAsArray();

        // Generate the MoML to carry out the deletion
        StringBuffer moml = _deleteMoML(graphModel, selection, model);
View Full Code Here

Examples of diva.graph.GraphController

    }

    /** Layout the graph view.
     */
    public void layoutGraph() {
        GraphController controller = _getGraphController();
        AbstractBasicGraphModel model = _getGraphModel();
        LayoutTarget target = new PtolemyLayoutTarget(controller);
        PtolemyLayout layout = new PtolemyLayout(target);
        layout.setOrientation(LevelLayout.HORIZONTAL);
        layout.setRandomizedPlacement(false);
View Full Code Here

Examples of diva.graph.GraphController

    /** Return the graph model associated with this frame.
     *  @return The graph model associated with this frame.
     */
    protected AbstractBasicGraphModel _getGraphModel() {
        GraphController controller = _getGraphController();
        return (AbstractBasicGraphModel) controller.getGraphModel();
    }
View Full Code Here

Examples of diva.graph.GraphController

     *  defined by the container, then call sortContainedObjects()
     *  on the container to sort the result.
     *  @return The set of selected objects.
     */
    protected HashSet _getSelectionSet() {
        GraphController controller = _getGraphController();
        GraphModel graphModel = controller.getGraphModel();
        SelectionModel model = controller.getSelectionModel();
        Object[] selection = model.getSelectionAsArray();

        // A set, because some objects may represent the same
        // ptolemy object.
        HashSet namedObjSet = new HashSet();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.