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