本文整理汇总了Java中javafx.scene.shape.SVGPath.setFill方法的典型用法代码示例。如果您正苦于以下问题:Java SVGPath.setFill方法的具体用法?Java SVGPath.setFill怎么用?Java SVGPath.setFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.SVGPath
的用法示例。
在下文中一共展示了SVGPath.setFill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawNode
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
@Override
public Node drawNode() {
currentTestNode = this;
PathTransition pathTransition = new PathTransition();
Pane p = pre(pathTransition);
SVGPath path = new SVGPath();
path.setContent("M40,60 C42,148 144,30 25,32");
path.setStrokeWidth(2);
path.setStroke(Color.RED);
p.getChildren().add(path);
path.setFill(Color.TRANSPARENT);
// pathTransition.setDuration(Duration.valueOf(typicalDuration));
pathTransition.setDuration(new Duration(typicalDuration));
pathTransition.setNode(circle);
circle.setRotate(30);
//pathTransition.setPath(AnimationPath.createFromPath(path));
pathTransition.setPath(path);
pathTransition.setOrientation(OrientationType.NONE);
timeline.setCycleCount(3);
timeline.setAutoReverse(true);
return p;
}
示例2: Draw
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
@Override
public void Draw(Pane canvas)
{
double theWidth = GetDoubleAttribute("Width") / MaximumX * canvas.getWidth() / 2;
double x = canvas.getWidth() * (GetDoubleAttribute("X") / MaximumX);
SVGPath p = new SVGPath();
p.setContent(String.format("M 0,0 %1$.3f,0 %2$.3f,%3$.3f %4$.3f,%3$.3f %4$.3f,%6$.3f %2$.3f,%6$.3f %1$.3f,%5$.3f 0,%5$.3f 0,%7$.3f %9$.3f,%8$.3f 0,%1$.3f",
theWidth / 2,
x + (double)theWidth / 3,
canvas.getHeight() / 2 - (double)theWidth / 3,
canvas.getWidth(),
canvas.getHeight(),
canvas.getHeight() / 2 + (double)theWidth / 3,
canvas.getHeight() - (double)theWidth / 2,
canvas.getHeight() / 2,
x - (double)theWidth / 3));
p.setFill(GetColorAttribute("Color"));
canvas.getChildren().add(p);
}
示例3: Draw
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
@Override
public void Draw(Pane canvas)
{
double x1 = canvas.getWidth() * (GetDoubleAttribute("X1") / MaximumX);
double y1 = canvas.getHeight() * (GetDoubleAttribute("Y1") / MaximumY);
double x2 = canvas.getWidth() * (GetDoubleAttribute("X2") / MaximumX);
double y2 = canvas.getHeight() * (GetDoubleAttribute("Y2") / MaximumY);
double x3 = canvas.getWidth() * (GetDoubleAttribute("X3") / MaximumX);
double y3 = canvas.getHeight() * (GetDoubleAttribute("Y3") / MaximumY);
double x4 = canvas.getWidth() * (GetDoubleAttribute("X4") / MaximumX);
double y4 = canvas.getHeight() * (GetDoubleAttribute("Y4") / MaximumY);
SVGPath path = new SVGPath();
path.setContent(String.format("M %.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f",
x1, y1, x2, y2, x3, y3, x4, y4));
path.setFill(GetColorAttribute("Color"));
canvas.getChildren().add(path);
}
示例4: Draw
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
@Override
public void Draw(Pane canvas)
{
double x1 = canvas.getWidth() * (GetDoubleAttribute("X1") / MaximumX);
double y1 = canvas.getHeight() * (GetDoubleAttribute("Y1") / MaximumY);
double x2 = canvas.getWidth() * (GetDoubleAttribute("X2") / MaximumX);
double y2 = canvas.getHeight() * (GetDoubleAttribute("Y2") / MaximumY);
double x3 = canvas.getWidth() * (GetDoubleAttribute("X3") / MaximumX);
double y3 = canvas.getHeight() * (GetDoubleAttribute("Y3") / MaximumY);
SVGPath path = new SVGPath();
path.setContent(String.format("M %.3f,%.3f %.3f,%.3f %.3f,%.3f",
x1, y1, x2, y2, x3, y3));
path.setFill(GetColorAttribute("Color"));
canvas.getChildren().add(path);
}
示例5: Draw
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
@Override
public void Draw(Pane canvas)
{
double widthX = canvas.getWidth() * (GetDoubleAttribute("Thickness") / MaximumX) / 2;
double widthY = canvas.getHeight() * (GetDoubleAttribute("Thickness") / MaximumX) / 2;
SVGPath path1 = new SVGPath();
SVGPath path2 = new SVGPath();
path1.setContent(String.format("M %1$.3f,0 0,0 0,%2$.3f %3$.3f,%4$.3f %5$.3f,%4$.3f %5$.3f,%6$.3f %1$.3f,0",
widthX, widthY, canvas.getWidth() - widthX, canvas.getHeight(), canvas.getWidth(), canvas.getHeight() - widthY));
path2.setContent(String.format("M %1$.3f,0 %2$.3f,0 %2$.3f,%6$.3f %3$.3f,%4$.3f 0,%4$.3f 0,%5$.3f %1$.3f,0",
canvas.getWidth() - widthX, canvas.getWidth(), widthX, canvas.getHeight(), canvas.getHeight() - widthY, widthY));
path1.setFill(GetColorAttribute("Color"));
path2.setFill(GetColorAttribute("Color"));
canvas.getChildren().addAll(path1, path2);
}
示例6: createLayerNode
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
private Node createLayerNode(SvgLayerData layer) {
SVGPath pathNode = new SVGPath();
if (layer.getPath() != null) {
pathNode.setContent(layer.getPath());
}
if (layer.getFill() != null) {
try {
pathNode.setFill(Color.web(layer.getFill()));
} catch (IllegalArgumentException ignored) {
}
}
pathNode.getStyleClass().add(PATH_STYLE_CLASS);
return pathNode;
}
示例7: lines
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
private SVGPath lines(int size) {
SVGPath path = new SVGPath();
path.setFill(Color.ALICEBLUE);
path.setStroke(Color.BLUE);
path.setContent("M0," + size + "L" + size / 2 + ",0 " + size + "," + size + " " + size / 2 + "," + 2 * size / 3 + "z");
return path;
}
示例8: curve
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
private SVGPath curve(int size) {
SVGPath path = new SVGPath();
path.setFill(Color.HONEYDEW);
path.setStroke(Color.GREEN);
path.setContent("M0,0Q" + size + ",0," + size + "," + size + "L0," + size + "z");
return path;
}
示例9: arc
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
private SVGPath arc(int size) {
SVGPath path = new SVGPath();
path.setFill(Color.MISTYROSE);
path.setStroke(Color.RED);
path.setContent("M0,0A" + size / 2 + "," + size + ",0,1,0," + size + ",0z");
return path;
}
示例10: Adenine
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath Adenine() {
SVGPath svg = new SVGPath();
svg.setContent("M 5705.5762 0 L 0 17713.01 L 2287.0801 17713.01 L 3661.6816 13090.109 L 9647.168 13090.109 L 11046.254 17713.01 L 13333.334 17713.01 L 7615.5156 0 L 5705.5762 0 z M 6654.543 3114.373 L 9075.3398 11167.955 L 4245.752 11167.955 L 6654.543 3114.373 z ");
svg.setFill(AptaColors.Nucleotides.ADENINE );
svg.setStrokeWidth(0);
return svg;
}
示例11: Cytosine
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath Cytosine() {
SVGPath svg = new SVGPath();
svg.setContent("M 6962.5938 0 C 4810.8302 0 3110.093 775.19183 1860.3828 2325.5762 C 620.12771 3875.9605 0 5985.4235 0 8653.9648 L 0 12374.887 C 0 15052.825 606.0358 17176.382 1818.1074 18745.559 C 3030.3609 20305.34 4665.367 21085.23 6723.125 21085.23 C 8771.4279 21085.23 10354.703 20502.661 11472.951 19337.523 C 12600.472 18172.385 13220.6 16490.453 13333.334 14291.727 L 10725.906 14291.727 C 10584.989 16020.64 10218.513 17218.663 9626.4785 17885.799 C 9034.4435 18552.933 8066.6589 18886.5 6723.125 18886.5 C 5379.4092 18886.5 4355.1654 18332.122 3650.3965 17223.363 C 2955.0827 16114.603 2607.4258 14521.935 2607.4258 12445.359 L 2607.4258 8682.1523 C 2607.4258 6567.9911 2983.2665 4965.9272 3734.9473 3875.9609 C 4486.628 2776.596 5562.511 2226.9141 6962.5938 2226.9141 C 8174.8472 2226.9141 9076.9008 2583.9731 9668.7539 3298.0898 C 10260.789 4012.2066 10613.172 5205.5333 10725.906 6878.0703 L 13333.334 6878.0703 C 13239.328 4669.9453 12647.385 2973.9182 11557.502 1789.9883 C 10476.893 596.66322 8945.2564 0 6962.5938 0 z ");
svg.setFill(AptaColors.Nucleotides.CYTOSINE);
svg.setStrokeWidth(0);
return svg;
}
示例12: Guanine
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath Guanine() {
SVGPath svg = new SVGPath();
svg.setContent("M 6906.7773 0 C 4609.2557 0 2881.4221 720.33224 1723.2773 2160.998 C 574.4254 3592.2617 0 5748.5499 0 8629.8633 L 0 12669.387 C 28.24299 15362.401 673.27571 17448.073 1935.0996 18926.402 C 3206.2164 20395.311 4952.91 21129.766 7175.1777 21129.766 C 9679.8754 21129.766 11581.904 20371.768 12881.264 18855.775 L 13333.334 18290.797 L 13333.334 10607.246 L 6991.5059 10607.246 L 6991.5059 12810.637 L 10748.553 12810.637 L 10748.553 17556.334 L 10367.273 17909.463 C 9642.2486 18587.422 8582.9544 18926.402 7189.3906 18926.402 C 5710.9157 18926.402 4576.2764 18375.555 3785.4727 17273.859 C 2994.4867 16162.762 2598.9922 14571.442 2598.9922 12499.9 L 2598.9922 8305.0234 C 2627.2352 6186.3983 2985.0115 4646.8638 3672.3184 3686.4199 C 4359.8074 2716.5557 5442.6975 2231.625 6920.9902 2231.625 C 8154.3889 2231.625 9072.4684 2594.1464 9675.2285 3319.1895 C 10286.917 4034.8122 10644.691 5032.9179 10748.553 6313.5098 L 13333.334 6313.5098 C 13220.362 4289.0523 12608.308 2730.687 11497.174 1638.4121 C 10395.515 546.13725 8865.3831 0 6906.7773 0 z ");
svg.setStroke(AptaColors.Nucleotides.GUANINE);
svg.setFill(AptaColors.Nucleotides.GUANINE);
svg.setStrokeWidth(0);
return svg;
}
示例13: Thymine
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath Thymine() {
SVGPath svg = new SVGPath();
svg.setContent("M 0 0 L 0 2222.2227 L 5372.7207 2222.2227 L 5372.7207 20478.223 L 7946.541 20478.223 L 7946.541 2222.2227 L 13333.334 2222.2227 L 13333.334 0 L 0 0 z ");
svg.setStroke(AptaColors.Nucleotides.THYMINE);
svg.setFill(AptaColors.Nucleotides.THYMINE);
svg.setStrokeWidth(0);
return svg;
}
示例14: Uracil
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath Uracil() {
SVGPath svg = new SVGPath();
svg.setContent("M 0 0 L 0 15419.127 C 19.795796 17524.669 595.7958 19148.522 1728 20290.682 C 2860.2042 21422.905 4499.0273 21989.016 6644.4688 21989.016 C 8739.9402 21989.016 10373.67 21408.009 11545.658 20245.996 C 12718.223 19083.964 13314.115 17475.007 13333.334 15419.127 L 13333.334 0 L 10592.289 0 L 10592.289 15314.854 C 10592.289 16774.822 10279.399 17867.32 9653.6211 18592.346 C 9037.8373 19307.435 8034.7871 19664.98 6644.4688 19664.98 C 5263.9522 19664.98 4260.8051 19307.435 3635.0273 18592.346 C 3019.2436 17867.32 2711.3516 16774.822 2711.3516 15314.854 L 2711.3516 0 L 0 0 z ");
svg.setStroke(AptaColors.Nucleotides.URACIL);
svg.setFill(AptaColors.Nucleotides.URACIL);
svg.setStrokeWidth(0);
return svg;
}
示例15: N
import javafx.scene.shape.SVGPath; //导入方法依赖的package包/类
public final static SVGPath N() {
SVGPath svg = new SVGPath();
svg.setContent("M 0 0 L 0 20413.723 L 2579.9004 20413.723 L 2579.9004 4682.8105 L 10753.703 20413.723 L 13333.334 20413.723 L 13333.334 0 L 10781.648 0 L 10781.648 15801.02 L 2579.9004 0 L 0 0 z ");
svg.setStroke(AptaColors.Nucleotides.PRIMERS);
svg.setFill(AptaColors.Nucleotides.PRIMERS);
svg.setStrokeWidth(0);
return svg;
}