本文整理汇总了Java中javafx.scene.shape.Rectangle.heightProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.heightProperty方法的具体用法?Java Rectangle.heightProperty怎么用?Java Rectangle.heightProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Rectangle
的用法示例。
在下文中一共展示了Rectangle.heightProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAnimation
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void setAnimation(){
// Initially hiding the Top Pane
clipRect = new Rectangle();
clipRect.setWidth(boxBounds.getWidth());
clipRect.setHeight(0);
clipRect.translateYProperty().set(boxBounds.getWidth());
laytable.setClip(clipRect);
laytable.translateYProperty().set(-boxBounds.getWidth());
// Animation for bouncing effect.
final Timeline timelineBounce = new Timeline();
timelineBounce.setCycleCount(2);
timelineBounce.setAutoReverse(true);
final KeyValue kv1 = new KeyValue(clipRect.heightProperty(), (boxBounds.getHeight()-15));
final KeyValue kv2 = new KeyValue(clipRect.translateYProperty(), 15);
final KeyValue kv3 = new KeyValue(laytable.translateYProperty(), -15);
final KeyFrame kf1 = new KeyFrame(Duration.millis(100), kv1, kv2, kv3);
timelineBounce.getKeyFrames().add(kf1);
// Event handler to call bouncing effect after the scroll down is finished.
EventHandler onFinished = new EventHandler() {
@Override
public void handle(Event event) {
timelineBounce.play();
}
};
timelineDown = new Timeline();
timelineUp = new Timeline();
// Animation for scroll down.
timelineDown.setCycleCount(1);
timelineDown.setAutoReverse(true);
final KeyValue kvDwn1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRect.translateYProperty(), 0);
final KeyValue kvDwn3 = new KeyValue(laytable.translateYProperty(), 0);
final KeyFrame kfDwn = new KeyFrame(Duration.millis(1000), onFinished, kvDwn1, kvDwn2, kvDwn3);
timelineDown.getKeyFrames().add(kfDwn);
// Animation for scroll up.
timelineUp.setCycleCount(1);
timelineUp.setAutoReverse(true);
final KeyValue kvUp1 = new KeyValue(clipRect.heightProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRect.translateYProperty(), boxBounds.getHeight());
final KeyValue kvUp3 = new KeyValue(laytable.translateYProperty(), -boxBounds.getHeight());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3);
timelineUp.getKeyFrames().add(kfUp);
}
示例2: setAnimation
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void setAnimation(){
// Initially hiding the Top Pane
clipRect = new Rectangle();
clipRect.setWidth(boxBounds.getWidth());
clipRect.setHeight(0);
clipRect.translateYProperty().set(boxBounds.getWidth());
laytable.setClip(clipRect);
laytable.translateYProperty().set(-boxBounds.getWidth());
// Animation for bouncing effect.
final Timeline timelineBounce = new Timeline();
timelineBounce.setCycleCount(2);
timelineBounce.setAutoReverse(true);
final KeyValue kv1 = new KeyValue(clipRect.heightProperty(), (boxBounds.getHeight()-15));
final KeyValue kv2 = new KeyValue(clipRect.translateYProperty(), 15);
final KeyValue kv3 = new KeyValue(laytable.translateYProperty(), -15);
final KeyFrame kf1 = new KeyFrame(Duration.millis(100), kv1, kv2, kv3);
timelineBounce.getKeyFrames().add(kf1);
// Event handler to call bouncing effect after the scroll down is finished.
EventHandler onFinished = new EventHandler() {
@Override
public void handle(Event event) {
timelineBounce.play();
}
};
timelineDown = new Timeline();
timelineUp = new Timeline();
// Animation for scroll down.
timelineDown.setCycleCount(1);
timelineDown.setAutoReverse(true);
final KeyValue kvDwn1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRect.translateYProperty(), 0);
final KeyValue kvDwn3 = new KeyValue(laytable.translateYProperty(), 0);
final KeyFrame kfDwn = new KeyFrame(Duration.millis(1000), onFinished, kvDwn1, kvDwn2, kvDwn3);
timelineDown.getKeyFrames().add(kfDwn);
// Animation for scroll up.
timelineUp.setCycleCount(1);
timelineUp.setAutoReverse(true);
final KeyValue kvUp1 = new KeyValue(clipRect.heightProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRect.translateYProperty(), boxBounds.getHeight());
final KeyValue kvUp3 = new KeyValue(laytable.translateYProperty(), -boxBounds.getHeight());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3);
timelineUp.getKeyFrames().add(kfUp);
}
示例3: setAnimation
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void setAnimation(){
// Initially hiding the Top Pane
clipRect = new Rectangle();
clipRect.setWidth(boxBounds.getWidth());
clipRect.setHeight(0);
clipRect.translateYProperty().set(boxBounds.getWidth());
layall.setClip(clipRect);
layall.translateYProperty().set(-boxBounds.getWidth());
layoffice.translateYProperty().set(-boxBounds.getWidth());
// Animation for bouncing effect.
final Timeline timelineBounce = new Timeline();
timelineBounce.setCycleCount(2);
timelineBounce.setAutoReverse(true);
final KeyValue kv1 = new KeyValue(clipRect.heightProperty(), (boxBounds.getHeight()-15));
final KeyValue kv2 = new KeyValue(clipRect.translateYProperty(), 15);
final KeyValue kv3 = new KeyValue(layall.translateYProperty(), -15);
final KeyFrame kf1 = new KeyFrame(Duration.millis(100), kv1, kv2, kv3);
timelineBounce.getKeyFrames().add(kf1);
// Event handler to call bouncing effect after the scroll down is finished.
EventHandler onFinished = new EventHandler() {
@Override
public void handle(Event event) {
timelineBounce.play();
}
};
timelineDown = new Timeline();
timelineUp = new Timeline();
timelineoffice= new Timeline();
// Animation for scroll down.
timelineDown.setCycleCount(1);
timelineDown.setAutoReverse(true);
final KeyValue kvDwn1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRect.translateYProperty(), 0);
final KeyValue kvDwn3 = new KeyValue(layall.translateYProperty(), 0);
final KeyValue kvDwn4 = new KeyValue(layoffice.translateYProperty(), -boxBounds.getHeight()-190);
final KeyFrame kfDwn = new KeyFrame(Duration.millis(1000), onFinished, kvDwn1, kvDwn2, kvDwn3, kvDwn4);
timelineDown.getKeyFrames().add(kfDwn);
// Animation for scroll up.
timelineUp.setCycleCount(1);
timelineUp.setAutoReverse(true);
final KeyValue kvUp1 = new KeyValue(clipRect.heightProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRect.translateYProperty(), boxBounds.getHeight());
final KeyValue kvUp3 = new KeyValue(layall.translateYProperty(), -boxBounds.getHeight()-190);
final KeyValue kvUp4 = new KeyValue(layoffice.translateYProperty(), -boxBounds.getHeight()-190);
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
timelineUp.getKeyFrames().add(kfUp);
//Animation for the scrollside
timelineoffice.setCycleCount(1);
timelineoffice.setAutoReverse(true);
final KeyValue kvside1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvside2 = new KeyValue(clipRect.translateYProperty(), 0);
final KeyValue kvside3 = new KeyValue(layoffice.translateYProperty(), 0);
final KeyValue kvside4 = new KeyValue(layall.translateYProperty(), -boxBounds.getHeight());
final KeyFrame kfside = new KeyFrame(Duration.millis(1000), kvside1, kvside2, kvside3, kvside4);
timelineoffice.getKeyFrames().add(kfside);
}
示例4: setAnimation
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void setAnimation(){
// Initially hiding the Top Pane
clipRect = new Rectangle();
clipRect.setWidth(boxBounds.getWidth());
clipRect.setHeight(0);
clipRect.translateXProperty().set(boxBounds.getWidth());
topPane.setClip(clipRect);
topPane.translateXProperty().set(-boxBounds.getWidth());
thirdpane.translateXProperty().set(-boxBounds.getWidth());
fourthpane.translateXProperty().set(-boxBounds.getWidth());
// Animation for bouncing effect.
final Timeline timelineBounce = new Timeline();
timelineBounce.setCycleCount(2);
timelineBounce.setAutoReverse(true);
final KeyValue kv1 = new KeyValue(clipRect.heightProperty(), (boxBounds.getHeight()-15));
final KeyValue kv2 = new KeyValue(clipRect.translateYProperty(), 15);
final KeyValue kv3 = new KeyValue(topPane.translateYProperty(), -15);
final KeyFrame kf1 = new KeyFrame(Duration.millis(100), kv1, kv2, kv3);
timelineBounce.getKeyFrames().add(kf1);
// Event handler to call bouncing effect after the scroll down is finished.
EventHandler onFinished = new EventHandler() {
@Override
public void handle(Event event) {
timelineBounce.play();
}
};
timelineDown = new Timeline();
timelineUp = new Timeline();
timelinethree= new Timeline();
timelinefour= new Timeline();
// Animation for scroll down.
timelineDown.setCycleCount(1);
timelineDown.setAutoReverse(true);
final KeyValue kvDwn1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRect.translateXProperty(), 0);
final KeyValue kvDwn3 = new KeyValue(topPane.translateXProperty(), 0);
final KeyValue kvDwn4 = new KeyValue(thirdpane.translateXProperty(), -boxBounds.getHeight());
final KeyValue kvDwn5 = new KeyValue(fourthpane.translateXProperty(), -boxBounds.getHeight());
final KeyFrame kfDwn = new KeyFrame(Duration.millis(1000), onFinished, kvDwn1, kvDwn2, kvDwn3, kvDwn4, kvDwn5);
timelineDown.getKeyFrames().add(kfDwn);
// Animation for scroll up.
timelineUp.setCycleCount(1);
timelineUp.setAutoReverse(true);
final KeyValue kvUp1 = new KeyValue(clipRect.heightProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRect.translateXProperty(), boxBounds.getHeight());
final KeyValue kvUp3 = new KeyValue(topPane.translateXProperty(), -boxBounds.getHeight());
final KeyValue kvUp4 = new KeyValue(thirdpane.translateXProperty(), -boxBounds.getHeight());
final KeyValue kvUp5 = new KeyValue(fourthpane.translateXProperty(), -boxBounds.getHeight());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4, kvUp5);
timelineUp.getKeyFrames().add(kfUp);
//Animation for the scrollside
timelinethree.setCycleCount(1);
timelinethree.setAutoReverse(true);
final KeyValue kvside1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvside2 = new KeyValue(clipRect.translateXProperty(), 0);
final KeyValue kvside3 = new KeyValue(thirdpane.translateXProperty(), 0);
final KeyValue kvside4 = new KeyValue(fourthpane.translateXProperty(), -boxBounds.getHeight());
final KeyFrame kfside = new KeyFrame(Duration.millis(1000), kvside1, kvside2, kvside3, kvside4);
timelinethree.getKeyFrames().add(kfside);
timelinefour.setCycleCount(1);
timelinefour.setAutoReverse(true);
final KeyValue kvfourth1 = new KeyValue(clipRect.heightProperty(), boxBounds.getWidth());
final KeyValue kvfourth2 = new KeyValue(clipRect.translateXProperty(), 0);
final KeyValue kvfourth3 = new KeyValue(fourthpane.translateXProperty(), 0);
final KeyFrame kffourth = new KeyFrame(Duration.millis(1000), kvfourth1, kvfourth2, kvfourth3);
timelinefour.getKeyFrames().add(kffourth);
}