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


Java Shape.getStroke方法代碼示例

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


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

示例1: strokeFrom

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
/**
 * Animates the element's border color from the given rotation to the existing one. CAN ONLY BE APPLIED TO SHAPES.
 * @param duration Duration of the animation
 * @param color The color to animate from
 */
public Sprint strokeFrom(double duration, Color color) {

    KeyValue keyValueX;

    if (node instanceof Shape) {
        Shape shape = (Shape) node;
        keyValueX = new KeyValue(shape.strokeProperty(), shape.getStroke(), interpolator);

        shape.setStroke(color);
    } else {
        return this;
    }

    KeyFrame keyFrame = new KeyFrame(Duration.seconds(duration), keyValueX);
    timeline.getKeyFrames().add(keyFrame);

    return this;
}
 
開發者ID:kirankunigiri,項目名稱:Sprint-JavaFX-Animation,代碼行數:24,代碼來源:Sprint.java

示例2: accept

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
@Override
public boolean accept(Node node)
{
	if (node instanceof Shape)
	{
		Shape shape = (Shape) node;
		if (result == null) result = shape.getStroke();
		shape.setStroke(paint);
	}
	if (node instanceof Text)
	{
		Text text = (Text) node;
		text.setFill(paint);
	}
	return true;
}
 
開發者ID:GeePawHill,項目名稱:contentment,代碼行數:17,代碼來源:ColorChanger.java

示例3: addStrokeDataFromShape

import javafx.scene.shape.Shape; //導入方法依賴的package包/類
private static void addStrokeDataFromShape(SvgNodeProperties properties, Shape shape) {

		//color
		Paint stroke = shape.getStroke();
		String strokeColor = paintToColorString(stroke);
		properties.setStroke(strokeColor);

		//width
		Double strokeWidth = shape.getStrokeWidth();
		properties.setStrokeWidth(strokeWidth);

		//line cap
		StrokeLineCap strokeLineCap = shape.getStrokeLineCap();
		properties.setStrokeLineCap(strokeLineCap);

		//dash array
		List<Double> strokeDashArrayList = shape.getStrokeDashArray();
		String strokeDashArray = doubleArrayToStrokeDashArrayString(strokeDashArrayList);
		properties.setStrokeDashArray(strokeDashArray);

		//dash offset
		Double strokeDashOffset = shape.getStrokeDashOffset();
		properties.setStrokeDashOffset(strokeDashOffset);

		//line join
		StrokeLineJoin strokeLineJoin = shape.getStrokeLineJoin();
		properties.setStrokeLineJoin(strokeLineJoin);

		//miter limit
		Double strokeMiterLimit = shape.getStrokeMiterLimit();
		properties.setStrokeMiterLimit(strokeMiterLimit);

		//alignment
		StrokeType strokeType = shape.getStrokeType();
		properties.setStrokeAlignment(strokeType);
	}
 
開發者ID:stefaneidelloth,項目名稱:JavaFxNodeToSvg,代碼行數:37,代碼來源:ShapeToSvgConverter.java


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