本文整理汇总了Java中javafx.beans.property.DoublePropertyBase类的典型用法代码示例。如果您正苦于以下问题:Java DoublePropertyBase类的具体用法?Java DoublePropertyBase怎么用?Java DoublePropertyBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DoublePropertyBase类属于javafx.beans.property包,在下文中一共展示了DoublePropertyBase类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChartData
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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));
}
示例2: ChartItem
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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));
}
示例3: ChartData
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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));
}
示例4: ColorRegulator
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例5: ChartData
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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;
}
示例6: MinimalClockSkin
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例7: HeatControl
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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;
}
示例8: CircularProgressIndicator
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例9: ColorRegulator
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例10: SubmitButton
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例11: CircularProgressIndicator
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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();
}
示例12: SimpleGauge
import javafx.beans.property.DoublePropertyBase; //导入依赖的package包/类
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;
}