Package noaa.coastwatch.render
Class IconElement
java.lang.Object
noaa.coastwatch.render.AnnotationElement
noaa.coastwatch.render.PictureElement
noaa.coastwatch.render.IconElement
An icon element is a picture element that is rendered from image
data. Generally, icons should be small and easily rendered.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from class noaa.coastwatch.render.PictureElement
position, preferred
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IconElement
create
(InputStream stream) Creates a new icon element from the specified image stream.Gets the element bounding area.void
render
(Graphics2D g, Color foreground, Color background) Renders the element graphics.void
setShadow
(boolean flag) Sets the drop shadow flag.Methods inherited from class noaa.coastwatch.render.PictureElement
setPosition, setPreferredSize
Methods inherited from class noaa.coastwatch.render.AnnotationElement
getBounds
-
Constructor Details
-
IconElement
protected IconElement()
-
-
Method Details
-
setShadow
public void setShadow(boolean flag) Sets the drop shadow flag.- Parameters:
flag
- the drop shadow flag, true to draw a drop shadow or false to not. By default the drop shadow is not drawn.- Since:
- 3.7.1
-
create
Creates a new icon element from the specified image stream. The position and preferred size are initialized to (0,0) and null.- Parameters:
stream
- the icon image input stream.- Returns:
- the new icon element.
- Throws:
IOException
- if an error occurred reading the icon image.- Since:
- 3.7.1
-
render
Description copied from class:AnnotationElement
Renders the element graphics.- Specified by:
render
in classAnnotationElement
- Parameters:
g
- the graphics object for drawing.foreground
- the foreground element color.background
- the background element color or null for no background.
-
getArea
Description copied from class:AnnotationElement
Gets the element bounding area.- Specified by:
getArea
in classAnnotationElement
- Parameters:
g
- the graphics object for drawing.
-