Java Reference
In-Depth Information
The getter and setter methods for property values
and a getter for property itself are provided in the class,
but omitted in the UML diagram for brevity.
javafx.scene.shape.Circle
-centerX: DoubleProperty
-centerY: DoubleProperty
-radius: DoubleProperty
The x-coordinate of the center of the circle (default 0 ).
The y-coordinate of the center of the circle (default 0 ).
The radius of the circle (default: 0 ).
+Circle()
+Circle(x: double, y: double)
+Circle(x: double, y: double,
radius: double)
Creates an empty Circle .
Creates a Circle with the specified center.
Creates a Circle with the specified center and radius.
F IGURE 14.32
The Circle class defines circles.
The getter and setter methods for property values
and a getter for property itself are provided in the class,
but omitted in the UML diagram for brevity.
javafx.scene.shape.Ellipse
-centerX: DoubleProperty
-centerY: DoubleProperty
-radiusX: DoubleProperty
-radiusY: DoubleProperty
The x-coordinate of the center of the ellipse (default 0 ).
The y-coordinate of the center of the ellipse (default 0 ).
The horizontal radius of the ellipse (default: 0 ).
The vertical radius of the ellipse (default: 0 ).
+Ellipse()
+Ellipse(x: double, y: double)
+Ellipse(x: double, y: double,
radiusX: double, radiusY:
double)
Creates an empty Ellipse .
Creates an Ellipse with the specified center.
Creates an Ellipse with the specified center and radiuses.
F IGURE 14.33
The Ellipse class defines ellipses.
radiusX
radiusY
(centerX, centerY)
(a) Ellipse(centerX, centerY,
radiusX, radiusY)
(b) Multiple ellipses are displayed.
F IGURE 14.34
An Ellipse object is created to display an ellipse.
L ISTING 14.17
ShowEllipse.java
1 import javafx.application.Application;
2 import javafx.scene.Scene;
3 import javafx.scene.layout.Pane;
4 import javafx.scene.paint.Color;
5 import javafx.stage.Stage;
6 import javafx.scene.shape.Ellipse;
7
8 public class ShowEllipse extends Application {
9 @Override // Override the start method in the Application class
 
 
Search WWH ::




Custom Search