Class TLcdMIFGXYLabelPainterProvider

java.lang.Object
com.luciad.format.mif.gxy.TLcdMIFGXYLabelPainterProvider
All Implemented Interfaces:
ILcdGXYLabelPainterProvider, Serializable, Cloneable

public class TLcdMIFGXYLabelPainterProvider extends Object implements ILcdGXYLabelPainterProvider
This class implements an ILcdGXYLabelPainterProvider for MIF objects. Depending on the MIF shape type, it returns a TLcdGXYDataObjectLabelPainter, a TLcdGXYDataObjectPolylineLabelPainter, or a a TLcdGXYDataObjectPolygonLabelPainter. Setting and getting the provider's properties is delegated to these label painters, as far as applicable.

Expressions are converted into labels using this object's data object expression language. The default data object language expression of this label painter is TLcdDataObjectExpressionLanguage.

See Also:
  • Constructor Details

    • TLcdMIFGXYLabelPainterProvider

      public TLcdMIFGXYLabelPainterProvider()
      Creates a new TLcdMIFGXYLabelPainterProvider.
  • Method Details

    • setFont

      public void setFont(Font newFont)
      Sets the font for the labels.
      Parameters:
      newFont - the font to use to display labels.
      See Also:
    • getFont

      public Font getFont()
      Returns the font used to display labels.
      Returns:
      the font used to display labels.
      See Also:
    • setForeground

      public void setForeground(Color newForeground)
      Sets the color for labels.
      Parameters:
      newForeground - the color label text will be displayed in.
      See Also:
    • getForeground

      public Color getForeground()
      Returns the color label text is displayed in.
      Returns:
      the color label text is displayed in.
      See Also:
    • setBackground

      public void setBackground(Color aNewBackgroundColor)
      Sets the background color labels are displayed on.
      Parameters:
      aNewBackgroundColor - the background color labels are displayed on.
      See Also:
    • getBackground

      public Color getBackground()
      Returns the background color labels are displayed on.
      Returns:
      the background color labels are displayed on.
      See Also:
    • setSelectionColor

      public void setSelectionColor(Color aNewSelectionColor)
      Sets the color to use to display label texts of selected objects.
      Parameters:
      aNewSelectionColor - the color to use to display label texts of selected objects.
      See Also:
    • getSelectionColor

      public Color getSelectionColor()
      Returns the color used to display label texts of selected objects.
      Returns:
      the color used to display label texts of selected objects.
      See Also:
    • setFrame

      public void setFrame(boolean newFrame)
      Sets whether a frame should be surrounding the labels.
      Parameters:
      newFrame - true to display the labels in frames.
      See Also:
    • isFrame

      public boolean isFrame()
      Returns whether labels should be displayed in frames.
      Returns:
      true if the labels should be displayed in frames.
      See Also:
    • setFilled

      public void setFilled(boolean newFilled)
      Sets whether labels should be surrounded by a filled rectangle.
      Parameters:
      newFilled - true to embed the labels in filled rectangles.
      See Also:
    • isFilled

      public boolean isFilled()
      Returns whether the labels are displayed embedded in filled rectangles.
      Returns:
      true if the labels are displayed embedded in filled rectangles.
      See Also:
    • setShiftLabelPosition

      public void setShiftLabelPosition(int aNewShift)
      Determines where the labels should be placed with regards to the object on the map.
      Parameters:
      aNewShift - an integer code denoting a direction in which the label will be displaced.
      See Also:
    • getShiftLabelPosition

      public int getShiftLabelPosition()
      Returns an integer code denoting a direction in which the label will be displaced.
      Returns:
      an integer code denoting a direction in which the label will be displaced.
      See Also:
    • setVerticalSpacing

      public void setVerticalSpacing(int aNewVerticalSpacing)
      The value of the property VerticalSpacing represents the vertical distance in pixels between successive lines of the labels.
      Parameters:
      aNewVerticalSpacing - the vertical space between lines in the label.
      See Also:
    • getVerticalSpacing

      public int getVerticalSpacing()
      Returns the vertical space between lines in the labels.
      Returns:
      the vertical space between lines in the labels.
      See Also:
    • setWithAnchorPoint

      public void setWithAnchorPoint(boolean newWithAnchorPoint)
      Sets whether to draw the anchor point of the object the label belongs to.
      Parameters:
      newWithAnchorPoint - true to draw the anchor point of the object the label belongs to.
      See Also:
    • isWithAnchorPoint

      public boolean isWithAnchorPoint()
      Returns whether objects anchor points are painted together with the label.
      Returns:
      true if objects anchor points are painted together with the label.
      See Also:
    • setWithPin

      public void setWithPin(boolean aNewWithPin)
      Sets whether to draw a line connecting the object and the objects label.
      Parameters:
      aNewWithPin - true to draw a line between the object and the objects label.
      See Also:
    • isWithPin

      public boolean isWithPin()
      Returns whether a line between the object and the objects label is drawn.
      Returns:
      true if a line between the object and the objects label is drawn.
      See Also:
    • setConsiderPinForBounds

      public void setConsiderPinForBounds(boolean aNewConsiderPinForBounds)
      Sets whether to consider the pin when calculating the label bounds.
      Parameters:
      aNewConsiderPinForBounds - true to consider the pin calculating the label bounds.
      See Also:
    • isConsiderPinForBounds

      public boolean isConsiderPinForBounds()
      Returns whether the pin is taken into account when calculating the label bounds.
      Returns:
      true when the pin is considered when calculating the label bounds.
      See Also:
    • setPositionList

      public void setPositionList(int[] aNewPositionList)
      Sets the list of possible positions relative to the object where the objects label can be drawn.
      Parameters:
      aNewPositionList - the list of relative positions to draw the objects label.
      See Also:
    • getPositionList

      public int[] getPositionList()
      Returns the list of possible relative positions for an objects label.
      Returns:
      the list of possible relative positions for an objects label.
      See Also:
    • setPositionListAsString

      public void setPositionListAsString(String[] aNewPositionList)
      Sets the list of possible positions relative to the object where the objects label can be drawn by means of String objects.
      Parameters:
      aNewPositionList - the list of Strings denoting the relative positions to be taken into account when placing a label.
      See Also:
    • getPositionListAsString

      public String[] getPositionListAsString()
      Returns the list of possible relative positions for an objects label as a set of String objects.
      Returns:
      the list of possible relative positions for an objects label as a set of String objects.
      See Also:
    • getPositionAsString

      public String getPositionAsString(int aPosition)
      Returns an integer code denoting a direction in human readable form.
      Parameters:
      aPosition - an integer code denoting a direction.
      Returns:
      the String representation of the direction.
    • getDataObjectExpressionLanguage

      public ALcdDataObjectExpressionLanguage getDataObjectExpressionLanguage()
      Returns the data object expression language used by this label painter.
      Returns:
      the data object expression language used by this label painter
      See Also:
    • setDataObjectExpressionLanguage

      public void setDataObjectExpressionLanguage(ALcdDataObjectExpressionLanguage aExpressionLanguage)
      Sets the data object expression language used by this label painter.
      Parameters:
      aExpressionLanguage - the data object expression language to be used by this label painter
      See Also:
    • setFeatureIndices

      @Deprecated public void setFeatureIndices(int[] aFeatureIndices)
      Deprecated.
      Sets the indexes of the features to be used to compose the contents of the label.
      Parameters:
      aFeatureIndices - the indexes of the features to be used to compose the labels.
      See Also:
    • getFeatureIndices

      @Deprecated public int[] getFeatureIndices()
      Deprecated.
      Returns the indexes of the features used to compose a label.
      Returns:
      the indexes of the features used to compose a label.
      See Also:
    • getExpressions

      public String[] getExpressions()
      Returns the expressions used to compose a label.
      Returns:
      the expressions used to compose a label.
      See Also:
    • setExpressions

      public void setExpressions(String[] aExpressions)
      Sets the expressions to be used to compose the contents of the label. The format of the expression depends on the expression language set with the setDataObjectExpressionLanguage(com.luciad.datamodel.expression.ALcdDataObjectExpressionLanguage) method.
      Parameters:
      aExpressions - the expressions to be used to compose the labels.
      See Also:
    • getGXYLabelPainter

      public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
      Description copied from interface: ILcdGXYLabelPainterProvider
      Finds an ILcdGXYLabelPainter that can be used to label the object passed.

      The label painter provider is responsible for setting the object to the label painter before returning the label painter. An implementation should therefore have the following structure:

      
       public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject) {
         ILcdGXYLabelPainter labelPainter = ... // find the label painter for the object
         if (labelPainter != null) {
          labelPainter.setObject(aObject);
         }
         return labelPainter;
       }
       

      Specified by:
      getGXYLabelPainter in interface ILcdGXYLabelPainterProvider
      Parameters:
      aObject - the object to find a label painter for
      Returns:
      a label painter that can be used to label the object; or null if no label painter could be found for the given object, or the object could not be set on the retrieved label painter.
    • clone

      public Object clone()
      Description copied from interface: ILcdGXYLabelPainterProvider
      Redefines Object.clone to make it public.
      Specified by:
      clone in interface ILcdGXYLabelPainterProvider
      Overrides:
      clone in class Object