@Override public void start(Stage stage) throws Exception {
preloaderStage = stage;
preloaderStage.setScene(preloaderScene);
preloaderStage.show();
if (DEMO_MODE) {
final DoubleProperty prog = new SimpleDoubleProperty(0){
@Override protected void invalidated() {
handleProgressNotification(new ProgressNotification(get()));
}
};
Timeline t = new Timeline();
t.getKeyFrames().add(new KeyFrame(Duration.seconds(20), new KeyValue(prog, 1)));
t.play();
}
}
java类javafx.beans.property.DoubleProperty的实例源码
DataAppPreloader.java 文件源码
项目:marathonv5
阅读 38
收藏 0
点赞 0
评论 0
PackageOps.java 文件源码
项目:aem-epic-tool
阅读 23
收藏 0
点赞 0
评论 0
public static PackageContents getPackageContents(PackageType pkg, AuthHandler handler, DoubleProperty progress) throws IOException {
int retries = 3;
if (app.getPackageContents(pkg) == null && retries > 0) {
File targetFile = getPackageFile(pkg, handler, progress);
Logger.getLogger(AppController.class.getName()).log(Level.INFO, "Package downloaded to {0}", targetFile.getPath());
try {
PackageContents contents = new PackageContents(targetFile, pkg);
app.putPackageContents(pkg, contents);
return contents;
} catch (IOException ex) {
Logger.getLogger(PackageOps.class.getName()).log(Level.SEVERE, null, ex);
if (retries-- <= 0) {
throw ex;
} else {
app.clearPackageContents(pkg);
}
}
}
return app.getPackageContents(pkg);
}
Library.java 文件源码
项目:VortexCompiler
阅读 32
收藏 0
点赞 0
评论 0
public void filesRead(DoubleProperty progress, double value) {
double progressVal = value / (strFiles.size() + 1);
clear();
//Parser
for (StringFile strFile : strFiles) {
strFile.clearReadyData();
Parser.parseTypedefs(strFile, strFile.getToken());
typedefs.addAll(strFile.typedefs);
nameSpaces.add(strFile.workspace.getNameSpace());
progressAdd(progress, progressVal);
}
dataBaseInsert();
progressAdd(progress, progressVal);
}
Library.java 文件源码
项目:VortexCompiler
阅读 29
收藏 0
点赞 0
评论 0
public void filesPreload(DoubleProperty progress, double value) {
double progressVal = value / (strFiles.size() + typedefs.size() + 1);
//Workspace Load ( remove usings errados )
for (StringFile strFile : strFiles) {
strFile.workspace.load();
if (progress != null) progress.add(progressVal);
}
//Preload
for (Typedef typedef : typedefs) {
typedef.preload();
progressAdd(progress, progressVal);
}
progressAdd(progress, progressVal);
}
MultiAxisLineChart.java 文件源码
项目:MultiAxisCharts
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected void seriesAdded(Series<X, Y> series, int seriesIndex) {
// create new path for series
Path seriesLine = new Path();
seriesLine.setStrokeLineJoin(StrokeLineJoin.BEVEL);
series.setNode(seriesLine);
// create series Y multiplier
DoubleProperty seriesYAnimMultiplier = new SimpleDoubleProperty(this, "seriesYMultiplier");
seriesYMultiplierMap.put(series, seriesYAnimMultiplier);
// handle any data already in series
if (shouldAnimate()) {
seriesLine.setOpacity(0);
seriesYAnimMultiplier.setValue(0d);
} else {
seriesYAnimMultiplier.setValue(1d);
}
getPlotChildren().add(seriesLine);
List<KeyFrame> keyFrames = new ArrayList<KeyFrame>();
if (shouldAnimate()) {
// animate in new series
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(seriesLine.opacityProperty(), 0),
new KeyValue(seriesYAnimMultiplier, 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(seriesLine.opacityProperty(), 1)));
keyFrames.add(new KeyFrame(Duration.millis(500), new KeyValue(seriesYAnimMultiplier, 1)));
}
for (int j = 0; j < series.getData().size(); j++) {
Data<X, Y> item = series.getData().get(j);
final Node symbol = createSymbol(series, seriesIndex, item, j);
if (symbol != null) {
if (shouldAnimate())
symbol.setOpacity(0);
getPlotChildren().add(symbol);
if (shouldAnimate()) {
// fade in new symbol
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(symbol.opacityProperty(), 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(symbol.opacityProperty(), 1)));
}
}
}
if (shouldAnimate())
animate(keyFrames.toArray(new KeyFrame[keyFrames.size()]));
}
SimplePropertySheet.java 文件源码
项目:marathonv5
阅读 31
收藏 0
点赞 0
评论 0
public static Object get(ObservableValue valueModel) {
if (valueModel instanceof DoubleProperty) {
return ((DoubleProperty)valueModel).get();
} else if (valueModel instanceof ObjectProperty) {
return ((ObjectProperty)valueModel).get();
}
return null;
}
SimplePropertySheet.java 文件源码
项目:marathonv5
阅读 26
收藏 0
点赞 0
评论 0
public static void set(ObservableValue valueModel, Object value) {
if (valueModel instanceof DoubleProperty) {
((DoubleProperty)valueModel).set((Double)value);
} else if (valueModel instanceof ObjectProperty) {
((ObjectProperty)valueModel).set(value);
}
}
PlayerHandler.java 文件源码
项目:fx-animation-editor
阅读 52
收藏 0
点赞 0
评论 0
private KeyValue createKeyValue(NodeModel nodeModel, KeyValueModel keyValueModel) {
Optional<DoubleProperty> doubleProperty = ModelFunctions.getDoubleProperty(nodeModel.getNode(), keyValueModel.getField());
if (doubleProperty.isPresent()) {
return new KeyValue(doubleProperty.get(), (double) keyValueModel.getValue(), keyValueModel.getInterpolator().toFxInterpolator());
}
Optional<ObjectProperty<Paint>> paintProperty = ModelFunctions.getPaintProperty(nodeModel.getNode(), keyValueModel.getField());
if (paintProperty.isPresent()) {
return new KeyValue(paintProperty.get(), (Paint) keyValueModel.getValue(), keyValueModel.getInterpolator().toFxInterpolator());
}
throw new UnsupportedOperationException();
}
View.java 文件源码
项目:xbrowser
阅读 49
收藏 0
点赞 0
评论 0
public DoubleProperty xProperty() throws InterruptedException, ExecutionException {
if (Platform.isFxApplicationThread()) {
return getNode().layoutXProperty();
}
final FutureTask<DoubleProperty> task = new FutureTask<>(() -> getNode().layoutXProperty());
Platform.runLater(task);
return task.get();
}
SimplePropertySheet.java 文件源码
项目:marathonv5
阅读 25
收藏 0
点赞 0
评论 0
public static Object get(ObservableValue valueModel) {
if (valueModel instanceof DoubleProperty) {
return ((DoubleProperty)valueModel).get();
} else if (valueModel instanceof ObjectProperty) {
return ((ObjectProperty)valueModel).get();
}
return null;
}
MatrixItemSeriesBuilder.java 文件源码
项目:charts
阅读 30
收藏 0
点赞 0
评论 0
public final MatrixItemSeries build() {
final MatrixItemSeries SERIES = new MatrixItemSeries();
if (properties.keySet().contains("itemsArray")) {
SERIES.setItems(((ObjectProperty<MatrixItem[]>) properties.get("itemsArray")).get());
}
if(properties.keySet().contains("itemsList")) {
SERIES.setItems(((ObjectProperty<List<MatrixItem>>) properties.get("itemsList")).get());
}
for (String key : properties.keySet()) {
if ("name".equals(key)) {
SERIES.setName(((StringProperty) properties.get(key)).get());
} else if ("fill".equals(key)) {
SERIES.setFill(((ObjectProperty<Paint>) properties.get(key)).get());
} else if ("stroke".equals(key)) {
SERIES.setStroke(((ObjectProperty<Paint>) properties.get(key)).get());
} else if ("symbolFill".equals(key)) {
SERIES.setSymbolFill(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("symbolStroke".equals(key)) {
SERIES.setSymbolStroke(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("symbol".equals(key)) {
SERIES.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
} else if ("chartType".equals(key)) {
SERIES.setChartType(((ObjectProperty<ChartType>) properties.get(key)).get());
} else if ("symbolsVisible".equals(key)) {
SERIES.setSymbolsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("symbolSize".equals(key)) {
SERIES.setSymbolSize(((DoubleProperty) properties.get(key)).get());
} else if ("strokeWidth".equals(key)) {
SERIES.setStrokeWidth(((DoubleProperty) properties.get(key)).get());
}
}
return SERIES;
}
View.java 文件源码
项目:xbrowser
阅读 39
收藏 0
点赞 0
评论 0
public DoubleProperty yProperty() throws InterruptedException, ExecutionException {
if (Platform.isFxApplicationThread()) {
return getNode().layoutYProperty();
}
final FutureTask<DoubleProperty> task = new FutureTask<>(() -> getNode().layoutYProperty());
Platform.runLater(task);
return task.get();
}
FileUtility.java 文件源码
项目:ServerBrowser
阅读 38
收藏 0
点赞 0
评论 0
/**
* Downloads a file and saves it at the given location.
*
* @param url
* the url to download from
* @param outputPath
* the path where to save the downloaded file
* @param progressProperty
* a property that will contain the current download process from 0.0 to 1.0
* @param fileLength
* length of the file
* @return the downloaded file
* @throws IOException
* if an errors occurs while writing the file or opening the stream
*/
public static File downloadFile(final URL url, final String outputPath, final DoubleProperty progressProperty, final double fileLength) throws IOException {
try (final InputStream input = url.openStream(); final FileOutputStream fileOutputStream = new FileOutputStream(outputPath);) {
final double currentProgress = (int) progressProperty.get();
final byte[] buffer = new byte[10000];
while (true) {
final double length = input.read(buffer);
if (length <= 0) {
break;
}
/*
* Setting the progress property inside of a run later in order to avoid a crash,
* since this function is usually used inside of a different thread than the ui
* thread.
*/
Platform.runLater(() -> {
final double additional = length / fileLength * (1.0 - currentProgress);
progressProperty.set(progressProperty.get() + additional);
});
fileOutputStream.write(buffer, 0, (int) length);
}
return new File(outputPath);
}
}
HeatMapBuilder.java 文件源码
项目:worldheatmap
阅读 27
收藏 0
点赞 0
评论 0
public final HeatMap build() {
double width = 400;
double height = 400;
ColorMapping colorMapping = ColorMapping.LIME_YELLOW_RED;
double eventRadius = 15.5;
boolean fadeColors = false;
double heatMapOpacity = 0.5;
OpacityDistribution opacityDistribution = OpacityDistribution.CUSTOM;
for (String key : properties.keySet()) {
if ("prefSize".equals(key)) {
Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
width = dim.getWidth();
height = dim.getHeight();
} else if ("width".equals(key)) {
width = ((DoubleProperty) properties.get(key)).get();
} else if ("height".equals(key)) {
height = ((DoubleProperty) properties.get(key)).get();
} else if ("colorMapping".equals(key)) {
colorMapping = ((ObjectProperty<ColorMapping>) properties.get(key)).get();
} else if ("eventRadius".equals(key)) {
eventRadius = ((DoubleProperty) properties.get(key)).get();
} else if ("fadeColors".equals(key)) {
fadeColors = ((BooleanProperty) properties.get(key)).get();
} else if ("heatMapOpacity".equals(key)) {
heatMapOpacity = ((DoubleProperty) properties.get(key)).get();
} else if ("opacityDistribution".equals(key)) {
opacityDistribution = ((ObjectProperty<OpacityDistribution>) properties.get(key)).get();
}
}
return new HeatMap(width, height, colorMapping, eventRadius, fadeColors, heatMapOpacity, opacityDistribution);
}
ImageEntryView.java 文件源码
项目:GameAuthoringEnvironment
阅读 22
收藏 0
点赞 0
评论 0
public ImageEntryView (String label,
DoubleProperty width,
DoubleProperty height,
String cssClass) {
this(label, cssClass);
initImageView(width, height);
init();
}
Canvas.java 文件源码
项目:xbrowser
阅读 34
收藏 0
点赞 0
评论 0
public DoubleProperty heightProperty()throws InterruptedException,ExecutionException{
if (Platform.isFxApplicationThread()) {
return body.heightProperty();
}
counter++;
if(counter>maxCounter){
throw new ExecutionException(new Exception(hint));
}
final FutureTask<DoubleProperty> task = new FutureTask<>(() -> body.heightProperty());
Platform.runLater(task);
return task.get();
}
ResizeSupport.java 文件源码
项目:JavaFX-EX
阅读 37
收藏 0
点赞 0
评论 0
public BaseResize(Node node, DoubleProperty width, DoubleProperty height) {
super(node);
this.width = width;
this.height = height;
enable.addListener((ob, o, n) -> {
if (n == false) {
setCursor(Corner.CENTER);
}
});
}
CollectionGridPageFactory.java 文件源码
项目:LIRE-Lab
阅读 30
收藏 0
点赞 0
评论 0
public CollectionGridPageFactory(List<Image> images,
int pageSize,
ImageClickHandler clickHandler,
DoubleProperty gridGap,
DoubleProperty imageHeight) {
this.images = images;
this.pageSize = pageSize;
this.clickHandler = clickHandler;
this.gridGap = gridGap;
this.imageHeight = imageHeight;
}
VideoPlayerController.java 文件源码
项目:LivroJavaComoProgramar10Edicao
阅读 33
收藏 0
点赞 0
评论 0
public void initialize()
{
// get URL of the video file
URL url = VideoPlayerController.class.getResource("sts117.mp4");
// create a Media object for the specified URL
Media media = new Media(url.toExternalForm());
// create a MediaPlayer to control Media playback
mediaPlayer = new MediaPlayer(media);
// specify which MediaPlayer to display in the MediaView
mediaView.setMediaPlayer(mediaPlayer);
// set handler to be called when the video completes playing
mediaPlayer.setOnEndOfMedia(() -> {
playing = false;
playPauseButton.setText("Play");
});
// set handler that displays an ExceptionDialog if an error occurs
mediaPlayer.setOnError(() -> {
ExceptionDialog dialog =
new ExceptionDialog(mediaPlayer.getError());
dialog.showAndWait();
});
// bind the MediaView's width/height to the scene's width/height
DoubleProperty width = mediaView.fitWidthProperty();
DoubleProperty height = mediaView.fitHeightProperty();
width.bind(Bindings.selectDouble(
mediaView.sceneProperty(), "width"));
height.bind(Bindings.selectDouble(
mediaView.sceneProperty(), "height"));
}
PreferencesUtilsTest.java 文件源码
项目:shuffleboard
阅读 41
收藏 0
点赞 0
评论 0
@Test
public void testSaveDouble() {
// given
String name = "double";
double value = Double.MAX_VALUE;
DoubleProperty property = new SimpleDoubleProperty(null, name, value);
// when
PreferencesUtils.save(property, preferences);
// then
double saved = preferences.getDouble(name, -1);
assertEquals(value, saved);
}
Canvas.java 文件源码
项目:xbrowser
阅读 33
收藏 0
点赞 0
评论 0
public DoubleProperty widthProperty()throws InterruptedException,ExecutionException{
if (Platform.isFxApplicationThread()) {
return body.widthProperty();
}
counter++;
if(counter>maxCounter){
throw new ExecutionException(new Exception(hint));
}
final FutureTask<DoubleProperty> task = new FutureTask<>(() -> body.widthProperty());
Platform.runLater(task);
return task.get();
}
AreaHeatMapBuilder.java 文件源码
项目:charts
阅读 30
收藏 0
点赞 0
评论 0
public final AreaHeatMap build() {
final AreaHeatMap CONTROL = new AreaHeatMap();
for (String key : properties.keySet()) {
if ("prefSize".equals(key)) {
Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
} else if ("colorMapping".equals(key)) {
CONTROL.setColorMapping(((ObjectProperty<ColorMapping>) properties.get(key)).get());
} else if("useColorMapping".equals(key)) {
CONTROL.setUseColorMapping(((BooleanProperty) properties.get(key)).get());
} else if ("quality".equals(key)) {
CONTROL.setQuality(((IntegerProperty) properties.get(key)).get());
} else if ("heatMapOpacity".equals(key)) {
CONTROL.setHeatMapOpacity(((DoubleProperty) properties.get(key)).get());
} else if ("dataPointsVisible".equals(key)) {
CONTROL.setDataPointsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("smoothedHull".equals(key)) {
CONTROL.setSmoothedHull(((BooleanProperty) properties.get(key)).get());
} else if ("discreteColors".equals(key)) {
CONTROL.setDiscreteColors(((BooleanProperty) properties.get(key)).get());
} else if ("noOfCloserInfluentPoints".equals(key)) {
CONTROL.setNoOfCloserInfluentPoints(((IntegerProperty) properties.get(key)).get());
}
}
if (properties.keySet().contains("dataPointsArray")) {
CONTROL.setDataPoints(((ObjectProperty<DataPoint[]>) properties.get("dataPointsArray")).get());
}
if(properties.keySet().contains("dataPointsList")) {
CONTROL.setDataPoints(((ObjectProperty<List<DataPoint>>) properties.get("dataPointsList")).get());
}
return CONTROL;
}
Library.java 文件源码
项目:VortexCompiler
阅读 37
收藏 0
点赞 0
评论 0
public void filesCrossLoad(DoubleProperty progress, double value) {
double progressVal = value / (typedefs.size() + 1);
//Crossload
for (Typedef typedef : typedefs) {
typedef.crossLoad();
progressAdd(progress, progressVal);
}
progressAdd(progress, progressVal);
}
ChartItemBuilder.java 文件源码
项目:charts
阅读 33
收藏 0
点赞 0
评论 0
public final ChartItem build() {
final ChartItem ITEM = new ChartItem();
for (String key : properties.keySet()) {
if ("name".equals(key)) {
ITEM.setName(((StringProperty) properties.get(key)).get());
} else if ("value".equals(key)) {
ITEM.setValue(((DoubleProperty) properties.get(key)).get());
} else if("fill".equals(key)) {
ITEM.setFill(((ObjectProperty<Color>) properties.get(key)).get());
} else if("stroke".equals(key)) {
ITEM.setStroke(((ObjectProperty<Color>) properties.get(key)).get());
} else if("textColor".equals(key)) {
ITEM.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if("timestamp".equals(key)) {
ITEM.setTimestamp(((ObjectProperty<Instant>) properties.get(key)).get());
} else if ("timestampDateTime".equals(key)) {
ITEM.setTimestamp(((ObjectProperty<ZonedDateTime>) properties.get(key)).get());
} else if("symbol".equals(key)) {
ITEM.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
} else if("animated".equals(key)) {
ITEM.setAnimated(((BooleanProperty) properties.get(key)).get());
} else if("animationDuration".equals(key)) {
ITEM.setAnimationDuration(((LongProperty) properties.get(key)).get());
}
}
return ITEM;
}
VolatileLibrary.java 文件源码
项目:VortexCompiler
阅读 31
收藏 0
点赞 0
评论 0
@Override
public void projectReload(boolean makeFile, DoubleProperty progress) {
synchronized (compileLock) {
syncToFiles();
super.projectReload(makeFile, progress);
syncToInner();
}
}
VolatileLibrary.java 文件源码
项目:VortexCompiler
阅读 29
收藏 0
点赞 0
评论 0
@Override
public String[] projectExport(DoubleProperty progress, boolean asLib) {
synchronized (compileLock) {
syncToFiles();
String[] textFiles;
textFiles = super.projectExport(progress, asLib);
syncToInner();
return textFiles;
}
}
AnalysisData.java 文件源码
项目:CORNETTO
阅读 34
收藏 0
点赞 0
评论 0
public static DoubleProperty posCorrelationUpperFilterProperty() {
return posCorrelationUpperFilter;
}
Knob.java 文件源码
项目:KNOBS
阅读 32
收藏 0
点赞 0
评论 0
public DoubleProperty maxValueProperty() {
return maxValue;
}
MouseTracker.java 文件源码
项目:H-Uppaal
阅读 28
收藏 0
点赞 0
评论 0
public DoubleProperty yProperty() {
return yProperty;
}
Control.java 文件源码
项目:xbrowser
阅读 35
收藏 0
点赞 0
评论 0
public DoubleProperty xProperty() throws InterruptedException,ExecutionException{
if(Platform.isFxApplicationThread()) return body.layoutXProperty();
final FutureTask<DoubleProperty> task = new FutureTask<>(()->body.layoutXProperty());
Platform.runLater(task);
return task.get();
}