public class AutosizeRectShape extends VertexAutosizeShape
| Modifier and Type | Field and Description |
|---|---|
static AutosizeRectShape |
DEFAULT |
| Constructor and Description |
|---|
AutosizeRectShape()
Creates an instance with a border of 0.02
|
AutosizeRectShape(double border)
Creates an instance with the given border
|
| 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
|
void |
getAutosizeScale(double innerWidth,
double innerHeight,
DimensionD outScale)
Calculates the scale of the shape depending on an inner bounding box
|
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
|
isAutoSize, setAutoSizeaddDockingVector, pickpublic static final AutosizeRectShape DEFAULT
public AutosizeRectShape(double border)
border - the (non-visualized) border to envelop additionallypublic AutosizeRectShape()
public void draw(java.awt.Graphics gfx,
int x,
int y,
ProjectionPlane plane,
boolean filled,
DimensionD scale)
VertexShapedraw in class VertexShapegfx - 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)
VertexShapepick in class VertexShaperelX - 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)
VertexShapenormalizedDockingCoordinates in class VertexShapedirection - the direction from where to dockscale - an x and y scale factorpublic void getAutosizeScale(double innerWidth,
double innerHeight,
DimensionD outScale)
VertexAutosizeShapegetAutosizeScale in class VertexAutosizeShapeinnerWidth - the normalized width of the inner bounding boxinnerHeight - the normalized height of the inner bounding boxoutScale - the target to write the scale into