Java 类javafx.beans.property.DoublePropertyBase 实例源码

项目:SunburstChart    文件:ChartData.java   
public ChartData(final String NAME, final double VALUE, final Color FILL_COLOR, final Color STROKE_COLOR, final Color TEXT_COLOR, final Instant TIMESTAMP, final boolean ANIMATED, final long ANIMATION_DURATION) {
    name              = NAME;
    value             = VALUE;
    oldValue          = 0;
    fillColor         = FILL_COLOR;
    strokeColor       = STROKE_COLOR;
    textColor         = TEXT_COLOR;
    timestamp         = TIMESTAMP;
    currentValue      = new DoublePropertyBase(value) {
        @Override protected void invalidated() {
            oldValue = value;
            value = get();
            fireChartDataEvent(UPDATE_EVENT);
        }
        @Override public Object getBean() { return ChartData.this; }
        @Override public String getName() { return "currentValue"; }
    };
    timeline          = new Timeline();
    animated          = ANIMATED;
    animationDuration = ANIMATION_DURATION;

    timeline.setOnFinished(e -> fireChartDataEvent(FINISHED_EVENT));
}
项目:charts    文件:ChartItem.java   
public ChartItem(final String NAME, final double VALUE, final Color FILL, final Color STROKE, final Color TEXT_COLOR, final Instant TIMESTAMP, final boolean ANIMATED, final long ANIMATION_DURATION) {
    _name             = NAME;
    _value            = VALUE;
    oldValue          = 0;
    _fill             = FILL;
    _stroke           = STROKE;
    _textColor        = TEXT_COLOR;
    _timestamp        = TIMESTAMP;
    _symbol           = Symbol.NONE;
    _animated         = ANIMATED;
    currentValue      = new DoublePropertyBase(_value) {
        @Override protected void invalidated() {
            oldValue = getValue();
            setValue(get());
            fireItemEvent(UPDATE_EVENT);
        }
        @Override public Object getBean() { return ChartItem.this; }
        @Override public String getName() { return "currentValue"; }
    };
    timeline          = new Timeline();
    animationDuration = ANIMATION_DURATION;

    timeline.setOnFinished(e -> fireItemEvent(FINISHED_EVENT));
}
项目:tilesfx    文件:ChartData.java   
public ChartData(final String NAME, final double VALUE, final Color FILL_COLOR, final Color STROKE_COLOR, final Color TEXT_COLOR, final Instant TIMESTAMP, final boolean ANIMATED, final long ANIMATION_DURATION) {
    name              = NAME;
    value             = VALUE;
    oldValue          = 0;
    fillColor         = FILL_COLOR;
    strokeColor       = STROKE_COLOR;
    textColor         = TEXT_COLOR;
    timestamp         = TIMESTAMP;
    currentValue      = new DoublePropertyBase(value) {
        @Override protected void invalidated() {
            oldValue = value;
            value    = get();
            fireChartDataEvent(UPDATE_EVENT);
        }
        @Override public Object getBean() { return ChartData.this; }
        @Override public String getName() { return "currentValue"; }
    };
    timeline          = new Timeline();
    animated          = ANIMATED;
    animationDuration = ANIMATION_DURATION;

    timeline.setOnFinished(e -> fireChartDataEvent(FINISHED_EVENT));
}
项目:MoodFX    文件:ColorRegulator.java   
public ColorRegulator() {
    scaleFactor   = 1d;
    targetValue   = new DoublePropertyBase(0) {
        @Override public void set(final double VALUE) {
            super.set(clamp(MIN_VALUE, MAX_VALUE, VALUE));
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "targetValue"; }
    };
    targetColor   = new ObjectPropertyBase<Color>(Color.YELLOW) {
        @Override public void set(final Color COLOR) {
            super.set(null == COLOR ? Color.BLACK : COLOR);
            currentColorCircle.setFill(COLOR);
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "targetColor"; }
    };
    selectedColor = Color.YELLOW;
    angleStep     = ANGLE_RANGE / (MAX_VALUE - MIN_VALUE);
    automatic     = false;
    init();
    initGraphics();
    registerListeners();
}
项目:radialchart    文件:ChartData.java   
public ChartData(final String NAME, final double VALUE, final Color COLOR) {
    name         = NAME;
    value        = VALUE;
    color        = COLOR;
    currentValue = new DoublePropertyBase(value) {
        @Override protected void invalidated() {
            value = get();
            fireChartDataEvent(UPDATE_EVENT);
        }
        @Override public Object getBean() { return ChartData.this; }
        @Override public String getName() { return "currentValue"; }
    };
    timeline     = new Timeline();
    animated     = true;
}
项目:Medusa    文件:MinimalClockSkin.java   
public MinimalClockSkin(Clock clock) {
    super(clock);

    minuteAngle         = new DoublePropertyBase(-1) {
        @Override public Object getBean() { return clock; }
        @Override public String getName() { return "minuteAngle"; }
    };
    timeline            = new Timeline();
    minuteAngleListener = o -> moveMinute(minuteAngle.get());

    initGraphics();
    registerListeners();
}
项目:FXImgurUploader    文件:HeatControl.java   
public HeatControl() {
    getStyleClass().add("heat-control");
    value             = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            set(clamp(getMinValue(), getMaxValue(), get()));
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "value"; }
    };
    minValue          = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            if (getValue() < get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "minValue"; }
    };
    maxValue          = new DoublePropertyBase(40) {
        @Override protected void invalidated() {
            if (getValue() > get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "maxValue"; }
    };
    oldValue          = 0;
    target            = new DoublePropertyBase(20) {
        @Override protected void invalidated() {
            set(clamp(getMinValue(), getMaxValue(), get()));
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "target"; }
    };
    _minMeasuredValue = maxValue.getValue();
    _maxMeasuredValue = 0;
    _decimals         = 0;
    _infoText         = "";
    targetEnabled     = new SimpleBooleanProperty(this, "targetEnabled", false);
    _startAngle       = 325;
    _angleRange       = 290;                
}
项目:Enzo    文件:HeatControl.java   
public HeatControl() {
    getStyleClass().add("heat-control");
    value             = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            set(clamp(getMinValue(), getMaxValue(), get()));
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "value"; }
    };
    minValue          = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            if (getValue() < get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "minValue"; }
    };
    maxValue          = new DoublePropertyBase(40) {
        @Override protected void invalidated() {
            if (getValue() > get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "maxValue"; }
    };
    oldValue          = 0;
    target            = new DoublePropertyBase(20) {
        @Override protected void invalidated() {
            set(clamp(getMinValue(), getMaxValue(), get()));
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "target"; }
    };
    _minMeasuredValue = maxValue.getValue();
    _maxMeasuredValue = 0;
    _decimals         = 0;
    _infoText         = "";
    targetEnabled     = new SimpleBooleanProperty(this, "targetEnabled", false);
    _startAngle       = 325;
    _angleRange       = 290;                
}
项目:CircularProgressIndicator    文件:CircularProgressIndicator.java   
public CircularProgressIndicator() {
    getStylesheets().add(CircularProgressIndicator.class.getResource("circular-progress-indicator.css").toExternalForm());
    getStyleClass().add("circular-progress");
    progress      = new DoublePropertyBase(0) {
        @Override public void invalidated() {
            if (get() < 0) {
                startIndeterminate();
            } else {
                stopIndeterminate();
                set(clamp(0d,1d, get()));
                redraw();
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this;}
        @Override public String getName() { return "progress"; }
    };
    indeterminate = new BooleanPropertyBase(false) {
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "indeterminate"; }
    };
    roundLineCap  = new BooleanPropertyBase(false) {
        @Override public void invalidated() {
            if (get()) {
                circle.setStrokeLineCap(StrokeLineCap.ROUND);
                arc.setStrokeLineCap(StrokeLineCap.ROUND);
            } else {
                circle.setStrokeLineCap(StrokeLineCap.SQUARE);
                arc.setStrokeLineCap(StrokeLineCap.SQUARE);
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "roundLineCap"; }
    };
    isRunning     = false;
    timeline      = new Timeline();
    listener      = observable -> {
        circle.setStrokeDashOffset(dashOffset.get());
        circle.getStrokeDashArray().setAll(dashArray_0.getValue(), 200d);
    };
    init();
    initGraphics();
    registerListeners();
}
项目:regulators    文件:ColorRegulator.java   
public ColorRegulator() {
    scaleFactor    = 1.0;
    baseColor      = Color.YELLOW;
    targetValue    = new DoublePropertyBase(0) {
        @Override protected void invalidated() { setOn(Double.compare(get(), 0) != 0); }
        @Override public void set(final double VALUE) {
            super.set(clamp(MIN_VALUE, MAX_VALUE, VALUE));
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "targetValue"; }
    };
    targetColor    = new ObjectPropertyBase<Color>(baseColor) {
        @Override protected void invalidated() {
            super.set(null == get() ? Color.BLACK : get());
            currentColorCircle.setFill(get());
            indicatorRotate.setAngle(((gradientLookup.getValueFrom(baseColor) * 100.0) - MIN_VALUE) * angleStep - ANGLE_RANGE * 0.5);
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "targetColor"; }
    };
    textColor      = new ObjectPropertyBase<Color>(Color.WHITE) {
        @Override protected void invalidated() {
            super.set(null == get() ? Color.WHITE:  get());
            redraw();
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "textColor"; }
    };
    color          = new ObjectPropertyBase<Color>(DEFAULT_COLOR) {
        @Override protected void invalidated() {
            super.set(null == get() ? DEFAULT_COLOR : get());
            redraw();
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "color"; }
    };
    indicatorColor = new ObjectPropertyBase<Color>(Color.WHITE) {
        @Override protected void invalidated() { indicatorGlow.setColor(get()); }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "indicatorColor"; }
    };
    selected       = new BooleanPropertyBase(false) {
        @Override protected void invalidated() {
            if (get()) {
                indicator.setFill(getIndicatorColor());
                indicator.setStroke(getIndicatorColor().darker().darker());
                indicator.setEffect(indicatorGlow);
            } else {
                indicator.setFill(getColor().darker());
                indicator.setStroke(getColor().darker().darker());
                indicator.setEffect(null);
            }
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "selected"; }
    };
    on             = new BooleanPropertyBase(false) {
        @Override protected void invalidated() { currentColorCircle.setVisible(get()); }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "on"; }
    };
    brightness     = new DoublePropertyBase(1.0) {
        @Override protected void invalidated() {
            set(clamp(0.0, 1.0, get()));
            targetColor.set(baseColor.deriveColor(0, 1, get(), 1));
        }
        @Override public Object getBean() { return ColorRegulator.this; }
        @Override public String getName() { return "brightness"; }
    };
    angleStep      = ANGLE_RANGE / (MAX_VALUE - MIN_VALUE);

    init();
    initGraphics();
    registerListeners();
}
项目:submitbutton    文件:SubmitButton.java   
public SubmitButton(final String TEXT) {
    keepAspect       = true;
    color            = new ObjectPropertyBase<Color>(Color.web("#00ca94")) {
        @Override protected void invalidated() {
            super.invalidated();
            if (null == get()) set(Color.web("00ca94"));
            frameColor.set(get());
            textColor.set(get());
            redraw();
        }
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "color"; }
    };
    frameColor       = new ObjectPropertyBase<Color>(Color.web("#00ca94")) {
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "frameColor"; }
    };
    buttonColor      = new ObjectPropertyBase<Color>(Color.WHITE) {
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "buttonColor"; }
    };
    textColor        = new ObjectPropertyBase<Color>(Color.web("#00ca94")) {
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "textColor"; }
    };
    progressBarColor = new ObjectPropertyBase<Color>(Color.TRANSPARENT) {
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "progressBarColor"; }
    };
    iconColor        = new ObjectPropertyBase<Color>(Color.WHITE) {
        @Override protected void invalidated() {
            super.invalidated();
            if (null == get()) set(Color.WHITE);
        }
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "iconColor"; }
    };
    progress         = new DoublePropertyBase(0) {
        @Override protected void invalidated() {
            set(clamp(0, 1, get()));
            progressBar.setLength(-360.0 * get());
            if (Double.compare(get(), 1.0) >= 0) animateFromProgressSuccess();
        }
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "progress"; }
    };
    status           = new ObjectPropertyBase<Status>(Status.NONE) {
        @Override protected void invalidated() {
            switch(get()) {
                case IN_PROGRESS: break;
                case SUCCESS    : icon.setIconCode(FontAwesome.CHECK); break;
                case FAIL       : icon.setIconCode(FontAwesome.CLOSE); formerColor = getColor(); color.set(Color.CRIMSON); animateFromProgressFail(); break;
                case FINISHED   : progress.set(0); break;
                case NONE       :
                default         : break;
            }
        }
        @Override public Object getBean() { return SubmitButton.this; }
        @Override public String getName() { return "status"; }
    };
    formerColor      = getColor();
    backgroundPaint  = Color.TRANSPARENT;
    borderPaint      = Color.TRANSPARENT;
    borderWidth      = 0d;
    timeline         = new Timeline();
    init();
    initGraphics(TEXT);
    registerListeners();
}
项目:mars-sim    文件:CircularProgressIndicator.java   
public CircularProgressIndicator() {
    getStylesheets().add(CircularProgressIndicator.class.getResource("/fxui/css/circular-progress-indicator.css").toExternalForm());
    getStyleClass().add("circular-progress");
    progress      = new DoublePropertyBase(0) {
        @Override public void invalidated() {
            if (get() < 0) {
                startIndeterminate();
            } else {
                stopIndeterminate();
                set(clamp(0d,1d, get()));
                redraw();
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this;}
        @Override public String getName() { return "progress"; }
    };
    indeterminate = new BooleanPropertyBase(false) {
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "indeterminate"; }
    };
    roundLineCap  = new BooleanPropertyBase(false) {
        @Override public void invalidated() {
            if (get()) {
                circle.setStrokeLineCap(StrokeLineCap.ROUND);
                arc.setStrokeLineCap(StrokeLineCap.ROUND);
            } else {
                circle.setStrokeLineCap(StrokeLineCap.SQUARE);
                arc.setStrokeLineCap(StrokeLineCap.SQUARE);
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "roundLineCap"; }
    };
    isRunning     = false;
    timeline      = new Timeline();
    listener      = observable -> {
        circle.setStrokeDashOffset(dashOffset.get());
        circle.getStrokeDashArray().setAll(dashArray_0.getValue(), 200d);
    };
    init();
    initGraphics();
    registerListeners();
}
项目:mars-sim    文件:CircularProgressIndicator.java   
public CircularProgressIndicator() {
    getStylesheets().add(CircularProgressIndicator.class.getResource("/fxui/css/circular-progress-indicator.css").toExternalForm());
    getStyleClass().add("circular-progress");
    progress      = new DoublePropertyBase(0) {
        @Override public void invalidated() {
            if (get() < 0) {
                startIndeterminate();
            } else {
                stopIndeterminate();
                set(clamp(0d,1d, get()));
                redraw();
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this;}
        @Override public String getName() { return "progress"; }
    };
    indeterminate = new BooleanPropertyBase(false) {
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "indeterminate"; }
    };
    roundLineCap  = new BooleanPropertyBase(false) {
        @Override public void invalidated() {
            if (get()) {
                circle.setStrokeLineCap(StrokeLineCap.ROUND);
                arc.setStrokeLineCap(StrokeLineCap.ROUND);
            } else {
                circle.setStrokeLineCap(StrokeLineCap.SQUARE);
                arc.setStrokeLineCap(StrokeLineCap.SQUARE);
            }
        }
        @Override public Object getBean() { return CircularProgressIndicator.this; }
        @Override public String getName() { return "roundLineCap"; }
    };
    isRunning     = false;
    timeline      = new Timeline();
    listener      = observable -> {
        circle.setStrokeDashOffset(dashOffset.get());
        circle.getStrokeDashArray().setAll(dashArray_0.getValue(), 200d);
    };
    init();
    initGraphics();
    registerListeners();
}
项目:FXImgurUploader    文件:SimpleGauge.java   
public SimpleGauge() {
    getStyleClass().add("simple-gauge");        
    value                 = new DoublePropertyBase(0) {
        @Override protected void invalidated() {                
            set(clamp(getMinValue(), getMaxValue(), get()));    
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "value"; }
    };                
    minValue              = new DoublePropertyBase(0) {
        @Override protected void invalidated() {                 
            if (getValue() < get()) setValue(get());                
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "minValue"; }
    };
    maxValue              = new DoublePropertyBase(100) {
        @Override protected void invalidated() {                 
            if (getValue() > get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "maxValue"; }
    };
    oldValue              = 0;
    _decimals             = 0;
    _unit                 = "";
    _animated             = true;
    _startAngle           = 315;
    _angleRange           = 270;
    _clockwise            = true;
    _autoScale            = false;
    _needleColor          = Color.web("#5a615f");
    _sectionTextVisible   = false;
    _sectionIconVisible   = false;
    _measuredRangeVisible = false;
    sections              = FXCollections.observableArrayList();
    _majorTickSpace       = 10;
    _minorTickSpace       = 1;
    _title                = "";
    animationDuration     = 3000;        
}
项目:Enzo    文件:SimpleGauge.java   
public SimpleGauge() {
    getStyleClass().add("simple-gauge");        
    value                 = new DoublePropertyBase(0) {
        @Override protected void invalidated() {                
            set(clamp(getMinValue(), getMaxValue(), get()));    
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "value"; }
    };                
    minValue              = new DoublePropertyBase(0) {
        @Override protected void invalidated() {                 
            if (getValue() < get()) setValue(get());                
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "minValue"; }
    };
    maxValue              = new DoublePropertyBase(100) {
        @Override protected void invalidated() {                 
            if (getValue() > get()) setValue(get());
        }
        @Override public Object getBean() { return this; }
        @Override public String getName() { return "maxValue"; }
    };
    oldValue              = 0;
    _decimals             = 0;
    _unit                 = "";
    _animated             = true;
    _startAngle           = 315;
    _angleRange           = 270;
    _clockwise            = true;
    _autoScale            = false;
    _needleColor          = Color.web("#5a615f");
    _sectionTextVisible   = false;
    _sectionIconVisible   = false;
    _measuredRangeVisible = false;
    sections              = FXCollections.observableArrayList();
    _majorTickSpace       = 10;
    _minorTickSpace       = 1;
    _title                = "";
    animationDuration     = 3000;        
}