use of javafx.scene.Node in project bitsquare by bitsquare.
the class CandleStickChart method seriesRemoved.
@Override
protected void seriesRemoved(XYChart.Series<Number, Number> series) {
// remove all candle nodes
for (XYChart.Data<Number, Number> d : series.getData()) {
final Node candle = d.getNode();
if (shouldAnimate()) {
FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
ft.setToValue(0);
ft.setOnFinished((ActionEvent actionEvent) -> {
getPlotChildren().remove(candle);
});
ft.play();
} else {
getPlotChildren().remove(candle);
}
}
if (series.getNode() instanceof Path) {
Path seriesPath = (Path) series.getNode();
if (shouldAnimate()) {
FadeTransition ft = new FadeTransition(Duration.millis(500), seriesPath);
ft.setToValue(0);
ft.setOnFinished((ActionEvent actionEvent) -> {
getPlotChildren().remove(seriesPath);
seriesPath.getElements().clear();
});
ft.play();
} else {
getPlotChildren().remove(seriesPath);
seriesPath.getElements().clear();
}
}
}
use of javafx.scene.Node in project bitsquare by bitsquare.
the class VolumeChart method seriesAdded.
@Override
protected void seriesAdded(XYChart.Series<Number, Number> series, int seriesIndex) {
for (int j = 0; j < series.getData().size(); j++) {
XYChart.Data item = series.getData().get(j);
Node volumeBar = createCandle(seriesIndex, item, j);
if (shouldAnimate()) {
volumeBar.setOpacity(0);
getPlotChildren().add(volumeBar);
FadeTransition ft = new FadeTransition(Duration.millis(500), volumeBar);
ft.setToValue(1);
ft.play();
} else {
getPlotChildren().add(volumeBar);
}
}
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class FileTreeItem method updateGraphics.
/********************************
* 작성일 : 2016. 7. 10. 작성자 : KYJ
*
* UI에 보여질 Dispay 처리.
*
* @param fileWrapper
********************************/
private void updateGraphics(FileWrapper fileWrapper) {
Node value = createGraphcis(fileWrapper);
value.getStyleClass().add(graphicsCssId());
setGraphic(value);
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class FxControlsTreeItem method createNode.
/**
* 파일 트리를 생성하기 위한 노드를 반환한다.
*
* @Date 2015. 10. 14.
* @param f
* @return
* @User KYJ
*/
public TreeItem<Node> createNode(final Node f) {
TreeItem<Node> treeItem = new TreeItem<Node>(f) {
private boolean isLeaf;
private boolean isFirstTimeChildren = true;
private boolean isFirstTimeLeaf = true;
@Override
public ObservableList<TreeItem<Node>> getChildren() {
if (isFirstTimeChildren) {
isFirstTimeChildren = false;
super.getChildren().setAll(buildChildren(this));
}
return super.getChildren();
}
@Override
public boolean isLeaf() {
if (isFirstTimeLeaf) {
isFirstTimeLeaf = false;
Node f = getValue();
if (f == null) {
isLeaf = true;
} else if (f instanceof Control) {
isLeaf = ((Control) f).getChildrenUnmodifiable().isEmpty();
} else if (f instanceof Parent) {
isLeaf = ((Parent) f).getChildrenUnmodifiable().isEmpty();
} else if (f instanceof Shape)
isLeaf = true;
else
isLeaf = false;
}
return isLeaf;
}
private ObservableList<TreeItem<Node>> buildChildren(TreeItem<Node> treeItem) {
Node f = treeItem.getValue();
if (f == null) {
return FXCollections.emptyObservableList();
}
treeItem.setGraphic(new HBox(/* new CheckBox(), */
getImage(getName(f))));
List<Node> childrens = getChildrens(f);
if (childrens == null || childrens.isEmpty()) {
return FXCollections.emptyObservableList();
} else {
ObservableList<TreeItem<Node>> children = FXCollections.observableArrayList();
for (Node child : childrens) {
children.add(createNode(child));
}
return children;
}
}
};
treeItem.setGraphic(new HBox(/* new CheckBox(), */
getImage(getName(f))));
return treeItem;
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class CheckBoxFxControlsTreeItem method getChildrens.
/**
* node로부터 구성된 하위 노드들을 반환받음.
*
* @param node
* @return
*/
public List<Node> getChildrens(Node node) {
List<Node> controls = new ArrayList<>();
if (node instanceof Control) {
Control c = (Control) node;
controls.add(c);
controls = c.getChildrenUnmodifiable();
} else if (node instanceof Parent) {
Parent p = (Parent) node;
controls = p.getChildrenUnmodifiable();
} else {
controls.add(node);
}
return controls;
}
Aggregations