當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。