if (timeline != null) {
timeline.stop();
}
if (expandedProperty().get()) {
timeline = new Timeline(new KeyFrame(0, horizontalLine.alphaProperty(), 1.0)
, new KeyFrame(200, horizontalLine.alphaProperty(), 0.0)
, new KeyFrame(0, horizontalLine.rotateProperty(), 0.0)
, new KeyFrame(200, horizontalLine.rotateProperty(), 0.25)
, new KeyFrame(0, verticalLine.rotateProperty(), 0.0)
, new KeyFrame(200, verticalLine.rotateProperty(), 0.25)
);
} else {
timeline = new Timeline(new KeyFrame(0, horizontalLine.alphaProperty(), 0.0)
, new KeyFrame(200, horizontalLine.alphaProperty(), 1.0)
, new KeyFrame(0, horizontalLine.rotateProperty(), 0.25)
, new KeyFrame(200, horizontalLine.rotateProperty(), 0.0)
, new KeyFrame(0, verticalLine.rotateProperty(), 0.25)
, new KeyFrame(200, verticalLine.rotateProperty(), 0.0)
);
}
timeline.start();
}