Package com.luciad.view.lightspeed.style
Class TLspSelectionStylerBuilder
java.lang.Object
com.luciad.view.lightspeed.style.TLspSelectionStylerBuilder
Builds an styler
wrapper that adds or changes selection specific style elements from the
wrapped styler:
- Lines: Line selection color replaces the original line color
- Areas: Line and fill selection color replaces the original color
- Icons: A rectangle is added around the icon (bounding box for 3D icons)
- Text: Text selection color replaces the original color and a default black halo is added
- Complex strokes: A halo is added
Example
//Create the style for the body. Here we use a single ALspStyle,
//but it also works for an ALspStyler
ALspStyle iconStyle = TLspIconStyle.newBuilder()
.build();
//Use the TLspSelectionStylerBuilder to create a selection styler
ALspStyler selectionStyler = TLspSelectionStylerBuilder.newBuilder()
.styles(iconStyle)
.outlineColor(Color.BLUE)
.build();
//Install the selection styler on the layer
TLspLayer layer = TLspShapeLayerBuilder.newBuilder()
.bodyStyler(TLspPaintState.REGULAR, iconStyle)
.bodyStyler(TLspPaintState.SELECTED, selectionStyler)
.model(model)
.build();
- Since:
- 2017.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newALspStyler
instance.Sets the fill selection color.static TLspSelectionStylerBuilder
Create a new builder instanceoutlineColor
(Color aOutlineColor) Sets the selection color for outlines.styler
(ALspStyler aStyler) Sets the styler to be wrapped by the selection styler.Sets the styles to be wrapped by the selection styler.
-
Method Details
-
newBuilder
Create a new builder instance- Returns:
- a new builder instance
-
styles
Sets the styles to be wrapped by the selection styler.Use either
styler(com.luciad.view.lightspeed.style.styler.ALspStyler)
orstyles(com.luciad.view.lightspeed.style.ALspStyle...)
, not both.- Parameters:
aStyles
- the styles to be wrapped by the selection styler- Returns:
- this builder
-
styler
Sets the styler to be wrapped by the selection styler.Use either
styler(com.luciad.view.lightspeed.style.styler.ALspStyler)
orstyles(com.luciad.view.lightspeed.style.ALspStyle...)
, not both.- Parameters:
aStyler
- the styler to be wrapped by the selection styler- Returns:
- this builder
-
fillColor
Sets the fill selection color. This color will replace the original color configured on aTLspFillStyle
. The alpha component of the selection color will be the result of the multiplication of the alpha component of the original fill color and the fill selection color.- Parameters:
aFillColor
- the fill selection color- Returns:
- this builder
-
outlineColor
Sets the selection color for outlines. This color will be used for the following styles:- Icon styles: a rectangle is added around the icon (bounding box for 3D icons), using the selection color
- Text style: replaces original text color and a default black halo is added
Line styles: replaces original color Complex stroke line styles: add a halo with the selection color - Parameters:
aOutlineColor
- the outline selection color- Returns:
- this builder
-
build
Returns a newALspStyler
instance.- Returns:
- a new
ALspStyler
.
-