当前位置: 首页>>代码示例>>Java>>正文


Java Arc.setFill方法代码示例

本文整理汇总了Java中javafx.scene.shape.Arc.setFill方法的典型用法代码示例。如果您正苦于以下问题:Java Arc.setFill方法的具体用法?Java Arc.setFill怎么用?Java Arc.setFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Arc的用法示例。


在下文中一共展示了Arc.setFill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ArcSample

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public ArcSample() {
    super(180,90);
    // Simple red filled arc
    Arc arc1 = new Arc(45,60,45,45,40,100);
    arc1.setFill(Color.RED);
    // Blue stroked arc
    Arc arc2 = new Arc(155,60,45,45,40,100);
    arc2.setStroke(Color.DODGERBLUE);
    arc2.setFill(null);
    // Create a group to show all the arcs);
    getChildren().add(new Group(arc1,arc2));
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Arc 1 Fill", arc1.fillProperty()),
            new SimplePropertySheet.PropDesc("Arc 1 Start Angle", arc1.startAngleProperty(), 0d, 360d),
            new SimplePropertySheet.PropDesc("Arc 1 Length", arc1.lengthProperty(), 0d, 360d),
            new SimplePropertySheet.PropDesc("Arc 2 Stroke", arc2.strokeProperty()),
            new SimplePropertySheet.PropDesc("Arc 2 Stroke Width", arc2.strokeWidthProperty(), 1d, 5d),
            new SimplePropertySheet.PropDesc("Arc 2 Radius X", arc2.radiusXProperty(), 0d, 50d),
            new SimplePropertySheet.PropDesc("Arc 2 Radius Y", arc2.radiusYProperty(), 0d, 50d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:ArcSample.java

示例2: makeBody

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/**
 * Generates the body arc of the arrow.
 *
 * @param startAngle the starting angle of the arc, in radians
 * @param radius     the radius of the arc
 * @param length     the length of the arc, in the same unit as {@code radius}
 * @param xOffset    how much to offset the arc along the X-axis
 */
private static Arc makeBody(double startAngle, double radius, double length, double xOffset) {
  final double angRad = length / radius; // Isn't math nice?
  final double angle = Math.toDegrees(angRad);

  Arc arc = new Arc();
  arc.setRadiusX(radius);
  arc.setRadiusY(radius);
  arc.setCenterX(xOffset);
  arc.setCenterY(0);
  arc.setStartAngle(Math.toDegrees(startAngle));
  arc.setLength(-angle); // -angle because +y is "down", but JavaFX Arc treats +y as "up"

  arc.setFill(null);
  arc.setStroke(Color.WHITE);

  return arc;
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:26,代码来源:CurvedArrow.java

示例3: drawSections

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private void drawSections() {
    if (sections.isEmpty()) return;
    sectionLayer.getChildren().clear();

    double    centerX     = width * 0.5;
    double    centerY     = height * 0.85;
    double    barRadius   = height * 0.54210526;
    double    barWidth    = width * 0.28472222;
    List<Arc> sectionBars = new ArrayList<>(sections.size());
    for (Section section : sections) {
        Arc sectionBar = new Arc(centerX, centerY, barRadius, barRadius, angleRange * 0.5 + 90 - (section.getStart() * angleStep), -((section.getStop() - section.getStart()) - minValue) * angleStep);
        sectionBar.setType(ArcType.OPEN);
        sectionBar.setStroke(section.getColor());
        sectionBar.setStrokeWidth(barWidth);
        sectionBar.setStrokeLineCap(StrokeLineCap.BUTT);
        sectionBar.setFill(null);
        Tooltip sectionTooltip = new Tooltip(new StringBuilder(section.getText()).append("\n").append(String.format(Locale.US, "%.2f", section.getStart())).append(" - ").append(String.format(Locale.US, "%.2f", section.getStop())).toString());
        sectionTooltip.setTextAlignment(TextAlignment.CENTER);
        Tooltip.install(sectionBar, sectionTooltip);
        sectionBars.add(sectionBar);
    }
    sectionLayer.getChildren().addAll(sectionBars);
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:24,代码来源:IndicatorSkin.java

示例4: getBlades

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Add four arcs to a pane and place them in a stack pane */
private void getBlades() {
	double angle = 0;
	for (int i = 0; i < 4; i++) {
		arc = new Arc(); 
		arc.centerXProperty().bind(widthProperty().divide(2));
		arc.centerYProperty().bind(heightProperty().divide(2));
		arc.radiusXProperty().bind(circle.radiusProperty().multiply(.90));
		arc.radiusYProperty().bind(circle.radiusProperty().multiply(.90));
		arc.setStartAngle(angle + 90);
		arc.setLength(50);
		arc.setFill(Color.BLACK);
		arc.setType(ArcType.ROUND);
		paneForBlades.getChildren().add(arc);
		angle += 90;
	}
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:18,代码来源:FanPane.java

示例5: createIconContent

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public static Node createIconContent() {
    Arc arc = new Arc(57,57,45,45,40,100);
    arc.setStroke(Color.web("#b9c0c5"));
    arc.setStrokeWidth(5);
    arc.getStrokeDashArray().addAll(15d,15d);
    arc.setFill(null);
    javafx.scene.effect.InnerShadow effect = new javafx.scene.effect.InnerShadow();
    effect.setOffsetX(1);
    effect.setOffsetY(1);
    effect.setRadius(3);
    effect.setColor(Color.rgb(0,0,0,0.6));
    arc.setEffect(effect);
    return arc;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:15,代码来源:ArcSample.java

示例6: initGraphics

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private void initGraphics() {
    sectionCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionCtx    = sectionCanvas.getGraphicsContext2D();

    barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, model.getStartAngle() + 150, 300);
    barBackground.setType(ArcType.OPEN);
    barBackground.setStroke(model.getBarBackgroundColor());
    barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.125);
    barBackground.setStrokeLineCap(StrokeLineCap.BUTT);
    barBackground.setFill(null);

    bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, model.getStartAngle() + 90, 0);
    bar.setType(ArcType.OPEN);
    bar.setStroke(model.getBarColor());
    bar.setStrokeWidth(PREFERRED_WIDTH * 0.125);
    bar.setStrokeLineCap(StrokeLineCap.BUTT);
    bar.setFill(null);

    titleText = new Text(model.getTitle());
    titleText.setFill(model.getTitleColor());
    Helper.enableNode(titleText, !model.getTitle().isEmpty());

    valueText = new Text();
    valueText.setStroke(null);
    valueText.setFill(model.getValueColor());
    Helper.enableNode(valueText, model.isValueVisible());

    unitText = new Text();
    unitText.setStroke(null);
    unitText.setFill(model.getUnitColor());
    Helper.enableNode(unitText, model.isValueVisible() && !model.getUnit().isEmpty());

    pane = new Pane(barBackground, sectionCanvas, titleText, valueText, unitText, bar);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth))));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:SimpleSectionGauge,代码行数:39,代码来源:SimpleSectionGauge.java

示例7: initGraphics

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private void initGraphics(final String TEXT) {
    frame = new Rectangle(PREFERRED_WIDTH, PREFERRED_HEIGHT, frameColor.get());
    frame.setArcWidth(PREFERRED_HEIGHT);
    frame.setArcHeight(PREFERRED_HEIGHT);

    buttonArea = new Rectangle(5, 5, PREFERRED_WIDTH - 10, PREFERRED_HEIGHT - 10);
    buttonArea.setFill(buttonColor.get());
    buttonArea.setArcWidth(PREFERRED_HEIGHT);
    buttonArea.setArcHeight(PREFERRED_HEIGHT);

    text = new Text(TEXT);
    text.setFont(Fonts.robotoMedium(48));
    text.setFill(textColor.get());
    text.setMouseTransparent(true);

    progressBar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_HEIGHT * 0.5, 90, 0);
    progressBar.setType(ArcType.OPEN);
    progressBar.setFill(Color.TRANSPARENT);
    progressBar.setStroke(progressBarColor.get());

    progressPane = new Pane(progressBar);
    progressPane.setMouseTransparent(true);

    icon = new FontIcon(FontAwesome.CHECK);
    icon.setTextOrigin(VPos.CENTER);
    icon.setIconColor(iconColor.get());
    icon.setOpacity(0);

    iconPane = new StackPane(icon);
    iconPane.setMouseTransparent(true);

    pane = new StackPane(frame, buttonArea, text, progressPane, iconPane);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:submitbutton,代码行数:38,代码来源:SubmitButton.java

示例8: JFXSpinnerSkin

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public JFXSpinnerSkin(JFXSpinner control) {
    super(control, new BehaviorBase<JFXSpinner>(control, Collections.emptyList()));

    this.control = control;

    blueColor = Color.valueOf("#4285f4");
    redColor = Color.valueOf("#db4437");
    yellowColor = Color.valueOf("#f4b400");
    greenColor = Color.valueOf("#0F9D58");

    arc = new Arc();
    arc.setManaged(false);
    arc.setStartAngle(0);
    arc.setLength(180);
    arc.getStyleClass().setAll("arc");
    arc.setFill(Color.TRANSPARENT);
    arc.setStrokeWidth(3);

    fillRect = new Rectangle();
    fillRect.setFill(Color.TRANSPARENT);
    text = new Text();
    text.getStyleClass().setAll("text", "percentage");
    final Group group = new Group(fillRect, arc, text);
    group.setManaged(false);
    arcPane = new StackPane(group);
    arcPane.setPrefSize(50, 50);
    getChildren().setAll(arcPane);

    // register listeners
    registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
    registerChangeListener(control.progressProperty(), "PROGRESS");
    registerChangeListener(control.visibleProperty(), "VISIBLE");
    registerChangeListener(control.parentProperty(), "PARENT");
    registerChangeListener(control.sceneProperty(), "SCENE");
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:36,代码来源:JFXSpinnerSkin.java

示例9: createGaugeBlend

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private Node createGaugeBlend() {
	Group group = new Group();

	float arcBlendDegrees = 130 + (1 - (float) this.gaugeBar.value / this.gaugeBar.maxValue) * 230;
	Arc arcBlend = new Arc(this.size, this.size, this.size, this.size, -90, arcBlendDegrees);
	arcBlend.setType(ArcType.ROUND);
	arcBlend.setFill(Color.BLACK);

	Circle circleBlend = new Circle(this.size, this.size + 3 * GAUGE_MAX_SIZE / 2, this.size - 2 * GAUGE_MAX_SIZE);
	circleBlend.setFill(Color.BLACK);

	group.getChildren().setAll(arcBlend, circleBlend);
	return group;
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:15,代码来源:GaugeBarModernSkin.java

示例10: createGaugeBlend

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private Node createGaugeBlend() {
	Group group = new Group();

	float arcBlendDegrees = (1.0f - (float) this.gaugeBar.value / this.gaugeBar.maxValue) * 360;
	Arc arcBlend = new Arc(this.size, this.size, this.size, this.size, -90, arcBlendDegrees);
	arcBlend.setType(ArcType.ROUND);
	arcBlend.setFill(Color.BLACK);

	Circle circleBlend = new Circle(this.size, this.size, this.size - 2 * GAUGE_MAX_SIZE);
	circleBlend.setFill(Color.BLACK);

	group.getChildren().setAll(arcBlend, circleBlend);
	return group;
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:15,代码来源:GaugeBarHollowDiscSkin.java

示例11: createGaugeBlend

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private Node createGaugeBlend() {
	Group group = new Group();

	float arcBlendDegrees = (1.0f - (float) this.gaugeBar.value / this.gaugeBar.maxValue) * 360;
	Arc arcBlend = new Arc(this.size, this.size, this.size, this.size, -90, arcBlendDegrees);
	arcBlend.setType(ArcType.ROUND);
	arcBlend.setFill(Color.BLACK);
	arcBlend.setRotate((tics += 5 % 360));

	Circle circleBlend = new Circle(this.size, this.size, this.size - 2 * GAUGE_MAX_SIZE);
	circleBlend.setFill(Color.BLACK);

	group.getChildren().setAll(arcBlend, circleBlend);
	return group;
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:16,代码来源:GaugeBarSnakeSkin.java

示例12: getBlades

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Add four arcs to a pane and place them in a stack pane */
private Pane getBlades() {
	Pane pane = new Pane();
	double angle = 0;
	for (int i = 0; i < 4; i++) {
		Arc arc = new Arc(125, 115, 90, 90, angle + 90, 50);
		arc.setFill(Color.BLACK);
		arc.setType(ArcType.ROUND);
		pane.getChildren().add(arc);
		angle += 90;
	}
	return pane;
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:14,代码来源:FanPane.java

示例13: getArcs

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Add four arcs to a pane and place them in a stack pane */
private void getArcs(StackPane stackPane) {
	double angle = 30; // Start angle
	for (int i = 0; i < 4; i++) {
		Pane pane = new Pane();
		Arc arc = new Arc(100, 100, 80, 80, angle + 90, 35);
		arc.setFill(Color.BLACK);
		arc.setType(ArcType.ROUND);
		pane.getChildren().add(arc);
		stackPane.getChildren().add(pane);
		angle += 90;
	}
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:14,代码来源:Exercise_14_09.java

示例14: getArc

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Return a Arc of specified properties */
private Arc getArc(Circle c) {
	Arc a = new Arc(c.getRadius(), c.getRadius() * 1.30, 
		c.getRadius() / 2, c.getRadius() / 4, 0, -180);
	a.setType(ArcType.OPEN);
	a.setFill(Color.WHITE);
	a.setStroke(Color.BLACK);
	return a;
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:10,代码来源:Exercise_14_11.java

示例15: createArc

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/**
 * Kreisausschnitt für Symbol.
 *
 * @param radius
 *            Radius des Kreisausschnitts.
 * @param centerX
 *            x-Koordinate des Kreismittelpunkts.
 * @param centerY
 *            y-Koordinate des Kreismittelpunkts.
 * @return Kreisausschnitt als 2D Objekt
 */
private Arc createArc(final double radius, final double centerX, final double centerY) {
	final Arc arc = new Arc();
	arc.setCenterX(centerX);
	arc.setCenterY(centerY);
	arc.setRadiusX(radius);
	arc.setRadiusY(radius);
	arc.setStartAngle(START_ANGLE);
	arc.setLength(ARC_LENGTH);
	arc.setType(ArcType.OPEN);
	arc.setStrokeWidth(STROKE_WIDTH);
	arc.setStroke(Color.web(COLOR));
	arc.setFill(Color.TRANSPARENT);
	return arc;
}
 
开发者ID:Silent-Fred,项目名称:iTrySQL,代码行数:26,代码来源:DropTargetSymbol.java


注:本文中的javafx.scene.shape.Arc.setFill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。