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


Java Arc.setType方法代码示例

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


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

示例1: 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

示例2: onChange

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private void onChange(SetChangeListener.Change<? extends String> change) {
	slices.getChildren().clear();
	if (styles.isEmpty()) {
		return;
	}

	int start = 0;
	int delta = FULLCIRCLE / styles.size();
	for (String style : styles) {
		Arc arc = new Arc(0, 0, radius, radius, start, delta);
		arc.setType(ArcType.ROUND);
		arc.getStyleClass().add(style);
		slices.getChildren().add(arc);

		start += delta;
	}
}
 
开发者ID:ProgrammingLife2015,项目名称:dnainator,代码行数:19,代码来源:Pie.java

示例3: 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

示例4: initItems

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private void initItems() {
	Arc arc = new Arc();
	arc.setRadiusX(5.0f);
	arc.setRadiusY(5.0f);
	arc.setStartAngle(45.0f);
	arc.setLength(270.0f);
	arc.setVisible(false);
	arc.setId("Cup");
	arc.setType(ArcType.ROUND);

	List<Node> itemsList = new ArrayList<Node>();
	itemsList.add(arc);
	
	List<GameObject> objectsList = new ArrayList<GameObject>();
	

	GameObject item = new Cup();
	item.setNode(arc);
	item.setPosition(new Point2D(200, 200));
	objectsList.add(item);
	getGameObjectManager().addObjects(objectsList);
	root.getChildren().addAll(itemsList);
}
 
开发者ID:kpetkova,项目名称:teamearth,代码行数:24,代码来源:GameWorldInitializer.java

示例5: ArcNode

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private ArcNode(Arc arc) {
    super(arc);
    this.arc = arc;
    arc.setType(ArcType.ROUND);
    centerX = PropertyTimelineHolder.empty();
    centerY = PropertyTimelineHolder.empty();
    radiusX = PropertyTimelineHolder.empty();
    radiusY = PropertyTimelineHolder.empty();
    startAngle = PropertyTimelineHolder.empty();
    length = PropertyTimelineHolder.empty();
    type = PropertyTimelineHolder.empty();
}
 
开发者ID:aNNiMON,项目名称:HotaruFX,代码行数:13,代码来源:ArcNode.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: drawNode

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
@Override
public Node drawNode() {
    Arc arc = new Arc(DEFAULT_ARC_X, DEFAULT_ARC_Y, DEFAULT_ARC_RADIUS_X,
            DEFAULT_ARC_RADIUS_X, DEFAULT_ARC_START_ANGLE, DEFAULT_ARC_LENGTH);
    arc.setType(ArcType.OPEN);
    arc.setStrokeLineCap(StrokeLineCap.SQUARE);
    Pane slot = new Pane();
    effect.setEffect(arc, slot);
    return slot;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:ShapePathElements2App.java

示例8: 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

示例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: DeterminateIndicator

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public DeterminateIndicator(ProgressIndicator control, Paint fillOverride) {

            getStyleClass().add("determinate-indicator");

            degProgress = (int) (360 * control.getProgress());

            getChildren().clear();

            // The circular background for the progress pie piece
            indicator = new StackPane();
            indicator.setScaleShape(false);
            indicator.setCenterShape(false);
            indicator.getStyleClass().setAll("indicator");
            indicatorCircle = new Circle();
            indicator.setShape(indicatorCircle);

            // The shape for our progress pie piece
            arcShape = new Arc();
            arcShape.setType(ArcType.ROUND);
            arcShape.setStartAngle(90.0F);

            // Our progress pie piece
            progress = new StackPane();
            progress.getStyleClass().setAll("progress");
            progress.setScaleShape(false);
            progress.setCenterShape(false);
            progress.setShape(arcShape);
            progress.getChildren().clear();
            setFillOverride(fillOverride);

            // The check mark that's drawn at 100%
            tick = new StackPane();
            tick.getStyleClass().setAll("tick");

            getChildren().setAll(indicator, progress, tick);
            updateProgress(control.getProgress());
        }
 
开发者ID:fflewddur,项目名称:archivo,代码行数:38,代码来源:TaskProgressIndicatorSkin.java


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