Package noaa.coastwatch.render
Class PictureElement
java.lang.Object
noaa.coastwatch.render.AnnotationElement
noaa.coastwatch.render.PictureElement
- Direct Known Subclasses:
EarthContextElement
,IconElement
A picture element is an annotation element the renders graphics and
shapes. The element specifies various picture properties such as
the position and size.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PictureElement
(Point2D position, Dimension size) Creates a new picture element with the specified properties. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setPosition
(Point2D position) Sets the picture position.void
setPreferredSize
(Dimension size) Sets the preferred size of the picture.Methods inherited from class noaa.coastwatch.render.AnnotationElement
getArea, getBounds, render
-
Field Details
-
position
The top-left corner position. -
preferred
The preferred dimensions.
-
-
Constructor Details
-
PictureElement
Creates a new picture element with the specified properties. The actual picture size may be different than the preferred size. The picture aspect ratio is kept the same, so that the actual picture fits into the preferred size rectangle.- Parameters:
position
- the top-left corner position of the picture.size
- the preferred picture size, or null if the picture size should be determined by the element.
-
-
Method Details
-
setPosition
Sets the picture position.- Parameters:
position
- the top-left corner position of the picture.
-
setPreferredSize
Sets the preferred size of the picture. The actual picture size may be different than the preferred size. The picture aspect ratio is kept the same, so that the actual picture fits into the preferred size rectangle.- Parameters:
size
- the preferred picture size, or null if the picture size should be determined by the element.
-