Package hec.map.annotations
Class Widget
java.lang.Object
hec.map.annotations.Widget
- Direct Known Subclasses:
AnnotationWidget
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal ObjectgetChildConstraint(Widget child) Returns constraint assigned to a specified child widget.final RectangleReturns a client area of the widget.final RectangleReturns a preferred bounds relatively to the location of the widget.final DimensionReturns a preferred size of the widget.booleanvoidpaintWidget(Graphics2D g, MapScale mapScale) final voidresolveBounds(Point2D location, Rectangle bounds) Sets resolved location and bounds of the widget This method is usually called from implementations ofLayoutinterface.
-
Field Details
-
preferredSize
-
preferredBounds
-
location
-
bounds
-
-
Constructor Details
-
Widget
public Widget()
-
-
Method Details
-
addChild
-
getChildren
-
getLocation
-
isVisible
public boolean isVisible() -
getBounds
-
resolveBounds
Sets resolved location and bounds of the widget This method is usually called from implementations ofLayoutinterface.- Parameters:
location- the resolved location; if null then [0,0] point is used insteadbounds- the resolved bounds; if null then the preferred bounds are used instead
-
getChildConstraint
Returns constraint assigned to a specified child widget.- Parameters:
child- the child widget- Returns:
- the constraint
-
getPreferredSize
Returns a preferred size of the widget.- Returns:
- the preferred size; if null, then no preferred size are set.
-
getPreferredBounds
Returns a preferred bounds relatively to the location of the widget. If no preferred bounds are set, then it returns a preferred bounds that are calculated from the calculateClientArea method of this widget and location and bounds of the children widgets. This calculated bounds are processed by the minimum and maximum bounds too.This method can be called after child widgets are layed out which is assured in method calls of the
Layoutinterface implementation. If preferred bounds are set (check it usingisPreferredBoundsSetmethod), you can call this method at any time.- Returns:
- the preferred bounds
-
getClientArea
Returns a client area of the widget.- Returns:
- the client area
-
paintWidget
-