Examples of RankingFunction


Examples of org.eclipse.sisu.inject.RankingFunction

    /*
     * Workaround Sisu issue where DefaultRankingFunction doesn't take account potential @Priority values
     * when calculating the maximum potential rank contained in a given Injector - this heuristic is used
     * to decide the optimal time to merge in new results when iterating over a dynamic collection.
     */
    bind(RankingFunction.class).toInstance(new RankingFunction()
    {
      private final RankingFunction function = new DefaultRankingFunction(rank.incrementAndGet());

      public <T> int rank(Binding<T> binding) {
        return function.rank(binding);
View Full Code Here

Examples of org.gephi.appearance.api.RankingFunction

            }
        });
        splineButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                RankingFunction function = (RankingFunction) model.getSelectedFunction();
                if (splineEditor == null) {
                    splineEditor = new SplineEditor(NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.splineEditor.title"));
                }
                Interpolator interpolator = function.getRanking().getInterpolator();
                if (interpolator instanceof Interpolator.BezierInterpolator) {
                    Interpolator.BezierInterpolator bezierInterpolator = (Interpolator.BezierInterpolator) interpolator;
                    splineEditor.setControl1(bezierInterpolator.getControl1());
                    splineEditor.setControl2(bezierInterpolator.getControl2());
                } else {
                    splineEditor.setControl1(new Point2D.Float(0, 0));
                    splineEditor.setControl2(new Point2D.Float(1, 1));
                }
                splineEditor.setVisible(true);
                function.getRanking().setInterpolator(
                        new Interpolator.BezierInterpolator(
                                (float) splineEditor.getControl1().getX(), (float) splineEditor.getControl1().getY(),
                                (float) splineEditor.getControl2().getX(), (float) splineEditor.getControl2().getY()));
            }
        });
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.