Examples of JGraph


Examples of diva.graph.JGraph

                _createBlankEntity();
            }

            ActorGraphModel graphModel = new ActorGraphModel(_entity);
            GraphPane graphPane = new GraphPane(controller, graphModel);
            _graph = new JGraph(graphPane);

            // If the model has a recorded size, use it.
            List size = _entity.attributeList(SizeAttribute.class);
            if (size.size() > 0) {
                ((SizeAttribute) size.get(0)).setSize(_graph);
View Full Code Here

Examples of diva.graph.JGraph

    /** Construct a new instance of the graph demo in a particular context.
     *  @param context The context in which the demo is constructed.
     */
    public BasicGraphDemo(AppContext context) {
        final BasicGraphModel model = new BasicGraphModel();
        JGraph jg = new JGraph(new GraphPane(new BasicGraphController(), model));
        JGraph jg2 = new JGraph(
                new GraphPane(new BasicGraphController(), model));

        context.getContentPane().setLayout(new GridLayout(2, 1));
        context.getContentPane().add(jg);
        context.getContentPane().add(jg2);
View Full Code Here

Examples of diva.graph.JGraph

    /** Construct a new instance of the graph demo in a particular context.
     *  @param context The context in which the demo is constructed.
     */
    public BubbleGraphDemo(AppContext context) {
        JGraph jg = new JGraph(new BubblePane());
        context.getContentPane().add("Center", jg);

        ActionListener deletionListener = new DeletionListener();
        jg.registerKeyboardAction(deletionListener, "Delete", KeyStroke
                .getKeyStroke(KeyEvent.VK_DELETE, 0),
                JComponent.WHEN_IN_FOCUSED_WINDOW);
        jg.setRequestFocusEnabled(true);

        context.setSize(600, 400);
        context.setVisible(true);
    }
View Full Code Here

Examples of diva.graph.JGraph

            }
        });
    }

    public SimpleTutorial(AppContext context) {
        JGraph jg = new JGraph(new GraphPane(new BasicGraphController(),
                new BasicGraphModel()));
        context.getContentPane().add("Center", jg);
    }
View Full Code Here

Examples of diva.graph.JGraph

    public EditorTutorial(AppContext context) {
        _model = new BasicGraphModel();

        GraphPane pane = new GraphPane(new BasicGraphController(), _model);
        _editor = new JGraph(pane);
        context.getContentPane().add("Center", _editor);
        _target = new BasicLayoutTarget(_editor.getGraphPane()
                .getGraphController());
        _layout = new LevelLayout(_target);
View Full Code Here

Examples of diva.graph.JGraph

     * and are all clustered in the upper-left corner.  This
     * is remedied in the other techniques given below.
     */
    public void bogusLayout(MutableGraphModel model, AppContext context) {
        BasicGraphController gc = new BasicGraphController();
        context.getContentPane().add(new JGraph(new GraphPane(gc, model)));

        RandomLayout random = new RandomLayout(new BasicLayoutTarget(gc));
        random.layout(model.getRoot());
    }
View Full Code Here

Examples of diva.graph.JGraph

     * be useful in some cases.
     */
    public void layoutPostDisplay(final MutableGraphModel model,
            AppContext context) {
        final BasicGraphController bgc = new BasicGraphController();
        context.getContentPane().add(new JGraph(new GraphPane(bgc, model)));
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                RandomLayout random = new RandomLayout(new BasicLayoutTarget(
                        bgc));
                random.layout(model.getRoot());
View Full Code Here

Examples of diva.graph.JGraph

    public void setModelPostDisplay(MutableGraphModel model, AppContext context) {
        BasicGraphController gc = new BasicGraphController();
        gc.addGraphViewListener(new IncrementalLayoutListener(
                new IncrLayoutAdapter(
                        new LevelLayout(new BasicLayoutTarget(gc))), null));
        context.getContentPane().add(new JGraph(new GraphPane(gc, model)));
    }
View Full Code Here

Examples of diva.graph.JGraph

     * this might be useful in some cases.
     */
    public void layoutPostDisplay(final MutableGraphModel model,
            AppContext context) {
        final BasicGraphController bgc = new BasicGraphController();
        context.getContentPane().add(new JGraph(new GraphPane(bgc, model)));
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                RandomLayout random = new RandomLayout(new BasicLayoutTarget(
                        bgc));
                random.layout(model.getRoot());
View Full Code Here

Examples of diva.graph.JGraph

     * Delete any nodes or edges from the graph that are currently
     * selected.  In addition, delete any edges that are connected to
     * 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];
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.