Examples of GraphController


Examples of diva.graph.GraphController

                    // the graph model. Otherwise, this change request will
                    // trigger a redraw of the entire graph, which will result
                    // in another call to this very same method, which will
                    // result in creation of yet another figure before this
                    // method even returns!
                    GraphController controller = IconController.this
                            .getController();
                    GraphModel graphModel = controller.getGraphModel();
                    ChangeRequest request = new ChangeRequest(graphModel,
                            "Set the container of a new XMLIcon.") {
                        // NOTE: The KernelException should not be thrown,
                        // but if it is, it will be handled properly.
                        protected void _execute() throws KernelException {
View Full Code Here

Examples of diva.graph.GraphController

        _ruleMenu.addSeparator();

        LayoutAction layoutAction = new LayoutAction();
        GUIUtilities.addMenuItem(_ruleMenu, layoutAction);

        GraphController controller = (GraphController) _getGraphController();
        if (getFrameController().hasTabs()) {
            if (controller instanceof ActorEditorGraphController) {
                _ruleMenu.addSeparator();
                Action newRelationAction =
                    ((ActorEditorGraphController) controller)
View Full Code Here

Examples of diva.graph.GraphController

            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.
View Full Code Here

Examples of diva.graph.GraphController

        getContentPane().add(_divaPanel, BorderLayout.SOUTH);

        _graph = _constructGraph();

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

        final GraphPane gp = new GraphPane(gc, _graph);
        _jgraph = new JGraph(gp);
        _jgraph.repaint();
View Full Code Here

Examples of diva.graph.GraphController

     */
    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);
View Full Code Here

Examples of diva.graph.GraphController

            // Action activated using an ActionInteractor.
            LayerEvent event = (LayerEvent) source;
            CanvasLayer layer = event.getLayerSource();
            GraphPane pane = (GraphPane) layer.getCanvasPane();
            GraphController controller = pane.getGraphController();
            GraphModel model = controller.getGraphModel();

            _figure = event.getFigureSource();

            // Set the target.
            if (_figure == null) {
                _target = (NamedObj) model.getRoot();
            } else {
                Object object = _figure.getUserObject();
                _target = (NamedObj) model.getSemanticObject(object);
            }

            // Set the position.
            _x = event.getX();
            _y = event.getY();

            // Set the parent.
            CanvasPane canvasPane = layer.getCanvasPane();
            parent = canvasPane.getCanvas();
        } else if (source instanceof JMenuItem) {
            // Action activated using a context menu or submenu.
            JMenuItem item = (JMenuItem) source;
            // Find the original context menu.
            Component contextMenu = item.getParent();
            if (!(contextMenu instanceof JContextMenu)) {
                // Probably a submenu.
                // FIXME: This only supports one level of submenus.
                if (contextMenu instanceof JPopupMenu) {
                    contextMenu = ((JPopupMenu) contextMenu).getInvoker();
                }
                if (contextMenu instanceof JMenu) {
                    contextMenu = contextMenu.getParent();
                }
            }
            if (contextMenu instanceof JContextMenu) {
                _sourceType = CONTEXTMENU_TYPE;
                JContextMenu menu = (JContextMenu) contextMenu;
                parent = menu.getInvoker();
                _target = (NamedObj) menu.getTarget();
                _x = item.getX();
                _y = item.getY();
            } else {
                // Not implicit location.. should there be?
                _sourceType = MENUBAR_TYPE;
            }
            /*
             } else if (source instanceof JMenuItem) {
             // Action activated using a context menu.
             JMenuItem item = (JMenuItem) source;

             if (item.getParent() instanceof JContextMenu) {
             _sourceType = CONTEXTMENU_TYPE;

             JContextMenu menu = (JContextMenu) item.getParent();
             parent = menu.getInvoker();
             _target = (NamedObj) menu.getTarget();
             _x = item.getX();
             _y = item.getY();
             } else {
             // Not implicit location.. should there be?
             _sourceType = MENUBAR_TYPE;
             }
             */
        } else if (source instanceof JButton) {
            // presumably we are in a toolbar...
            _sourceType = TOOLBAR_TYPE;
            _target = null;
            parent = ((Component) source).getParent();
        } else if (source instanceof JGraph) {
            // This is an absurdly convoluted way to get the info we need.
            // But there seems to be no other way.
            // This is an architectural flaw in vergil.
            GraphPane pane = ((JGraph) source).getGraphPane();
            FigureLayer layer = pane.getForegroundLayer();
            CanvasComponent currentFigure = layer.getCurrentFigure();
            GraphController controller = pane.getGraphController();
            GraphModel model = controller.getGraphModel();

            if (currentFigure != null) {
                _target = null;

                while ((_target == null) && (currentFigure != null)) {
View Full Code Here

Examples of diva.graph.GraphController

            ComponentDialog dialog = new ComponentDialog(ActorGraphFrame.this,
                    "Instantiate Attribute", query);

            if (dialog.buttonPressed().equals("OK")) {
                // Get the associated Ptolemy model.
                GraphController controller = getJGraph().getGraphPane()
                        .getGraphController();
                AbstractBasicGraphModel model = (AbstractBasicGraphModel) controller
                        .getGraphModel();
                NamedObj context = model.getPtolemyModel();

                _lastAttributeClassName = query.getStringValue("class");
View Full Code Here

Examples of diva.graph.GraphController

            ComponentDialog dialog = new ComponentDialog(ActorGraphFrame.this,
                    "Instantiate Entity", query);

            if (dialog.buttonPressed().equals("OK")) {
                // Get the associated Ptolemy model.
                GraphController controller = getJGraph().getGraphPane()
                        .getGraphController();
                AbstractBasicGraphModel model = (AbstractBasicGraphModel) controller
                        .getGraphModel();
                NamedObj context = model.getPtolemyModel();

                _lastEntityClassName = query.getStringValue("class");
                _lastLocation = query.getStringValue("location");
View Full Code Here

Examples of org.enhydra.jawe.components.graph.GraphController

                XPDLHandler xpdlHandler = jaweManager.getXPDLHandler();
                xpdlHandler.setValidation(false);
                jaweController.openPackageFromStream(xpdl.getBytes("UTF-8"));
                org.enhydra.shark.xpdl.elements.Package pkg = xpdlHandler.getPackageById(packageId);
                org.enhydra.shark.xpdl.elements.WorkflowProcess wp = pkg.getWorkflowProcess(processDefId);
                GraphController gc = (GraphController) jaweManager.getComponentManager().getComponent("GraphComponent");
                gc.selectGraphForElement(wp);
                Graph graph = gc.getGraph(wp);

                // highlight running activities
                if (runningActivityIds != null && runningActivityIds.length > 0) {
                    graph.clearSelection();
                    try {
View Full Code Here

Examples of org.gephi.graph.api.GraphController

        //Append container to graph structure
        ImportController importController = Lookup.getDefault().lookup(ImportController.class);
        importController.process(container, new DefaultProcessor(), workspace);

        //Set labels
        GraphController gc = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = gc.getModel(workspace);
        for (Node n : graphModel.getGraph().getNodes()) {
            n.getNodeData().setLabel("Node " + n.getNodeData().getId());
        }

        PreviewModel model = Lookup.getDefault().lookup(PreviewController.class).getModel();
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.