本文整理了Java中javafx.scene.shape.Line.setStroke()
方法的一些代码示例,展示了Line.setStroke()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Line.setStroke()
方法的具体详情如下:
包路径:javafx.scene.shape.Line
类名称:Line
方法名:setStroke
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
protected void handleControlPropertyChanged(String p) {
if ("TOGGLE_COLOR".equals(p)) {
if (getSkinnable().isSelected()) {
circle.setFill(((JFXToggleButton) getSkinnable()).getToggleColor());
}
} else if ("UNTOGGLE_COLOR".equals(p)) {
if (!getSkinnable().isSelected()) {
circle.setFill(((JFXToggleButton) getSkinnable()).getUnToggleColor());
}
} else if ("TOGGLE_LINE_COLOR".equals(p)) {
if (getSkinnable().isSelected()) {
line.setStroke(((JFXToggleButton) getSkinnable()).getToggleLineColor());
}
} else if ("UNTOGGLE_LINE_COLOR".equals(p)) {
if (!getSkinnable().isSelected()) {
line.setStroke(((JFXToggleButton) getSkinnable()).getUnToggleLineColor());
}
} else {
super.handleControlPropertyChanged(p);
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
rightLine.setStroke(control.getCheckedColor());
rightLine.setStrokeWidth(lineThick);
leftLine.setStroke(control.getCheckedColor());
leftLine.setStrokeWidth(lineThick);
rightLine.setVisible(false);
代码示例来源:origin: jfoenixadmin/JFoenix
line.setStroke(getSkinnable().isSelected() ? toggleButton.getToggleLineColor() : toggleButton.getUnToggleLineColor());
line.setStartX(0);
line.setStartY(0);
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
public CapacitorSymbol(Color stroke, double strokeWidth, double size) {
setPrefSize(size, size);
l1 = new Line();
l1.setStroke(stroke);
l1.setStrokeWidth(strokeWidth);
l2 = new Line();
l2.setStroke(stroke);
l2.setStrokeWidth(strokeWidth);
l3 = new Line();
l3.setStroke(stroke);
l3.setStrokeWidth(strokeWidth);
l4 = new Line();
l4.setStroke(stroke);
l4.setStrokeWidth(strokeWidth);
getChildren().addAll(l1, l2, l3, l4);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
l.setStrokeWidth(7);
l.setStrokeLineCap(StrokeLineCap.ROUND);
l.setStroke(Color.WHITE);
getChildren().add(l);
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
public ResistanceSymbol(Color stroke, double strokeWidth, double size, int peaks) {
this.peaks = peaks;
setPrefSize(size, size);
l1 = new Line();
l1.setStroke(stroke);
l1.setStrokeWidth(strokeWidth);
l2 = new Line();
l2.setStroke(stroke);
l2.setStrokeWidth(strokeWidth);
getChildren().addAll(l1, l2);
peakLine1 = new Line[peaks];
peakLine2 = new Line[peaks];
peakLine3 = new Line[peaks];
for (int i = 0; i < peaks; i++) {
peakLine1[i] = new Line();
peakLine1[i].setStroke(stroke);
peakLine1[i].setStrokeWidth(strokeWidth);
peakLine2[i] = new Line();
peakLine2[i].setStroke(stroke);
peakLine2[i].setStrokeWidth(strokeWidth);
peakLine3[i] = new Line();
peakLine3[i].setStroke(stroke);
peakLine3[i].setStrokeWidth(strokeWidth);
getChildren().addAll(peakLine1[i], peakLine2[i], peakLine3[i]);
}
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
l.setStrokeWidth(7);
l.setStrokeLineCap(StrokeLineCap.ROUND);
l.setStroke(Color.WHITE);
getChildren().add(l);
代码示例来源:origin: com.bitplan.radolan/com.bitplan.radolan
/**
* draw a cross on the given pane with the given stroke width and color
*
* @param pane
* @param strokeWidth
* @param color
*/
public static void drawCross(Pane pane, double strokeWidth, Color color) {
double w = pane.getWidth();
double h = pane.getHeight();
Line line = new Line(0, 0, w, h);
line.setStrokeWidth(strokeWidth);
line.setStroke(color);
Line line2 = new Line(w, 0, 0, h);
line2.setStrokeWidth(strokeWidth);
line2.setStroke(color);
pane.getChildren().addAll(line, line2);
}
代码示例来源:origin: com.jfoenix/jfoenix
line.setStroke(getSkinnable().isSelected() ? toggleButton.getToggleLineColor() : toggleButton.getUnToggleLineColor());
line.setStartX(0);
line.setStartY(0);
registerChangeListener(toggleButton.toggleLineColorProperty(), observableValue -> {
if (getSkinnable().isSelected()) {
line.setStroke(((JFXToggleButton) getSkinnable()).getToggleLineColor());
line.setStroke(((JFXToggleButton) getSkinnable()).getUnToggleLineColor());
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
public GroundSymbol(Color stroke, double strokeWidth, double size) {
setPrefSize(size, size);
for (int i = 0; i < lines.length; i++) {
lines[i] = new Line();
lines[i].setStroke(stroke);
lines[i].setStrokeWidth(strokeWidth);
}
getChildren().addAll(lines);
}
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
public InductorSymbol(Color stroke, double strokeWidth, double size, int spirals) {
this.spirals = spirals;
setPrefSize(size, size);
l1 = new Line();
l1.setStroke(stroke);
l1.setStrokeWidth(strokeWidth);
a = new Arc[spirals];
for (int i = 0; i < spirals; i++) {
a[i] = createArc(stroke, strokeWidth);
}
l2 = new Line();
l2.setStroke(stroke);
l2.setStrokeWidth(strokeWidth);
getChildren().addAll(l1, l2);
getChildren().addAll(Arrays.asList(a));
}
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
public SwitchSymbol(Color stroke, double strokeWidth, double size) {
setPrefSize(size, size);
leg1 = new Line();
leg1.setFill(stroke);
leg1.setStroke(stroke);
leg1.setStrokeWidth(strokeWidth);
leg2 = new Line();
leg2.setFill(stroke);
leg2.setStroke(stroke);
leg2.setStrokeWidth(strokeWidth);
box = new Rectangle();
box.setFill(Color.TRANSPARENT);
box.setStroke(stroke);
box.setStrokeWidth(strokeWidth);
getChildren().addAll(leg1, leg2, box);
}
代码示例来源:origin: com.powsybl/powsybl-gse-network-explorer
wire1.setStroke(stroke);
wire1.setStrokeWidth(2);
wire2.setStroke(stroke);
wire2.setStrokeWidth(2);
wire3.setStroke(stroke);
wire3.setStrokeWidth(2);
wire4.setStroke(stroke);
wire4.setStrokeWidth(2);
wire5.setStroke(stroke);
wire5.setStrokeWidth(2);
wire6.setStroke(stroke);
wire6.setStrokeWidth(2);
wire7.setStroke(stroke);
wire7.setStrokeWidth(2);
wire8.setStroke(stroke);
wire8.setStrokeWidth(2);
wire9.setStroke(stroke);
wire9.setStrokeWidth(2);
代码示例来源:origin: com.jfoenix/jfoenix
rightLine.setStroke(control.getCheckedColor());
rightLine.setStrokeWidth(lineThick);
leftLine.setStroke(control.getCheckedColor());
leftLine.setStrokeWidth(lineThick);
rightLine.setVisible(false);
内容来源于网络,如有侵权,请联系作者删除!