Java Code Examples for javafx.scene.shape.Arc#setStartAngle()
The following examples show how to use
javafx.scene.shape.Arc#setStartAngle() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DotArrowShapeDecorations.java From gef with Eclipse Public License 2.0 | 6 votes |
private static void setSide(Arc arc, String side) { // setting the side of an arc based shape to left/right if (arc instanceof Curve && side.equals("l")) {//$NON-NLS-1$ arc.setStartAngle(180); arc.setLength(90); } if (arc instanceof ICurve && side.equals("l")) {//$NON-NLS-1$ arc.setStartAngle(0); arc.setLength(-90); } if (arc instanceof Curve && side.equals("r")) {//$NON-NLS-1$ arc.setLength(90); } if (arc instanceof ICurve && side.equals("r")) {//$NON-NLS-1$ arc.setLength(-90); } }
Example 2
Source File: StateTransitionEdgeViewer.java From JetUML with GNU General Public License v3.0 | 6 votes |
private Shape getSelfEdgeShape(Edge pEdge) { Line line = getSelfEdgeConnectionPoints(pEdge); Arc arc = new Arc(); arc.setRadiusX(SELF_EDGE_OFFSET*2); arc.setRadiusY(SELF_EDGE_OFFSET*2); arc.setLength(DEGREES_270); arc.setType(ArcType.OPEN); if( getPosition(pEdge) == 1 ) { arc.setCenterX(line.getX1()); arc.setCenterY(line.getY1()-SELF_EDGE_OFFSET); arc.setStartAngle(DEGREES_270); } else { arc.setCenterX(line.getX1()-SELF_EDGE_OFFSET); arc.setCenterY(line.getY1()-SELF_EDGE_OFFSET*2); arc.setStartAngle(1); } return arc; }
Example 3
Source File: FanPane.java From Intro-to-Java-Programming with MIT License | 6 votes |
/** 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; } }
Example 4
Source File: FanPane.java From Intro-to-Java-Programming with MIT License | 6 votes |
/** 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; } }
Example 5
Source File: CenterArc.java From CrazyAlpha with GNU General Public License v2.0 | 5 votes |
@Override public void update() { if (status != ObjectStatus.ANIMATION) return; for (int i = 0; i < shapes.size(); i++) { Arc arc = (Arc) shapes.get(i); arc.setStartAngle(arc.getStartAngle() + 8); } }
Example 6
Source File: FanPane.java From Intro-to-Java-Programming with MIT License | 5 votes |
/** 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); } }
Example 7
Source File: FanPane.java From Intro-to-Java-Programming with MIT License | 5 votes |
/** 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); } }
Example 8
Source File: TaskProgressIndicatorSkin.java From archivo with GNU General Public License v3.0 | 5 votes |
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()); }
Example 9
Source File: TimerControlTileSkin.java From OEE-Designer with MIT License | 4 votes |
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()); } } } }
Example 10
Source File: TimerControlTileSkin.java From tilesfx with Apache License 2.0 | 4 votes |
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()); } } } }
Example 11
Source File: StaticProgressIndicatorSkin.java From bisq with GNU Affero General Public License v3.0 | 4 votes |
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(); }
Example 12
Source File: JFXSpinnerSkin.java From JFoenix with Apache License 2.0 | 3 votes |
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); track = new Arc(); track.setManaged(false); track.setStartAngle(0); track.setLength(360); track.setStrokeWidth(3); track.getStyleClass().setAll("track"); track.setFill(Color.TRANSPARENT); fillRect = new Rectangle(); fillRect.setFill(Color.TRANSPARENT); text = new Text(); text.getStyleClass().setAll("text", "percentage"); final Group group = new Group(fillRect, track, 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"); }