当前位置: 首页>>代码示例>>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;未经允许,请勿转载。