Interface BalloonAttributes
-
- All Superinterfaces:
Exportable,ShapeAttributes
- All Known Implementing Classes:
BasicBalloonAttributes
public interface BalloonAttributes extends ShapeAttributes
Holds attributes for WorldWindBalloonshapes. Changes made to the attributes are applied to the balloon when theWorldWindowrenders the next frame. Instances ofBalloonAttributesmay be shared by many balloons, thereby reducing the memory normally required to store attributes for each balloon.- See Also:
Balloon
-
-
Field Summary
-
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetBalloonShape()Indicates the shape of the balloon's frame.intgetCornerRadius()Indicates the radius of each rounded corner on the balloon's rectangular frame, in pixels.java.awt.FontgetFont()Indicates the font used to display the balloon's text.java.awt.PointgetImageOffset()Indicates the location of the balloon's texture (in pixels) relative to the balloon's upper left corner.doublegetImageOpacity()Indicates the opacity of the balloon's texture as a floating-point value in the range 0.0 to 1.0.java.lang.StringgetImageRepeat()Indicates the balloon texture's horizontal and vertical repeat mode.java.awt.InsetsgetInsets()Indicates the amount of space between the balloon's content and its frame, in pixels.java.lang.StringgetLeaderShape()Indicates the shape of the balloon's leader.intgetLeaderWidth()Indicates the width of the balloon's leader, in pixels.SizegetMaximumSize()Indicates the maximum width and height of the balloon's shape in the viewport.OffsetgetOffset()Indicates the location relative to the balloon's screen reference point at which the balloon's frame shape is aligned.SizegetSize()Indicates the width and height of the balloon's shape in the viewport.java.awt.ColorgetTextColor()Indicates the color used to display the balloon's text.voidsetBalloonShape(java.lang.String shape)Specifies the shape of the balloon's frame.voidsetCornerRadius(int radius)Specifies the radius of the rounded corner's on the balloon's rectangular frame in pixels.voidsetFont(java.awt.Font font)Specifies the font in which to display the balloon's text.voidsetImageOffset(java.awt.Point offset)Specifies the location of the balloon's texture (in pixels) relative to the balloon's upper left corner.voidsetImageOpacity(double opacity)Specifies the opacity of the balloon's texture as a floating-point value in the range 0.0 to 1.0.voidsetImageRepeat(java.lang.String repeat)Specifies the balloon texture's horizontal and vertical repeat mode.voidsetInsets(java.awt.Insets insets)Specifies the amount of space (in pixels) between the balloon's content and the edges of the balloon's frame.voidsetLeaderShape(java.lang.String shape)Specifies the shape of the balloon's leader.voidsetLeaderWidth(int width)Specifies the width of the balloon's leader, in pixels.voidsetMaximumSize(Size size)Specifies the maximum width and height of the balloon's shape in the viewport.voidsetOffset(Offset offset)Specifies a location relative to the balloon's screen reference point at which to align the balloon's frame shape.voidsetSize(Size size)Specifies the width and height of the balloon's shape in the viewport.voidsetTextColor(java.awt.Color color)Specifies the color in which to display the balloon's text.-
Methods inherited from interface gov.nasa.worldwind.Exportable
export, isExportFormatSupported
-
Methods inherited from interface gov.nasa.worldwind.render.ShapeAttributes
copy, copy, getImageScale, getImageSource, getInteriorMaterial, getInteriorOpacity, getOutlineMaterial, getOutlineOpacity, getOutlineStippleFactor, getOutlineStipplePattern, getOutlineWidth, getRestorableState, isDrawInterior, isDrawOutline, isEnableAntialiasing, isEnableLighting, isUnresolved, restoreState, setDrawInterior, setDrawOutline, setEnableAntialiasing, setEnableLighting, setImageScale, setImageSource, setInteriorMaterial, setInteriorOpacity, setOutlineMaterial, setOutlineOpacity, setOutlineStippleFactor, setOutlineStipplePattern, setOutlineWidth, setUnresolved
-
-
-
-
Method Detail
-
getSize
Size getSize()
Indicates the width and height of the balloon's shape in the viewport. If the balloon's shape isAVKey.SHAPE_RECTANGLE, then the returnedSizeindicates the rectangle's width and height. If the balloon's shape isAVKey.SHAPE_ELLIPSE, then the returnedSizeindicates the ellipse's x- and y-radii.- Returns:
- the width and height of the balloon's shape in the viewport
-
setSize
void setSize(Size size)
Specifies the width and height of the balloon's shape in the viewport. If the balloon's shape isAVKey.SHAPE_RECTANGLE, thensizespecifies the rectangle's width and height. If the balloon's shape isAVKey.SHAPE_ELLIPSE, thensizespecifies the ellipse's x- and y-radii.The balloon's content area is the rectangle obtained by taking the balloon's
sizeand shrinking it by the balloon's insets.- Parameters:
size- the desired width and height of the balloon's shape in the viewport.- Throws:
java.lang.IllegalArgumentException- ifsizeisnull.- See Also:
getSize(),getMaximumSize(),setInsets(java.awt.Insets)
-
getMaximumSize
Size getMaximumSize()
Indicates the maximum width and height of the balloon's shape in the viewport. If the balloon's shape isAVKey.SHAPE_RECTANGLE, then the returnedSizeindicates the rectangle's maximum width and height. If the balloon's shape isAVKey.SHAPE_ELLIPSE, then the returnedSizeindicates the ellipse's maximum x- and y-radii. This returnsnullif the balloon has no maximum size.- Returns:
- the maximum width and height of the balloon's shape in the viewport, or
nullif the balloon has no maximum size.
-
setMaximumSize
void setMaximumSize(Size size)
Specifies the maximum width and height of the balloon's shape in the viewport. If the balloon's shape isAVKey.SHAPE_RECTANGLE, thensizespecifies the rectangle's maximum width and height. If the balloon's shape isAVKey.SHAPE_ELLIPSE, thensizespecifies the ellipse's maximum x- and y-radii. Specifying anullsize causes the balloon to have no maximum size.- Parameters:
size- the desired maximum width and height of the balloon's shape in the viewport, ornullif the balloon should have no maximum size.
-
getOffset
Offset getOffset()
Indicates the location relative to the balloon's screen reference point at which the balloon's frame shape is aligned. The balloon's lower left corner begins at the returnedoffset.- Returns:
- the location at which the balloon's lower left corner is aligned.
- See Also:
setOffset(Offset)
-
setOffset
void setOffset(Offset offset)
Specifies a location relative to the balloon's screen reference point at which to align the balloon's frame shape. The balloon's frame shape begins at the point indicated by theoffset. Anoffsetof (0, 0) pixels causes the balloon's lower left corner to be placed at the screen reference point. Anoffsetof (1, 1) in fraction units causes the balloon's upper right corner to be placed at the screen reference point.If the balloon is attached to the globe, the screen reference point is the projection of its geographic position into the viewport. If the balloon is attached to the screen, the screen reference point is the balloon's screen point.
If the balloon has a leader shape, the leader extends from one side of the balloon's frame and points to the screen reference point.
- Parameters:
offset- a location at which to align the balloon's lower left corner.- Throws:
java.lang.IllegalArgumentException- ifoffsetisnull.- See Also:
getOffset()
-
getInsets
java.awt.Insets getInsets()
Indicates the amount of space between the balloon's content and its frame, in pixels. The balloon's content area decreases to account for the returned space.- Returns:
- the padding between the balloon's content and its frame, in pixels.
- See Also:
setInsets(java.awt.Insets)
-
setInsets
void setInsets(java.awt.Insets insets)
Specifies the amount of space (in pixels) between the balloon's content and the edges of the balloon's frame. The balloon's content area decreases to account for the specifiedinsets. If the balloon's size and insets cause the content width or height to become less than 1, then the balloon's content is not displayed.If the balloon's shape is
AVKey.SHAPE_RECTANGLE,insetsspecifies the padding between the balloon's content area and the rectangle's top, left, bottom, and right.If the balloon's shape is
AVKey.SHAPE_ELLIPSE,insetsspecifies the padding between the balloon's content area and the ellipse's top, left, bottom, and right apexes.- Parameters:
insets- the desired padding between the balloon's content and its frame, in pixels.- Throws:
java.lang.IllegalArgumentException- ifinsetsisnull.- See Also:
getInsets()
-
getBalloonShape
java.lang.String getBalloonShape()
Indicates the shape of the balloon's frame.- Returns:
- the balloon frame's shape, either
AVKey.SHAPE_NONE,AVKey.SHAPE_RECTANGLE, orAVKey.SHAPE_ELLIPSE. - See Also:
setBalloonShape(String)
-
setBalloonShape
void setBalloonShape(java.lang.String shape)
Specifies the shape of the balloon's frame. Theshapemay be one of the following:If the
shapeisAVKey.SHAPE_NONE, the balloon's content is displayed in a rectangle in the viewport without any decoration. The rectangle's dimension in the viewport are specified by callingsetSize(Size).If the
shapeisAVKey.SHAPE_RECTANGLE, the balloon is displayed as a rectangle in the viewport with optionally rounded corners. The rectangle's dimension in the viewport are specified by callingsetSize(Size). The rectangle's corner radius in pixels is specified by callingsetCornerRadius(int).If the
shapeisAVKey.SHAPE_ELLIPSE, the balloon is displayed as an ellipse in the viewport. The ellipse's x- and y-radii are specified by callingsetSize(Size). The balloon's corner radius attribute is ignored.- Parameters:
shape- the frame shape to use, eitherAVKey.SHAPE_NONEAVKey.SHAPE_RECTANGLEorAVKey.SHAPE_ELLIPSE.- Throws:
java.lang.IllegalArgumentException- ifshapeisnull.- See Also:
getBalloonShape()
-
getLeaderShape
java.lang.String getLeaderShape()
Indicates the shape of the balloon's leader.- Returns:
- the balloon leader's shape, either
AVKey.SHAPE_NONEorAVKey.SHAPE_TRIANGLE. - See Also:
setLeaderShape(String)
-
setLeaderShape
void setLeaderShape(java.lang.String shape)
Specifies the shape of the balloon's leader. Theshapemay be one of the following:If the
shapeisAVKey.SHAPE_NONE, the leader is disabled and does not display.If the
shapeisAVKey.SHAPE_TRIANGLE, the leader extends from one side of the balloon's frame and points to the balloon's screen reference point. The width of the leader (in pixels) where it intersects the balloon's frame is specified by callingsetLeaderWidth(int).- Parameters:
shape- the leader shape to use, eitherAVKey.SHAPE_NONEorAVKey.SHAPE_TRIANGLE.- Throws:
java.lang.IllegalArgumentException- ifshapeisnull.- See Also:
getLeaderShape(),setLeaderWidth(int)
-
getLeaderWidth
int getLeaderWidth()
Indicates the width of the balloon's leader, in pixels. The returned value is either zero or a positive integer.- Returns:
- the width of the balloon's leader (in pixels) where it intersects the balloon's frame.
- See Also:
setLeaderWidth(int)
-
setLeaderWidth
void setLeaderWidth(int width)
Specifies the width of the balloon's leader, in pixels. The specifiedwidthmust be zero or a positive integer. Specifying awidthof zero disables the balloon's leader.This does nothing if the balloon's leader shape is
AVKey.SHAPE_NONE.If the balloon's leader shape is
AVKey.SHAPE_TRIANGLE, this specifies the size of the leader where it intersects the balloon's frame.- Parameters:
width- the desired leader width, in pixels.- Throws:
java.lang.IllegalArgumentException- ifwidthis less than zero.- See Also:
getLeaderWidth()
-
getCornerRadius
int getCornerRadius()
Indicates the radius of each rounded corner on the balloon's rectangular frame, in pixels. The returned value is either zero or a positive integer. If the returned value is zero the balloon's rectangular frame has sharp corners. This value is ignored if the balloon's shape isAVKey.SHAPE_ELLIPSE.- Returns:
- the radius of the rounded corner's on the balloon's on the balloon's rectangular frame, in pixels.
- See Also:
setCornerRadius(int)
-
setCornerRadius
void setCornerRadius(int radius)
Specifies the radius of the rounded corner's on the balloon's rectangular frame in pixels. The specifiedradiusmust be zero or a positive integer. Specifying aradiusof zero causes the shape's rectangular frame to have sharp corners. This does nothing if the balloon's shape isAVKey.SHAPE_ELLIPSE.- Parameters:
radius- the desired radius, in pixels.- Throws:
java.lang.IllegalArgumentException- ifradiusis less than zero.- See Also:
getCornerRadius()
-
getFont
java.awt.Font getFont()
Indicates the font used to display the balloon's text. This value may be ignored if the balloon's text contains HTML.- Returns:
- the balloon's text font.
- See Also:
setFont(java.awt.Font)
-
setFont
void setFont(java.awt.Font font)
Specifies the font in which to display the balloon's text. The specifiedfontmay be ignored if the balloon's text contains HTML.- Parameters:
font- the font to use for the balloon's text.- Throws:
java.lang.IllegalArgumentException- iffontisnull.- See Also:
getFont()
-
getTextColor
java.awt.Color getTextColor()
Indicates the color used to display the balloon's text. This value may be ignored if the balloon's text contains HTML.- Returns:
- the balloon's text color.
- See Also:
setTextColor(java.awt.Color)
-
setTextColor
void setTextColor(java.awt.Color color)
Specifies the color in which to display the balloon's text. The specifiedcolormay be ignored if the balloon's text contains HTML.- Parameters:
color- the color to use for the balloon's text.- Throws:
java.lang.IllegalArgumentException- ifcolorisnull.- See Also:
getTextColor()
-
getImageOffset
java.awt.Point getImageOffset()
Indicates the location of the balloon's texture (in pixels) relative to the balloon's upper left corner.- Returns:
- the location of the balloon's texture in pixels.
- See Also:
setImageOffset(java.awt.Point)
-
setImageOffset
void setImageOffset(java.awt.Point offset)
Specifies the location of the balloon's texture (in pixels) relative to the balloon's upper left corner. The location is applied to the balloon's texture before the balloon's texture scale is applied.- Parameters:
offset- the location of the balloon's texture source in pixels.- Throws:
java.lang.IllegalArgumentException- ifoffsetisnull.- See Also:
getImageOffset()
-
getImageOpacity
double getImageOpacity()
Indicates the opacity of the balloon's texture as a floating-point value in the range 0.0 to 1.0.- Returns:
- the balloon texture's opacity as a floating-point value from 0.0 to 1.0.
- See Also:
setImageOpacity(double)
-
setImageOpacity
void setImageOpacity(double opacity)
Specifies the opacity of the balloon's texture as a floating-point value in the range 0.0 to 1.0. The specifiedopacityis multiplied by the shape's interior opacity to determine the texture's final opacity. A value of 1.0 specifies a completely opaque texture, and 0.0 specifies a completely transparent texture. Values in between specify a partially transparent texture.- Parameters:
opacity- the balloon texture's opacity as a floating-point value from 0.0 to 1.0.- Throws:
java.lang.IllegalArgumentException- ifopacityis less than 0.0 or greater than 1.0.- See Also:
getImageOpacity()
-
getImageRepeat
java.lang.String getImageRepeat()
Indicates the balloon texture's horizontal and vertical repeat mode.- Returns:
- the balloon texture's repeat mode, one of
AVKey.REPEAT_NONE,AVKey.REPEAT_X,AVKey.REPEAT_Y, orAVKey.REPEAT_XY - See Also:
setImageRepeat(String)
-
setImageRepeat
void setImageRepeat(java.lang.String repeat)
Specifies the balloon texture's horizontal and vertical repeat mode. Therepeatmay be one of the following:If
repeatisAVKey.REPEAT_NONE, the balloon's texture is displayed according to its offset and scale without any repeating pattern.If
repeatisAVKey.REPEAT_X,AVKey.REPEAT_Y, orAVKey.REPEAT_XY, the balloon's texture is repeated along the X axis, along the Y axis, or along both the X and Y axes, respectively. The texture is repeated after its offset and scale are applied.- Parameters:
repeat- the texture's repeat mode to use, one ofAVKey.REPEAT_NONE,AVKey.REPEAT_X,AVKey.REPEAT_Y, orAVKey.REPEAT_XY.- Throws:
java.lang.IllegalArgumentException- ifrepeatisnull.- See Also:
getImageRepeat()
-
-