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 TypeMethodDescriptionvoid
final Object
getChildConstraint
(Widget child) Returns constraint assigned to a specified child widget.final Rectangle
Returns a client area of the widget.final Rectangle
Returns a preferred bounds relatively to the location of the widget.final Dimension
Returns a preferred size of the widget.boolean
void
paintWidget
(Graphics2D g, MapScale mapScale) final void
resolveBounds
(Point2D location, Rectangle bounds) Sets resolved location and bounds of the widget This method is usually called from implementations ofLayout
interface.
-
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 ofLayout
interface.- 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
Layout
interface implementation. If preferred bounds are set (check it usingisPreferredBoundsSet
method), 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
-