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


Java Shape.setOpacity方法代碼示例

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


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

示例1: color

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
public static Style color(Paint stroke, Paint fill, Double opacity)
{
	StyleApplier applier = new StyleApplier()
	{
		@Override
		public void apply(Shape shape)
		{
			shape.setStroke(stroke);
			shape.setFill(fill);
			shape.setOpacity(opacity);
		}
	};
	String value = "Stroke: " + stroke.toString() + " Fill: " + fill.toString() + " Opacity: " + opacity;
	return new Style(COLOR, applier, value);

}
 
開發者ID:GeePawHill,項目名稱:contentment,代碼行數:17,代碼來源:TypeFace.java

示例2: frame

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
public static Style frame(Paint stroke, Paint fill, Double width, Double opacity, Dash dash)
{
	StyleApplier applier = new StyleApplier()
	{
		@Override
		public void apply(Shape shape)
		{
			shape.setStroke(stroke);
			shape.setFill(fill);
			shape.setStrokeWidth(width);
			shape.setOpacity(opacity);
			shape.getStrokeDashArray().clear();
			shape.getStrokeDashArray().addAll(dash.array);
		}
	};
	String value = "Frame: " + stroke.toString() + " Fill: " + fill.toString() + " Width: " + width + " Opacity: " + opacity
			+ " Dash: " + dash;
	return new Style(KEY, applier, value);

}
 
開發者ID:GeePawHill,項目名稱:contentment,代碼行數:21,代碼來源:Frames.java

示例3: moveTo

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
/**
 * Moves this cell to the given x and y coordinates
 * @param x the x coordinate to move to
 * @param y the y coordinate to move to
 * @param animate whether to animate the transition from the old position
 * @param emphasize whether to have the Highlighter class emphasize this cell while it moves
 */
void moveTo(double x, double y, boolean animate, boolean emphasize){
    if(animate && numCellsBeingAnimated < MAX_NUM_CELLS_TO_ANIMATE){
        numCellsBeingAnimated++;

        Shape placeHolder = (Shape) getBaseView();
        placeHolder.setTranslateX(x+TreeLayout.H_PAD);
        placeHolder.setTranslateY(y+BOX_SHIFT);
        placeHolder.setOpacity(0.0);
        ((Pane)(this.getParent())).getChildren().add(placeHolder);

        TranslateTransition t = new TranslateTransition(Duration.millis(3000), this);
        t.setToX(x);
        t.setToY(y+BOX_SHIFT);
        t.setCycleCount(1);
        t.setOnFinished(event -> {
            numCellsBeingAnimated--;
            ((Pane)(this.getParent())).getChildren().remove(placeHolder);
        });
        t.play();

        if(emphasize){
            Highlighter.emphasizeCell(this);
        }
    }else{
        setTranslateX(x);
        setTranslateY(y+BOX_SHIFT);
    }
    this.refLabel.translate(x,y);
    this.hasUpdatedPosition.set(true);
    if (!this.refLabel.isVisible())
        this.refLabel.setVisible(true);
}
 
開發者ID:dmusican,項目名稱:Elegit,代碼行數:40,代碼來源:Cell.java

示例4: decorateShape

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
private void decorateShape(Shape s, Color fill, Color stroke, double opacity) {
    s.setMouseTransparent(true);
    s.setFill(fill);
    s.setStroke(stroke);
    s.setOpacity(opacity);
}
 
開發者ID:dejv78,項目名稱:jfx.radialmenu,代碼行數:7,代碼來源:RadialDebug.java


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