Package y.module

Examples of y.module.LayoutModule


        //        try {
        // fToolbar.updateUndoRedoButtons(fCommandController.canUndo(),fCommandController.canRedo());
        // getGraphElementsVisibilityController().updateGraphElementsVisibility();
        final DependencyGraph graph = (DependencyGraph) fGraphView.getGraph2D();
        if (doLayout) {
            final LayoutModule layoutModule = graph.getLayoutModule();

            layoutModule.addModuleListener(new ModuleListener() {
                public void moduleEventHappened(ModuleEvent event) {
                    if (event.getEventType() == ModuleEvent.TYPE_MODULE_MAIN_RUN_FINISHED) {
                        if (postLayout != null) {
                            postLayout.updateSelection();
                        }
//                        fGraphView.fitContent();
                        fGraphView.updateView();
//                        graph.updateViews();
                    } else if (event.getEventType() == ModuleEvent.TYPE_MODULE_DISPOSED) {
                        layoutModule.removeModuleListener(this);
                    }
                }
            });

            if (preLayout != null) {
                preLayout.updateSelection();
            }
            sLogger.info("Do graph layout " + getSelectionString());
            layoutModule.start(graph);
        } else {
//            fGraphView.fitContent();
            fGraphView.updateView();
//            graph.updateViews();
        }
View Full Code Here


     * Adds the layout chooser.
     */
    private void addLayoutChooser() {
        add(new JLabel("Layout: "));
        Map<String, LayoutModule> layoutModules = fPanel.getLayoutModules();
        LayoutModule selectedModule = fPanel.getGraph().getLayoutModule();

        JComboBox comboBox = new JComboBox(layoutModules.keySet().toArray());
        for (Map.Entry<String, LayoutModule> entry : layoutModules.entrySet()) {
            Class<? extends LayoutModule> type = entry.getValue().getClass();
            if (selectedModule.getClass() == type) {
                comboBox.setSelectedItem(entry.getKey());
            }
        }
        comboBox.addActionListener(new LayoutChangerAction(fPanel));

View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void actionPerformed(ActionEvent e) {
        LayoutModule layoutModule = fGraphPanel.getLayoutModules().get(((JComboBox) e
                .getSource()).getSelectedItem());

        fGraphPanel.getGraph().updateLayoutModule(layoutModule);
    }
View Full Code Here

TOP

Related Classes of y.module.LayoutModule

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.