Package org.gephi.ranking.api

Examples of org.gephi.ranking.api.RankingUIModel


        }
        });*/
    }

    private void initEvents() {
        model = new RankingUIModel();

        final ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        pc.addWorkspaceListener(new WorkspaceListener() {

            public void initialize(Workspace workspace) {
                workspace.add(new RankingUIModel());
            }

            public void select(Workspace workspace) {
                //Enable
                enabled = true;
                RankingUIModel newModel = workspace.getLookup().lookup(RankingUIModel.class);
                if (newModel != null) {
                    model.loadModel(newModel);
                }
                refreshModel();
            }

            public void unselect(Workspace workspace) {
                RankingUIModel oldModel = workspace.getLookup().lookup(RankingUIModel.class);
                if (oldModel != null) {
                    workspace.remove(oldModel);
                }
                workspace.add(model.saveModel());
            }

            public void close(Workspace workspace) {
            }

            public void disable() {
                enabled = false;
                refreshModel();
            }
        });

        if (pc.getCurrentWorkspace() != null) {
            enabled = true;
            RankingUIModel newModel = pc.getCurrentWorkspace().getLookup().lookup(RankingUIModel.class);
            if (newModel != null) {
                model.loadModel(newModel);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.gephi.ranking.api.RankingUIModel

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.