public class TLspNVGStyler extends ALspStyler
TLspNVGStyler
uses the TLcdNVGStyle
and the TLcdNVGSymbol
of an nvg element for its visualization.
If the standard defined in TLcdNVGSymbol
specifies how an object should be rendered, the symbol has
precedence over the style.
If an element has a symbol with an unsupported standard, only the style is used for visualization.
For the visualization of domain specific symbols, implement a custom styler as described in the NVG Developer's guide.
If an element doesn't have a style set, a style with default values according to NVG specifications will be used.
Style customization of military symbols is possible by setting an ILcdAPP6AStyle
and
an ILcdMS2525bStyle
.
This styler can only style NVG objects and should only be used with layers made by TLspNVGLayerBuilder
.
Constructor and Description |
---|
TLspNVGStyler()
Default constructor with
TLspPaintState.REGULAR as paint state. |
TLspNVGStyler(TLspPaintState aPaintState)
if the paint state is different that
TLspPaintState.REGULAR , this styler will decorate the default styling
to emphasize the nvg objects. |
Modifier and Type | Method and Description |
---|---|
ILcdAPP6AStyle |
getDefaultAPP6AStyle()
Returns the default symbology style for APP-6 domain objects that do not contain any styling.
|
ILcdMS2525bStyle |
getDefaultMS2525bStyle()
Returns the default symbology style for MIL-STD 2525 domain objects that do not contain any styling.
|
TLcdNVGStyle |
getDefaultNVGStyle()
Returns the default
TLcdNVGStyle of this styler. |
void |
setDefaultAPP6AStyle(ILcdAPP6AStyle aDefaultAPP6AStyle)
Sets the default symbology style for APP-6 domain objects that do not contain any styling.
|
void |
setDefaultMS2525bStyle(ILcdMS2525bStyle aDefaultMS2525bStyle)
Sets the default symbology style for MIL-STD 2525 domain objects that do not contain any styling.
|
void |
setDefaultNVGStyle(TLcdNVGStyle aDefaultNVGStyle)
Set the default
TLcdNVGStyle of this styler. |
void |
style(Collection<?> aObjects,
ALspStyleCollector aStyleCollector,
TLspContext aContext)
Styles the objects or labels contained in
aObjects using the methods provided
by ALspStyleCollector . |
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListener
public TLspNVGStyler()
TLspPaintState.REGULAR
as paint state.TLspNVGStyler(TLspPaintState)
public TLspNVGStyler(TLspPaintState aPaintState)
TLspPaintState.REGULAR
, this styler will decorate the default styling
to emphasize the nvg objects.aPaintState
- the paint state which the styler is used for.public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext)
ILspStyler
Styles the objects or labels contained in aObjects
using the methods provided
by ALspStyleCollector
.
Example usages for object styling:
// Same style for all objects:
aStyleCollector.objects(aObjects).style(myStyle).submit();
// Object specific styling:
aStyleCollector.object(myObject1).style(myStyle1).submit();
aStyleCollector.object(myObject2).style(myStyle2).submit();
Example usages for label styling:
if (aStyleCollector instanceof ALspLabelStyleCollector) {
ALspLabelStyleCollector labelStyleCollector = (ALspLabelStyleCollector)aStyleCollector;
// Specify a priority for all labels of all objects:
labelStyleCollector.objects(aDomainObjects).allLabels().priority(3).styles(...).submit();
// Specify an algorithm for a specific label:
labelStyleCollector.object(myObject1).label(123).algorithm(...).styles(...).submit();
}
The objects that are provided to aStyleCollector
must be objects that are contained in
aObjects
. Note that not all objects have to be styled. Objects that are not submitted in
aStyleCollector
will not be painted.
This method can be called very frequently, depending on the (amount of) data. If this method is not implemented efficiently, painting performance may be affected.
aObjects
- The objects to be styled.aStyleCollector
- A style collector to which all styling information
should be passed, this collector is only valid within this method
call, and can no longer be used afterwards.aContext
- Provides context information that may affect styling, such as view specific properties.public ILcdMS2525bStyle getDefaultMS2525bStyle()
ILcdMS2525bStyle
instance.TLcdNVGSymbol
public void setDefaultMS2525bStyle(ILcdMS2525bStyle aDefaultMS2525bStyle)
aDefaultMS2525bStyle
- the default MS2525 Style for the painter providerTLcdNVGSymbol
public ILcdAPP6AStyle getDefaultAPP6AStyle()
ILcdAPP6AStyle
instance.TLcdNVGSymbol
public void setDefaultAPP6AStyle(ILcdAPP6AStyle aDefaultAPP6AStyle)
aDefaultAPP6AStyle
- the default APP6A Style for the painter providerTLcdNVGSymbol
public TLcdNVGStyle getDefaultNVGStyle()
TLcdNVGStyle
of this styler.setDefaultNVGStyle(TLcdNVGStyle)
public void setDefaultNVGStyle(TLcdNVGStyle aDefaultNVGStyle)
TLcdNVGStyle
of this styler.
This NVG Style allows to override the default values of the style attributes from NVG specifications. These values will be used to visualize an object if neither its style neither a style of its ancestors explicitly set these attributes. If some values aren't set on this style, the styler will use the ones from the specifications.
For example, a new default font can be set and every elements will use it except the element with a font set.
Note that this default nvg style is not used for elements with a military symbols.
aDefaultNVGStyle
- a default nvg style