Package com.luciad.view.lightspeed.style
Class TLspLabelBoxStyle
java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspLabelBoxStyle
- All Implemented Interfaces:
ILspStyler
Style used to draw a box around labels: frame and background color.
It defines the following properties:
- Frame: a rectangular border around the label: see
TLspLabelBoxStyle.Builder.frameThickness(float)
andTLspLabelBoxStyle.Builder.frameColor(java.awt.Color)
. The frame can also have a halo, seeTLspLabelBoxStyle.Builder.haloColor(java.awt.Color)
andTLspLabelBoxStyle.Builder.haloThickness(float)
. - Fill: background color behind the label and border: see
TLspLabelBoxStyle.Builder.filled(boolean)
andTLspLabelBoxStyle.Builder.fillColor(java.awt.Color)
. - Padding: space between the label and the border: see
TLspLabelBoxStyle.Builder.padding(int)
.
Construction of a label box style object is performed through the Builder
design pattern mechanism.
Note that it is possible to use multiple TLspLabelBoxStyles
in a label styler. In that case, the padding
property is always defined relative to the content (text or icon) of the label. Also, the painting order is defined
by the order in which the styles are passed to the styler.
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TLspLabelBoxStyle.Builder<B extends TLspLabelBoxStyle.Builder<B>>
Builder for label box styles. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
Returns the background color of the label.Returns the color the frame should be drawn in.float
Returns the line width (in pixels) of the frame.Gets the halo color.float
Gets the halo thickness.int
Returns the padding (in pixels) between the label content (text or icon) and its frame.int
hashCode()
boolean
isFilled()
Indicates whether the label should have a non-transparent background.boolean
Determines whether this style is transparent.static TLspLabelBoxStyle.Builder
<?> Creates a new builder with the default values.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this style. -
getPadding
public int getPadding()Returns the padding (in pixels) between the label content (text or icon) and its frame.- Returns:
- the padding between the label and its frame
-
getFrameThickness
public float getFrameThickness()Returns the line width (in pixels) of the frame.Returns
0
if no frame should be drawn.- Returns:
- the frame thickness, in pixels
-
getFrameColor
Returns the color the frame should be drawn in. This property only has effect ifgetFrameThickness()
is not 0.- Returns:
- the color of the frame
-
isFilled
public boolean isFilled()Indicates whether the label should have a non-transparent background.- Returns:
true
if the label should have a non-transparent background,false
otherwise.
-
getFillColor
Returns the background color of the label. This property only has effect ifisFilled()
istrue
.- Returns:
- the background color of the label.
-
getHaloColor
Gets the halo color. This property should only be used if the halo is enabled.- Returns:
- the halo color
- See Also:
-
getHaloThickness
public float getHaloThickness()Gets the halo thickness. If zero, there should be no halo.- Returns:
- the halo thickness in pixels
- See Also:
-
isTransparent
public boolean isTransparent()Description copied from class:ALspStyle
Determines whether this style is transparent. Shapes that are transparent can be painted in a different paint phase than shapes that are not transparent.- Specified by:
isTransparent
in classALspStyle
- Returns:
- whether or not this style is transparent
-
equals
-
hashCode
public int hashCode()
-