Class TLspLonLatGridStyler

All Implemented Interfaces:
ILspCustomizableStyler, ILspStyler

public class TLspLonLatGridStyler extends ALspLabelStyler implements ILspCustomizableStyler

Convenience styler that can be used to style lon-lat grids. This styler can be used both for the grid labels and lines.

It can separately style meridians and parallels, and it can separately style specific meridians and parallels. Both the line styles and text styles can be specified: see setStyles(com.luciad.view.lightspeed.painter.grid.ILspLonLatGridLine.Category, double, com.luciad.view.lightspeed.style.ALspStyle...).

The possible styles are:

The most specific style for a grid line will be used, e.g. the style for a ILspLonLatGridLine will have precedence on a style for a Category. When no style can be found, a default style is used.

The format of the coordinates can be specified using setCoordinateFormatter(int, ILcdLonLatFormatter).

The positions of the labels relative to the grid line can be specified using setPosition.

Note: this styler is a ILspCustomizableStyler, so you can adapt its styles in a generic way using the following style identifiers:

  • DEFAULT: fallback if no more specific styles are present
  • PARALLEL: default styles for parallel lines
  • MERIDIAN: default styles for meridian lines
For example:
  for ( TLspCustomizableStyle customizableStyle : lonLatGridStyler.getStyles() ) {
    if ( customizableStyle.getIdentifier().equals( "PARALLEL" ) ) {
      customizableStyle.setStyle( TLspLineStyle.newBuilder()
                                      .color( Color.BLACK )
                                      .width( 2.0F )
                                      .build() );
    }
    // Rest of code omitted.
  }
 

Since:
2012.0
  • Field Details

  • Constructor Details

    • TLspLonLatGridStyler

      public TLspLonLatGridStyler()
      Create a styler with some default styling.
    • TLspLonLatGridStyler

      public TLspLonLatGridStyler(TLspLineStyle aLineStyle)
      Create a styler with a default line style, text style and coordinate formatter.

      This styler can be used for body representations.

      Parameters:
      aLineStyle - The default line style.
    • TLspLonLatGridStyler

      public TLspLonLatGridStyler(TLspTextStyle aTextStyle, TLspLabelBoxStyle aLabelBoxStyle, TLspLabelOpacityStyle aOpacityStyle, ILcdLonLatFormatter aFormatter)
      Create a styler with a default text style and coordinate formatter.

      This styler can be used for label representations.

      Parameters:
      aTextStyle - The default text style.
      aLabelBoxStyle - The label style.
      aOpacityStyle - The opacity style.
      aFormatter - The default coordinate formatter.
    • TLspLonLatGridStyler

      public TLspLonLatGridStyler(TLspLineStyle aLineStyle, TLspTextStyle aTextStyle, TLspLabelBoxStyle aLabelBoxStyle, TLspLabelOpacityStyle aOpacityStyle, ILcdLonLatFormatter aFormatter)
      Create a styler with a default line style, text style and coordinate formatter.

      This styler can be used for label or body representations.

      Parameters:
      aLineStyle - The default line style.
      aTextStyle - The default text style.
      aLabelBoxStyle - The label style.
      aOpacityStyle - The opacity style.
      aFormatter - The default coordinate formatter.
  • Method Details