Package diva.graph

Examples of diva.graph.GraphPane


        //                throw new RuntimeException("Failed to open '" + _modelURL
        //                        + "'.", ex);
        //            }
        //        }

        GraphPane pane = null;

        // FIXME: Temporary hack so we can view FSMs properly.
        // This should be replaced with a proper tableau mechanism.
        if (_toplevel instanceof FSMActor) {
            FSMGraphController controller = new FSMGraphController();
            FSMGraphModel graphModel = new FSMGraphModel((FSMActor) _toplevel);

            // FIXME: To get things like open documentation to work, have
            // to specify a configuration.  But currently, there isn't one.
            if (_configuration != null) {
                controller.setConfiguration(_configuration);
            }

            pane = new GraphPane(controller, graphModel);
        } else {
            // top level is not an FSM actor.
            ActorViewerGraphController controller = new ActorViewerGraphController();

            controller.setConfiguration(_configuration);

            GraphModel model = new ActorGraphModel(_toplevel);
            pane = new GraphPane(controller, model);
        }

        JGraph modelViewer = new JGraph(pane);

        // Get dimensions from the model, if they are present.
View Full Code Here


        _controller.setFrame(this);

        // The cast is safe because the constructor only accepts
        // CompositeEntity.
        final ActorGraphModel graphModel = new ActorGraphModel(entity);
        return new GraphPane(_controller, graphModel);
    }
View Full Code Here

     @param refinement The case.
     *  @param newPane True to add the pane prior to the last pane.
     *  @return The pane.
     */
    private JGraph _addTabbedPane(Refinement refinement, boolean newPane) {
        GraphPane pane = _createGraphPane(refinement);
        pane.getForegroundLayer().setPickHalo(2);
        pane.getForegroundEventLayer().setConsuming(false);
        pane.getForegroundEventLayer().setEnabled(true);
        pane.getForegroundEventLayer().addLayerListener(new LayerAdapter() {
            /** Invoked when the mouse is pressed on a layer
             * or figure.
             */
            public void mousePressed(LayerEvent event) {
                Component component = event.getComponent();
View Full Code Here

         */
        public GraphModel getGraphModel() {
            if (_tabbedPane != null) {
                Component tab = _tabbedPane.getSelectedComponent();
                if (tab instanceof JGraph) {
                    GraphPane pane = ((JGraph) tab).getGraphPane();
                    return pane.getGraphModel();
                }
            }
            // Fallback position.
            return super.getGraphModel();
        }
View Full Code Here

     *  at that time.
     */
    protected void initializeInteraction() {
        // NOTE: This method name does not have a leading underscore
        // because it is a diva method.
        GraphPane pane = getGraphPane();

        // Create and set up the selection dragger
        _selectionDragger = new SelectionDragger(pane);
        _selectionDragger.addSelectionModel(getSelectionModel());

View Full Code Here

        // NOTE: The cast is safe because the constructor accepts
        // only CompositeEntity.
        final FSMGraphModel graphModel = new FSMGraphModel(
                (CompositeEntity) entity);
        return new GraphPane(_controller, graphModel);
    }
View Full Code Here

        _graph = _constructGraph();

        // display the graph.
        final GraphController gc = new BusContentionGraphController();

        final GraphPane gp = new GraphPane(gc, _graph);
        _jgraph = new JGraph(gp);
        _jgraph.repaint();

        // Adding it to the center so that it fills the containing panel.
        _divaPanel.add(_jgraph, BorderLayout.CENTER);
View Full Code Here

    private 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);
                    LevelLayout staticLayout = new LevelLayout(target);
                    staticLayout.setOrientation(LevelLayout.HORIZONTAL);
                    staticLayout.layout(layoutGraph.getRoot());
                    pane.repaint();
                }
            });
        } catch (Exception e) {
            System.out.println(e);
        }
View Full Code Here

         * This initialization cannot be done in the constructor because
         * the controller does not yet have a reference to its pane
         * at that time.
         */
        protected void initializeInteraction() {
            GraphPane pane = getGraphPane();

            // Create and set up the selection dragger
            _selectionDragger = new SelectionDragger(pane);
            _selectionDragger.addSelectionModel(getSelectionModel());
        }
View Full Code Here

                        x = center.getX();
                        y = center.getY();
                    }
                } else {
                    // Put in the middle of the pane.
                    GraphPane pane = getGraphPane();
                    Point2D center = pane.getSize();
                    x = center.getX() / 2;
                    y = center.getY() / 2;
                }
            } else {
                // Transform
View Full Code Here

TOP

Related Classes of diva.graph.GraphPane

Copyright © 2018 www.massapicom. 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.