public class FixedEllipseShape extends VertexFixedSizeShape
Modifier and Type | Field and Description |
---|---|
static FixedEllipseShape |
DEFAULT |
Constructor and Description |
---|
FixedEllipseShape()
Creates an ellipse shape with x and y radii of 0.06 and 0.045
|
FixedEllipseShape(double radiusX,
double radiusY)
Creates an ellipse shape with the to given radii
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics gfx,
int x,
int y,
ProjectionPlane plane,
boolean filled,
DimensionD scale)
Draws the shape depending on the given values
|
double |
getHeight()
Returns the normalized height of the shape
|
double |
getWidth()
Returns the normalized width of the shape
|
Vector2D |
normalizedDockingCoordinates(Vector2D direction,
DimensionD scale)
Returns the position of where to dock an edge pointing to the given direction
|
boolean |
pick(double relX,
double relY,
DimensionD scale)
Tells whether or not, the given coordinates lay within the shape
|
addDockingVector, pick
public static final FixedEllipseShape DEFAULT
public FixedEllipseShape(double radiusX, double radiusY)
radiusX
- the x-dimensionradiusY
- the y-dimensionpublic FixedEllipseShape()
public void draw(java.awt.Graphics gfx, int x, int y, ProjectionPlane plane, boolean filled, DimensionD scale)
VertexShape
draw
in class VertexShape
gfx
- the target graphics object to draw intox
- the pixel x-coordinate of the center of the vertexy
- the pixel y-coordinate of the center of the vertexplane
- the projection datafilled
- if true, the shape will be filledscale
- the x and y scale factorspublic boolean pick(double relX, double relY, DimensionD scale)
VertexShape
pick
in class VertexShape
relX
- the normalized x-coordinate relative to the center of the vertexrelY
- the normalized y-coordinate relative to the center of the vertexscale
- the x and y scale factors for the shapepublic Vector2D normalizedDockingCoordinates(Vector2D direction, DimensionD scale)
VertexShape
normalizedDockingCoordinates
in class VertexShape
direction
- the direction from where to dockscale
- an x and y scale factorpublic double getWidth()
VertexFixedSizeShape
getWidth
in class VertexFixedSizeShape
public double getHeight()
VertexFixedSizeShape
getHeight
in class VertexFixedSizeShape