Examples of GraphPane


Examples of diva.graph.GraphPane

     *  at that time.
     */
    protected void initializeInteraction() {
        super.initializeInteraction();

        GraphPane pane = getGraphPane();

        // Add a menu command to configure the ports.
        _portDialogAction = new PortDialogAction("Ports");
        _portDialogAction.setConfiguration(getConfiguration());

        _configureMenuFactory.addAction(_portDialogAction, "Customize");
        _configureUnitsAction = new ConfigureUnitsAction("Units Constraints");
        _configureMenuFactory.addAction(_configureUnitsAction, "Customize");
        _configureUnitsAction.setConfiguration(getConfiguration());

        // Add a menu command to list to the actor.
        _listenToActorFactory = new ListenToActorFactory();
        _menuFactory.addMenuItemFactory(_listenToActorFactory);
        _listenToActorFactory.setConfiguration(getConfiguration());

        // Create listeners that creates new relations.
        _relationCreator = new RelationCreator();
        _relationCreator.setMouseFilter(_shortcutFilter);

        pane.getBackgroundEventLayer().addInteractor(_relationCreator);

        // Note that shift-click is already bound to the dragSelection
        // interactor when adding things to a selection.
        // Create the interactor that drags new edges.
        _linkCreator = new LinkCreator();
View Full Code Here

Examples of diva.graph.GraphPane

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

Examples of diva.graph.GraphPane

        _controller = new EditIconGraphController();
        _controller.setConfiguration(getConfiguration());
        _controller.setFrame(this);

        ActorGraphModel graphModel = new ActorGraphModel(entity);
        return new GraphPane(_controller, graphModel);
    }
View Full Code Here

Examples of diva.graph.GraphPane

     *  at that time.  Regrettably, the canvas is not yet associated
     *  with the GraphPane, so you can't do any initialization that
     *  involves the canvas.
     */
    protected void initializeInteraction() {
        GraphPane pane = getGraphPane();
        _menuFactory = new SchematicContextMenuFactory(this);
        _menuCreator = new MenuCreator(_menuFactory);
        _menuCreator.setMouseFilter(new PopupMouseFilter());

        // Note that the menuCreator cannot be an interactor, because
        // it accepts all events.
        // NOTE: The above is a very strange comment, since
        // it is an interactor.  EAL 2/5/05.
        pane.getBackgroundEventLayer().addInteractor(_menuCreator);
        pane.getBackgroundEventLayer().setConsuming(false);

        Action[] actions = { _getDocumentationAction,
                new CustomizeDocumentationAction(),
                new RemoveCustomDocumentationAction() };
        _menuFactory.addMenuItemFactory(new MenuActionFactory(actions,
View Full Code Here

Examples of diva.graph.GraphPane

            // See whether there is a container under the point.
            Point2D originalPoint = SnapConstraint.constrainPoint(dtde
                    .getLocation());
            NamedObj container = _getObjectUnder(originalPoint);

            GraphPane pane = ((JGraph) getComponent()).getGraphPane();

            if ((container == null) || !_dropIntoEnabled) {
                // Find the default container for the dropped object
                GraphController controller = pane.getGraphController();
                GraphModel model = controller.getGraphModel();
                container = (NamedObj) model.getRoot();
            }

            // Find the location for the dropped objects.
            // Account for the scaling in the pane.
            Point2D transformedPoint = new Point2D.Double();
            pane.getTransformContext().getInverseTransform().transform(
                    originalPoint, transformedPoint);

            // Get an iterator over objects to drop.
            Iterator iterator = null;
View Full Code Here

Examples of diva.graph.GraphPane

     *  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

Examples of diva.graph.GraphPane

    public void stateChanged(ChangeEvent event) {
        if (event.getSource() == _tabbedPane) {
            _activeTabIndex = _tabbedPane.getSelectedIndex();
            if (_activeTabIndex < _graphPanes.size()) {
                _graphController.getSelectionModel().clearSelection();
                GraphPane graphPane = _graphPanes.get(_activeTabIndex);
                _graphController.setGraphPane(graphPane);
                _graphController.setGraphModel(graphPane.getGraphModel());
            }
            _showTab(_activeTabIndex);
        }
    }
View Full Code Here

Examples of diva.graph.GraphPane

    protected GraphPane _createGraphPane(NamedObj entity) {
        // The cast is safe because the constructor only accepts
        // CompositeEntity.
        AbstractBasicGraphModel graphModel = _createGraphModel(entity);
        GraphPane graphPane = new GraphPane(_graphController, graphModel);
        if (_graphPanes != null) {
            _graphPanes.add(graphPane);
        }
        return graphPane;
    }
View Full Code Here

Examples of diva.graph.GraphPane

                _frame.setJGraph(jgraph);
            }
            _graphs.add(jgraph);
        }

        GraphPane graphPane = _graphPanes.get(0);
        _graphController.setGraphPane(graphPane);
        _graphController.setGraphModel(graphPane.getGraphModel());

        return _tabbedPane;
    }
View Full Code Here

Examples of diva.graph.GraphPane

     @param refinement The case.
     *  @param newPane True to add the pane prior to the last pane.
     *  @return The pane.
     */
    private JGraph _addTabbedPane(CompositeActorMatcher matcher, boolean newPane) {
        GraphPane pane = _createGraphPane(matcher);
        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
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.