public final class TLspMGRSGridOverlayLabelBuilder extends Object
Builder that makes it possible to create MGRS overlay labels. These labels are added to the view and show (part of) an MGRS coordinate. These labels can have a pre-defined content, and style.
The overlay label builder can be used in 2 ways:
TLspXYGridLayerBuilder#overlayLabel
.
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:
// See TLspMGRSGridStyle for more information on configuring the grid style
JComponent component = TLspMGRSGridOverlayLabelBuilder
.newBuilder()
.view(view)
.content(TLspMGRSGridOverlayLabelBuilder.Content.COORDINATE_AT_CENTER)
.build();
Modifier and Type | Class and Description |
---|---|
static class |
TLspMGRSGridOverlayLabelBuilder.Content
The content that is displayed in the label.
|
Modifier and Type | Method and Description |
---|---|
TLspMGRSGridOverlayLabelBuilder |
all(TLspMGRSGridOverlayLabelBuilder aBuilder)
Copies all properties from the given builder.
|
JComponent |
build()
Creates an MGRS grid label.
|
TLspMGRSGridOverlayLabelBuilder |
content(TLspMGRSGridOverlayLabelBuilder.Content aContent)
The content which is being displayed.
|
static TLspMGRSGridOverlayLabelBuilder |
newBuilder()
Creates a new builder, capable of adding MGRS grid labels.
|
TLspMGRSGridOverlayLabelBuilder |
style(TLspMGRSGridStyle aMGRSGridStyle)
The style with which the overlay label is being displayed.
|
TLspMGRSGridOverlayLabelBuilder |
view(ILspView aView)
The view for which the overlay labels should be added.
|
public static TLspMGRSGridOverlayLabelBuilder newBuilder()
public TLspMGRSGridOverlayLabelBuilder view(ILspView aView)
aView
- the view.public TLspMGRSGridOverlayLabelBuilder content(TLspMGRSGridOverlayLabelBuilder.Content aContent)
COORDINATE_AT_CENTER
.aContent
- coordinate which is being displayed.public TLspMGRSGridOverlayLabelBuilder style(TLspMGRSGridStyle aMGRSGridStyle)
TLspMGRSGridStyle.Builder.overlay()
are used. Only the following styles are supported:
When setting a format, it is ignored when using
COMMON_VIEW_COORDINATE
.aMGRSGridStyle
- the MGRS grid style.public TLspMGRSGridOverlayLabelBuilder all(TLspMGRSGridOverlayLabelBuilder aBuilder)
aBuilder
- a builderpublic JComponent build()