當前位置: 首頁>>代碼示例>>Java>>正文


Java Rotate.setAxis方法代碼示例

本文整理匯總了Java中javafx.scene.transform.Rotate.setAxis方法的典型用法代碼示例。如果您正苦於以下問題:Java Rotate.setAxis方法的具體用法?Java Rotate.setAxis怎麽用?Java Rotate.setAxis使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.transform.Rotate的用法示例。


在下文中一共展示了Rotate.setAxis方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CenteredCameraController

import javafx.scene.transform.Rotate; //導入方法依賴的package包/類
/**
 * The default constructor.
 * 
 * @param camera
 *            The camera this controller will manage.
 * @param scene
 *            The scene the camera is viewing.
 * @param canvas
 *            The FXCanvas containing the scene.
 */
public CenteredCameraController(Camera camera, Scene scene,
		FXCanvas canvas) {
	super(camera, scene, canvas);

	// Initialize the data members
	dragStarted = false;
	shouldInvertX = false;
	shouldInvertY = false;

	// Set the x axis rotation for the affine transformation
	x = new Rotate();
	x.setAxis(Rotate.X_AXIS);

	// Set the y axis rotation for the affine transformation
	y = new Rotate();
	y.setAxis(Rotate.Y_AXIS);

	// Set the y axis rotation for the affine transformation
	z = new Rotate();
	z.setAxis(Rotate.Z_AXIS);

	// Apply the rotations and the affine to the camera
	xform.getTransforms().setAll(x, y, z, affine);

}
 
開發者ID:eclipse,項目名稱:eavp,代碼行數:36,代碼來源:CenteredCameraController.java

示例2: SplitFlapSkin

import javafx.scene.transform.Rotate; //導入方法依賴的package包/類
public SplitFlapSkin(final SplitFlap CONTROL) {
    super(CONTROL);
    FLIP_FINISHED         = new FlipEvent(this, getSkinnable(), FlipEvent.FLIP_FINISHED);
    selectedSet           = getSkinnable().getSelectedSet();
    currentSelectionIndex = getSkinnable().getSelectedSet().indexOf(getSkinnable().getText());
    nextSelectionIndex    = currentSelectionIndex + 1 > getSkinnable().getSelectedSet().size() ? 0 : currentSelectionIndex + 1;
    aspectRatio           = PREFERRED_HEIGHT / PREFERRED_WIDTH;
    pane                  = new Pane();
    rotateFlap            = new Rotate();
    rotateFlap.setAxis(Rotate.X_AXIS);
    rotateFlap.setAngle(0);
    flapHeight            = 0.49206349206349204 * PREFERRED_HEIGHT;
    timeline              = new Timeline();
    init();
    initGraphics();
    registerListeners();
}
 
開發者ID:Simego,項目名稱:FXImgurUploader,代碼行數:18,代碼來源:SplitFlapSkin.java

示例3: initGraphics

import javafx.scene.transform.Rotate; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    super.initGraphics();

    timeline              = new Timeline();
    characters            = tile.getCharacterList();
    currentSelectionIndex = 0;
    nextSelectionIndex    = 1;

    centerX    = PREFERRED_WIDTH * 0.5;
    centerY    = PREFERRED_HEIGHT * 0.5;

    pane.setBackground(null);
    pane.setBorder(null);

    rotateFlap = new Rotate();
    rotateFlap.setAxis(Rotate.X_AXIS);
    rotateFlap.setAngle(0);

    flapHeight = PREFERRED_HEIGHT * 0.495;

    upperBackground    = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT * 0.495);
    upperBackgroundCtx = upperBackground.getGraphicsContext2D();

    upperBackgroundText    = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT * 0.495);
    upperBackgroundTextCtx = upperBackgroundText.getGraphicsContext2D();
    upperBackgroundTextCtx.setTextBaseline(VPos.CENTER);
    upperBackgroundTextCtx.setTextAlign(TextAlignment.CENTER);

    lowerBackground    = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT * 0.495);
    lowerBackgroundCtx = lowerBackground.getGraphicsContext2D();

    lowerBackgroundText    = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT * 0.495);
    lowerBackgroundTextCtx = lowerBackgroundText.getGraphicsContext2D();
    lowerBackgroundTextCtx.setTextBaseline(VPos.CENTER);
    lowerBackgroundTextCtx.setTextAlign(TextAlignment.CENTER);

    flap = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT * 0.495);
    flap.getTransforms().add(rotateFlap);
    flapCtx = flap.getGraphicsContext2D();

    flapTextFront = new Canvas();
    flapTextFront.getTransforms().add(rotateFlap);
    flapTextFrontCtx = flapTextFront.getGraphicsContext2D();
    flapTextFrontCtx.setTextBaseline(VPos.CENTER);
    flapTextFrontCtx.setTextAlign(TextAlignment.CENTER);

    flapTextBack  = new Canvas();
    flapTextBack.getTransforms().add(rotateFlap);
    flapTextBack.setOpacity(0);
    flapTextBackCtx = flapTextBack.getGraphicsContext2D();
    flapTextBackCtx.setTextBaseline(VPos.CENTER);
    flapTextBackCtx.setTextAlign(TextAlignment.CENTER);

    pane.getChildren().addAll(upperBackground,
                              lowerBackground,
                              upperBackgroundText,
                              lowerBackgroundText,
                              flap,
                              flapTextFront,
                              flapTextBack);
}
 
開發者ID:HanSolo,項目名稱:tilesfx,代碼行數:62,代碼來源:FlipTileSkin.java


注:本文中的javafx.scene.transform.Rotate.setAxis方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。