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


Java Arc.setStartAngle方法代码示例

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


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

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

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

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

示例4: drawNode

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
@Override
public Node drawNode() {
    Arc arc = new Arc();
    arc.setCenterX(DEFAULT_ARC_X);
    arc.setCenterY(DEFAULT_ARC_Y);
    arc.setRadiusX(DEFAULT_ARC_RADIUS_X);
    arc.setRadiusY(DEFAULT_ARC_RADIUS_Y);
    arc.setStartAngle(DEFAULT_ARC_START_ANGLE);
    arc.setLength(DEFAULT_ARC_LENGTH);
    arc.setType(ArcType.OPEN);
    arc.setStrokeLineCap(StrokeLineCap.BUTT);

    Pane slot = new Pane();
    effect.setEffect(arc, slot);
    return slot;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:ShapePathElements2App.java

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

示例6: spinFan

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Animate fan blades */
protected void spinFan() {
	ObservableList<Node> list = paneForBlades.getChildren();
	for (int i = 0; i < list.size(); i++) {
		Arc a = (Arc)list.get(i);
		a.setStartAngle(a.getStartAngle() + startAngle);
	}
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:9,代码来源:FanPane.java

示例7: spinFan

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
/** Animate fan blades */
protected void spinFan() {
	for (int i = 0; i < list.size(); i++) {
		Arc a = (Arc)list.get(i);
		a.setStartAngle(a.getStartAngle() + startAngle);
	}
}
 
开发者ID:jsquared21,项目名称:Intro-to-Java-Programming,代码行数:8,代码来源:FanPane.java

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

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

示例10: drawTimeSections

import javafx.scene.shape.Arc; //导入方法依赖的package包/类
private void drawTimeSections() {
    if (sectionMap.isEmpty()) return;
    ZonedDateTime     time              = tile.getTime();
    DayOfWeek         day               = time.getDayOfWeek();
    boolean           isAM              = time.get(ChronoField.AMPM_OF_DAY) == 0;
    double            offset            = 90;
    double            angleStep         = 360.0 / 60.0;
    boolean           highlightSections = tile.isHighlightSections();
    for (TimeSection section : sectionMap.keySet()) {
        LocalTime   start     = section.getStart();
        LocalTime   stop      = section.getStop();
        boolean     isStartAM = start.get(ChronoField.AMPM_OF_DAY) == 0;
        boolean     isStopAM  = stop.get(ChronoField.AMPM_OF_DAY) == 0;
        boolean     draw      = isAM ? (isStartAM || isStopAM) : (!isStartAM || !isStopAM);
        if (!section.getDays().contains(day)) { draw = false; }
        if (!section.isActive()) { draw = false; }
        if (draw) {
            double sectionStartAngle = (start.getHour() % 12 * 5.0 + start.getMinute() / 12.0 + start.getSecond() / 300.0) * angleStep + 180;
            double sectionAngleExtend = ((stop.getHour() - start.getHour()) % 12 * 5.0 + (stop.getMinute() - start.getMinute()) / 12.0 + (stop.getSecond() - start.getSecond()) / 300.0) * angleStep;
            if (start.getHour() > stop.getHour()) { sectionAngleExtend = (360.0 - Math.abs(sectionAngleExtend)); }

            Arc arc = sectionMap.get(section);
            arc.setCenterX(clockSize * 0.5);
            arc.setCenterY(clockSize * 0.5);
            arc.setRadiusX(clockSize * 0.45);
            arc.setRadiusY(clockSize * 0.45);
            arc.setStartAngle(-(offset + sectionStartAngle));
            arc.setLength(-sectionAngleExtend);
            arc.setType(ArcType.OPEN);
            arc.setStrokeWidth(clockSize * 0.04);
            arc.setStrokeLineCap(StrokeLineCap.BUTT);
            arc.setFill(null);

            if (highlightSections) {
                arc.setStroke(section.contains(time.toLocalTime()) ? section.getHighlightColor() : section.getColor());
            } else {
                arc.setStroke(section.getColor());
            }
        }
    }
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:42,代码来源:TimerControlTileSkin.java

示例11: DeterminateIndicator

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

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

    intProgress = (int) Math.round(control.getProgress() * 100.0);
    degProgress = (int) (360 * control.getProgress());

    InvalidationListener progressListener = valueModel -> updateProgress();
    control.progressProperty().addListener(progressListener);

    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, /*text,*/ tick);
    updateProgress();
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:44,代码来源:StaticProgressIndicatorSkin.java


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