Package org.gephi.ranking.api

Examples of org.gephi.ranking.api.RankingController


    private RankingTopComponent() {
        setName(NbBundle.getMessage(RankingTopComponent.class, "CTL_RankingTopComponent"));
//        setToolTipText(NbBundle.getMessage(RankingTopComponent.class, "HINT_RankingTopComponent"));
        setIcon(ImageUtilities.loadImage(ICON_PATH));

        RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
        rankingModel = rankingController.getRankingModel();

        initEvents();
        initComponents();
        initSouth();
        if (UIUtils.isAquaLookAndFeel()) {
View Full Code Here


    private JXTable table;
    private JPopupMenu popupMenu;

    public ResultListPanel() {
        //Lookup listener
        RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
        Lookup eventBus = rankingController.getEventBus();
        result = eventBus.lookupResult(RankingResult.class);
        result.addLookupListener(this);

        initTable();
        initTablePopup();
View Full Code Here

        applyButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                Transformer transformer = getSelectedTransformer();
                if (transformer != null) {
                    RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
                    if (interpolator != null) {
                        transformer.setInterpolator(new org.gephi.ranking.api.Interpolator() {

                            public float interpolate(float x) {
                                return interpolator.interpolate(x);
                            }
                        });
                    }
                    rankingController.transform(transformer);
                }
            }
        });

        splineButton.addActionListener(new ActionListener() {
View Full Code Here

    public Class getTransformerClass() {
        return ObjectColorTransformer.class;
    }

    public Transformer buildTransformer(Ranking ranking) {
        RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        return rc.getObjectColorTransformer(ranking);
    }
View Full Code Here

    public Class getTransformerClass() {
        return LabelSizeTransformer.class;
    }

    public Transformer buildTransformer(Ranking ranking) {
        RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        return rc.getLabelSizeTransformer(ranking);
    }
View Full Code Here

    public Class getTransformerClass() {
        return ObjectSizeTransformer.class;
    }

    public Transformer buildTransformer(Ranking ranking) {
        RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        return rc.getObjectSizeTransformer(ranking);
    }
View Full Code Here

    public Class getTransformerClass() {
        return LabelColorTransformer.class;
    }

    public Transformer buildTransformer(Ranking ranking) {
        RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        return rc.getLabelColorTransformer(ranking);
    }
View Full Code Here

    private RankingUIModel model;
    private ChangeListener modelChangeListener;

    public RankingUIController() {
        final ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        final RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        pc.addWorkspaceListener(new WorkspaceListener() {
            @Override
            public void initialize(Workspace workspace) {
            }

            @Override
            public void select(Workspace workspace) {
                model = workspace.getLookup().lookup(RankingUIModel.class);
                if (model == null) {
                    RankingModel rankingModel = rc.getModel(workspace);
                    model = new RankingUIModel(RankingUIController.this, rankingModel);
                    workspace.add(model);
                }
                if (modelChangeListener != null) {
                    modelChangeListener.stateChanged(new ChangeEvent(model));
                }
            }

            @Override
            public void unselect(Workspace workspace) {
                if (model != null) {
                }
            }

            @Override
            public void close(Workspace workspace) {
            }

            @Override
            public void disable() {
                model = null;
                if (modelChangeListener != null) {
                    modelChangeListener.stateChanged(null);
                }
            }
        });

        if (pc.getCurrentWorkspace() != null) {
            model = pc.getCurrentWorkspace().getLookup().lookup(RankingUIModel.class);
            if (model == null) {
                RankingModel rankingModel = rc.getModel(pc.getCurrentWorkspace());
                model = new RankingUIModel(this, rankingModel);
                pc.getCurrentWorkspace().add(model);
            }
        }
    }
View Full Code Here

    public RankingUIModel getModel() {
        return model;
    }

    public RankingUIModel getModel(Workspace workspace) {
        final RankingController rc = Lookup.getDefault().lookup(RankingController.class);
        RankingUIModel m = workspace.getLookup().lookup(RankingUIModel.class);
        if (m == null) {
            RankingModel rankingModel = rc.getModel(workspace);
            m = new RankingUIModel(RankingUIController.this, rankingModel);
            workspace.add(m);
        }
        return m;
    }
View Full Code Here

            @Override
            public void actionPerformed(ActionEvent e) {
                Transformer transformer = model.getCurrentTransformer();
                if (transformer != null) {
                    RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
                    if (interpolator != null) {
                        rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {

                            @Override
                            public float interpolate(float x) {
                                return interpolator.interpolate(x);
                            }
                        });
                    }
                    rankingController.transform(model.getCurrentRanking(), transformer);
                }
            }
        });

        splineButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (splineEditor == null) {
                    splineEditor = new SplineEditor(NbBundle.getMessage(RankingChooser.class, "RankingChooser.splineEditor.title"));
                }
                splineEditor.setVisible(true);
                interpolator = splineEditor.getCurrentInterpolator();
                RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
                rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {

                    @Override
                    public float interpolate(float x) {
                        return interpolator.interpolate(x);
                    }
                });
            }
        });
        autoApplyButton.setVisible(false);
        enableAutoButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                if (enableAutoButton.isSelected()) {
                    autoApplyButton.setVisible(true);
                    setAutoApplySelected(false);
                    autoApplyButton.setSelected(false);
                    applyButton.setVisible(false);
                } else {
                    autoApplyButton.setVisible(false);
                    applyButton.setVisible(true);
                    model.setAutoTransformer(model.getCurrentTransformer(), false);
                }

            }
        });
        autoApplyButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                if (interpolator != null) {
                    RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
                    rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {

                        @Override
                        public float interpolate(float x) {
                            return interpolator.interpolate(x);
                        }
View Full Code Here

TOP

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

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.