Class TLspCGRSGridOverlayLabelBuilder
java.lang.Object
com.luciad.view.lightspeed.painter.grid.cgrs.TLspCGRSGridOverlayLabelBuilder
Builder that makes it possible to create Common Grid Reference System (CGRS) overlay labels. These labels are added to the view and show (part of) a CGRS coordinate. The labels can have a pre-defined content and style.
The overlay label builder can be used in 2 ways:
- To build a JComponent that contains a coordinate readout. This component can be used as any Swing component. It can for example be added to the overlay panel or to a UI panel.
- To add to
TLspCGRSGridLayerBuilder
. When using this method, the overlay label will be added to the overlay panel of the view. On top of that, the visibility of the overlay label will be synchronized with the visibility of the layer.
An example of how to use this builder:
JComponent component = TLspCGRSGridOverlayLabelBuilder
.newBuilder()
.view(view)
.model(model)
.content(TLspCGRSGridOverlayLabelBuilder.Content.COORDINATE_AT_CENTER)
.style(gridStyle)
.build();
- Since:
- 2021.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The content that is displayed in the label. -
Method Summary
Modifier and TypeMethodDescriptionall
(TLspCGRSGridOverlayLabelBuilder aBuilder) Copies all properties from the given builder.build()
Creates an CGRS grid label.The content which is being displayed.The model containing a CGRSGrid.Creates a new builder, capable of adding CGRS grid labels.style
(TLspCGRSGridStyle aCGRSGridStyle) The style with which the overlay label is being displayed.The view for which the overlay labels should be added.
-
Method Details
-
newBuilder
Creates a new builder, capable of adding CGRS grid labels.- Returns:
- a new builder
-
view
The view for which the overlay labels should be added.- Parameters:
aView
- the view.- Returns:
- this builder.
-
model
The model containing a CGRSGrid. The model is used to get the grid bounds and the geodetic reference.- Parameters:
aModel
- the model.- Returns:
- this builder
-
content
The content which is being displayed. By default, the content isCOORDINATE_AT_CENTER
.- Parameters:
aContent
- coordinate which is being displayed.- Returns:
- this builder
-
style
The style with which the overlay label is being displayed. When using this method, only styles and formats set after using theTLspCGRSGridStyle.Builder.overlay()
are used. Only the following styles are supported: When setting a format, it is ignored when usingCOMMON_VIEW_COORDINATE
.- Parameters:
aCGRSGridStyle
- the CGRS grid style.- Returns:
- this builder.
-
all
Copies all properties from the given builder.- Parameters:
aBuilder
- a builder- Returns:
- this builder.
-
build
Creates an CGRS grid label.- Returns:
- the created label.
-