Package org.gephi.filters.api

Examples of org.gephi.filters.api.Range


        histogram.setConstraintHeight(30);
    }

    public void setup(final RangeFilter rangeFilter) {
        this.filter = rangeFilter;
        final Range range = (Range) rangeFilter.getRangeProperty().getValue();
        if (range == null) {
            //Do nothing
        } else {
            new Thread(new Runnable() {

                public void run() {
                    final JRangeSliderPanel rangeSlider = (JRangeSliderPanel) rangeSliderPanel;
                    values = range.getValues();

                    rangeSlider.addPropertyChangeListener(new PropertyChangeListener() {

                        public void propertyChange(PropertyChangeEvent evt) {
                            try {
                                if (evt.getPropertyName().equals(JRangeSliderPanel.LOWER_BOUND)) {
                                    Range oldRange = (Range) filter.getRangeProperty().getValue();
                                    final Range newRange = new Range((Number) rangeSlider.getRange().getLowerBound(), (Number) rangeSlider.getRange().getUpperBound(), oldRange.getMinimum(), oldRange.getMaximum(), oldRange.getValues());
                                    if (!oldRange.equals(newRange)) {
                                        filter.getRangeProperty().setValue(newRange);
                                        new Thread(new Runnable() {

                                            public void run() {
                                                setupHistogram(filter, newRange);
                                            }
                                        }).start();
                                    }
                                } else if (evt.getPropertyName().equals(JRangeSliderPanel.UPPER_BOUND)) {
                                    final Range oldRange = (Range) filter.getRangeProperty().getValue();
                                    final Range newRange = new Range((Number) rangeSlider.getRange().getLowerBound(), (Number) rangeSlider.getRange().getUpperBound(), oldRange.getMinimum(), oldRange.getMaximum(), oldRange.getValues());
                                    if (!oldRange.equals(newRange)) {
                                        filter.getRangeProperty().setValue(newRange);
                                        new Thread(new Runnable() {

                                            public void run() {
View Full Code Here


        public void dynamicModelChanged(DynamicModelEvent event) {
            switch (event.getEventType()) {
                case VISIBLE_INTERVAL:
                    TimeInterval interval = (TimeInterval) event.getData();
                    getProperties()[0].setValue(new Range(interval.getLow(), interval.getHigh()));
                    break;
            }
        }
View Full Code Here

            this.keepNull = keepNull;
        }

        public Range getRange() {
            if (visibleInterval != null) {
                return new Range(visibleInterval.getLow(), visibleInterval.getHigh());
            }
            return null;
        }
View Full Code Here

TOP

Related Classes of org.gephi.filters.api.Range

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.