当前位置: 首页>>代码示例>>Java>>正文


Java Rectangle.setWidth方法代码示例

本文整理汇总了Java中javafx.scene.shape.Rectangle.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setWidth方法的具体用法?Java Rectangle.setWidth怎么用?Java Rectangle.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Rectangle的用法示例。


在下文中一共展示了Rectangle.setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawSelection

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private static void drawSelection(Group parent, Pane content) {
//        Rectangle selection1 = new Rectangle();
        Rectangle selection2 = new Rectangle();

        Stream.of(selection2).forEach(rect -> {
            rect.setMouseTransparent(true);

            rect.setStroke(SELECTION_STROKE_COLOR);
            rect.setStrokeWidth(SELECTION_STROKE_WIDTH);
            rect.setStrokeLineCap(StrokeLineCap.ROUND);
            rect.setFill(SELECTION_FILL_COLOR);

            rect.yProperty().bind(JfxUtils.ZERO_PROPERTY);
            rect.heightProperty().bind(content.heightProperty());
        });
//
//        selection1.setX(200);
//        selection1.setWidth(100);

        selection2.setX(500);
        selection2.setWidth(500);

        parent.getChildren().addAll(selection2);
    }
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:25,代码来源:UiModelApp2.java

示例2: adjust_rectangle_properties

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
void adjust_rectangle_properties(double starting_point_x, double starting_point_y, double ending_point_x,
        double ending_point_y, Rectangle given_rectangle) {
    given_rectangle.setX(starting_point_x);
    given_rectangle.setY(starting_point_y);
    given_rectangle.setWidth(ending_point_x - starting_point_x);
    given_rectangle.setHeight(ending_point_y - starting_point_y);

    if (given_rectangle.getWidth() < 0) {
        given_rectangle.setWidth(-given_rectangle.getWidth());
        given_rectangle.setX(given_rectangle.getX() - given_rectangle.getWidth());
    }

    if (given_rectangle.getHeight() < 0) {
        given_rectangle.setHeight(-given_rectangle.getHeight());
        given_rectangle.setY(given_rectangle.getY() - given_rectangle.getHeight());
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:ImagePanel.java

示例3: onTouchDragged

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public void onTouchDragged(TouchEvent event){
    Rectangle dragRectangle = dragRectangles.get(event.getTouchPoint().getId());
    Point2D startPoint = dragStarts.get(event.getTouchPoint().getId());

    if(event.getSource() instanceof AbstractNodeView){
        dragRectangle.setWidth(Math.abs(((AbstractNodeView)event.getSource()).getX() + event.getTouchPoint().getX() - startPoint.getX()));
        dragRectangle.setHeight(Math.abs(((AbstractNodeView)event.getSource()).getY() + event.getTouchPoint().getY() - startPoint.getY()));
        dragRectangle.setX(Math.min(startPoint.getX(), ((AbstractNodeView)event.getSource()).getX() + event.getTouchPoint().getX()));
        dragRectangle.setY(Math.min(startPoint.getY(), ((AbstractNodeView)event.getSource()).getY() + event.getTouchPoint().getY()));


    } else {
        dragRectangle.setWidth(Math.abs(startPoint.getX() - event.getTouchPoint().getX()));
        dragRectangle.setHeight(Math.abs(startPoint.getY() - event.getTouchPoint().getY()));
        dragRectangle.setX(Math.min(startPoint.getX(), event.getTouchPoint().getX()));
        dragRectangle.setY(Math.min(startPoint.getY(), event.getTouchPoint().getY()));

    }
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:20,代码来源:CreateNodeController.java

示例4: EmergencyStopControl

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public EmergencyStopControl() {
	super("Emergency Stop", FlashboardSendableType.ESTOP);
	
	statusRect = new Rectangle();
	statusRect.setWidth(160);
	statusRect.setHeight(40);
	statusRect.setFill(Color.GREEN);
	statusRect.setStroke(Color.BLACK);
	
	button = new javafx.scene.control.Button("Emergency Stop");
	button.setPrefWidth(160);
	button.setPrefHeight(40);
	button.setOnAction((e)->{
		change();
	});
	
	root = new VBox();
	root.setAlignment(Pos.CENTER);
	root.setSpacing(2.0);
	root.getChildren().addAll(button, statusRect);
}
 
开发者ID:Flash3388,项目名称:FlashLib,代码行数:22,代码来源:EmergencyStopControl.java

示例5: createPieceRectangle

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createPieceRectangle() {
    Rectangle rec = new Rectangle();
    rec.setX(-50);
    rec.setY(-50);
    rec.setWidth(SIZE);
    rec.setHeight(SIZE);
    return rec;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:PuzzlePieces.java

示例6: createRectangleHandle

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private void createRectangleHandle(){
    rectangleHandle = new Rectangle();
    rectangleHandle.setWidth(10);
    rectangleHandle.setHeight(10);
    rectangleHandle.xProperty().bind(lifeline.endXProperty().subtract(rectangleHandle.widthProperty().divide(2)));
    rectangleHandle.yProperty().bind(lifeline.endYProperty().subtract(rectangleHandle.heightProperty().divide(2)));
    this.getChildren().add(rectangleHandle);
    rectangleHandle.setVisible(false);
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:10,代码来源:SequenceObjectView.java

示例7: start

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    stage.setTitle("Toggle Button Sample");
    stage.setWidth(250);
    stage.setHeight(180);
    
    HBox hbox = new HBox();
    VBox vbox = new VBox();        
    
    Scene scene = new Scene(new Group(vbox));
    stage.setScene(scene);
    scene.getStylesheets().add("togglebuttonsample/ControlStyle.css");

    Rectangle rect = new Rectangle();
    rect.setHeight(50);
    rect.setFill(Color.WHITE);
    rect.setStroke(Color.DARKGRAY);
    rect.setStrokeWidth(2);
    rect.setArcHeight(10);
    rect.setArcWidth(10);

    final ToggleGroup group = new ToggleGroup();

    group.selectedToggleProperty().addListener(
        (ObservableValue<? extends Toggle> ov, 
        Toggle toggle, Toggle new_toggle) -> {
        if (new_toggle == null)
            rect.setFill(Color.WHITE);
        else
            rect.setFill((Color) group.getSelectedToggle().getUserData());
    });

    ToggleButton tb1 = new ToggleButton("Minor");
    tb1.setToggleGroup(group);
    tb1.setUserData(Color.LIGHTGREEN);
    tb1.setSelected(true);
    tb1.getStyleClass().add("toggle-button1");

    ToggleButton tb2 = new ToggleButton("Major");
    tb2.setToggleGroup(group);
    tb2.setUserData(Color.LIGHTBLUE);
    tb2.getStyleClass().add("toggle-button2");

    ToggleButton tb3 = new ToggleButton("Critical");
    tb3.setToggleGroup(group);
    tb3.setUserData(Color.SALMON);
    tb3.getStyleClass().add("toggle-button3");

    

    hbox.getChildren().addAll(tb1, tb2, tb3);

    vbox.getChildren().add(new Label("Priority:"));
    vbox.getChildren().add(hbox);
    vbox.getChildren().add(rect);
    vbox.setPadding(new Insets(20, 10, 10, 20));

          
    stage.show();
    rect.setWidth(hbox.getWidth());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:62,代码来源:ToggleButtonSample.java

示例8: getVisual

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@Override
public Node getVisual (Block block) {
    Rectangle rect = super.getRectangle(block);
    rect.setWidth(myWidth);
    rect.setHeight(myHeight);
    return rect;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:8,代码来源:ScaleFactory.java

示例9: finish

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private void finish(Rectangle rectanlge){
    aDrawPane.getChildren().remove(rectanlge);
    try{
    	rectanlge.setWidth(0);
    	rectanlge.setHeight(0);        	
    }catch (Exception e){
    	e.printStackTrace();
    }
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:10,代码来源:CreateNodeController.java

示例10: Clavier

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public Clavier(Instru instru) {

        this.instru = instru;// l'objet de type Instru prend la valeur de l'objet passé en paramètre

        Rectangle fond_clavier = new Rectangle();
        fond_clavier.setWidth(400);
        fond_clavier.setHeight(200);
        fond_clavier.setArcWidth(30);
        fond_clavier.setArcHeight(30);
        fond_clavier.setFill( // on remplie notre rectangle avec un dégradé
                new LinearGradient(0f, 0f, 0f, 1f, true, CycleMethod.NO_CYCLE,
                        new Stop[] { new Stop(0, Color.web("#333333")), new Stop(1, Color.web("#000000")) }));
        Reflection r = new Reflection();// on applique un effet de réflection
        r.setFraction(0.25);
        r.setBottomOpacity(0);
        r.setTopOpacity(0.5);
        fond_clavier.setEffect(r);

        touches = new Touche[] { new Touche("U", 50, 20, 60, instru), new Touche("I", 128, 20, 62, instru),
                new Touche("O", 206, 20, 64, instru), new Touche("P", 284, 20, 65, instru),
                new Touche("J", 75, 98, 67, instru), new Touche("K", 153, 98, 69, instru),
                new Touche("L", 231, 98, 71, instru), new Touche("M", 309, 98, 72, instru) };

        this.setTranslateX(50);
        this.setTranslateY(250);
        this.getChildren().add(fond_clavier);

        for (Touche touche : touches) { // on insère chaque touche une par une.
            this.getChildren().add(touche);
        }

    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:33,代码来源:Clavier.java

示例11: ColorPickerTool

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public ColorPickerTool(Color startColor) {
    setMinWidth(USE_PREF_SIZE);
    setMaxWidth(Double.MAX_VALUE);
    setAlignment(Pos.BASELINE_LEFT);
    getStyleClass().add("color-picker");
    setTextFill(Color.WHITE);
    
    color.set(startColor);
    textProperty().bind(new StringBinding() {
        { bind(color); }
        @Override protected String computeValue() {
            return getWebColor(getColor());
        }
    });
    setOnAction((ActionEvent arg0) -> {
        if (popover == null) {
            popover = new ColorPickerPopover();
            popover.colorProperty().addListener((ObservableValue<? extends Color> arg1, Color arg2, Color newValue) -> {
                setColor(newValue);
            });
        }
        if (popover.isShowing()) {
            popover.hide();
        } else {
            popover.setColor(getColor());
            popover.show(ColorPickerTool.this);
        }
    });
    Rectangle colorRect = new Rectangle();
    colorRect.setWidth(16);
    colorRect.setHeight(16);
    colorRect.fillProperty().bind(new ObjectBinding<Paint>() { { bind(color); }
        @Override protected Paint computeValue() {
            return getColor();
        }
    });
    colorRect.setEffect(new DropShadow(3, 0, 1, Color.rgb(0, 0, 0, 0.8)));
    setGraphic(colorRect);
}
 
开发者ID:EricCanull,项目名称:fxexperience2,代码行数:40,代码来源:ColorPickerTool.java

示例12: 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);

}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:51,代码来源:AllAttendance.java

示例13: 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);
	  
	 }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:51,代码来源:Office_Entry.java

示例14: 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);
  
 }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:67,代码来源:MainWindow.java

示例15: 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);
	 }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:77,代码来源:Help.java


注:本文中的javafx.scene.shape.Rectangle.setWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。