Interface ILabelingStrategy

All Superinterfaces:
org.gvsig.tools.persistence.Persistent

public interface ILabelingStrategy extends org.gvsig.tools.persistence.Persistent
A LabelingStrategy is a way to define how the labels are painted in a map, or potentially other object implementing ILabelable. It contains methods for allowing the definition of labeling classes through the labeling method (see ILabelingMethod), the placement of such labels (see IPlacementConstraints), and the zoom properties (see ZoomConstraints)
Author:
jaume dominguez faus - jaume.dominguez@iver.es
  • Method Details

    • getLabelingMethod

      ILabelingMethod getLabelingMethod()
      Returns the labeling method currently in use. The labeling method handles a list of LabelClass that allows to handle several definition of labels in the layer.
      Returns:
      ILabelingMethod, the current one.
      See Also:
    • setLabelingMethod

      void setLabelingMethod(ILabelingMethod method)
      Sets the labeling method that will be used the next time the the draw is invoked.
      Parameters:
      method - , the new labeling method
    • getPlacementConstraints

      IPlacementConstraints getPlacementConstraints()
      Returns the current placement constraints that determine the position where the label is placed.
      Returns:
    • setPlacementConstraints

      void setPlacementConstraints(IPlacementConstraints constraints)
      Sets the PlacementConstraints that will determine where to place the labels. The change will take effect next time the draw(...) method is invoked.
      Parameters:
      constraints -
    • getZoomConstraints

      IZoomConstraints getZoomConstraints()
      Returns the current placement constraints that determine the position where the label is placed.
      Returns:
    • setZoomConstraints

      void setZoomConstraints(IZoomConstraints constraints)
      Sets the PlacementConstraints that will determine where to place the labels. The change will take effect next time the draw(...) method is invoked.
      Parameters:
      constraints -
    • draw

      void draw(BufferedImage mapImage, Graphics2D mapGraphics, double scale, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double dpi) throws org.gvsig.fmap.dal.exception.ReadException
      Causes the labels to be drawn. The policy of process is determined by the LabelingStrategy previously set.
      Parameters:
      mapImage -
      mapGraphics -
      viewPort -
      cancel -
      dpi - TODO
      Throws:
      org.gvsig.fmap.dal.exception.ReadException
    • print

      void print(Graphics2D g, double scale, ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.dal.exception.ReadException
      Applies the printer properties to the rendering process to match its attributes. The result is manifested in the Graphics2D g which is the object sent to the printer.
      Parameters:
      g -
      viewPort -
      cancel -
      properties -
      Throws:
      org.gvsig.fmap.dal.exception.ReadException
    • getUsedFields

      String[] getUsedFields()
      Returns a non-null String[] containing the names of the fields involved in the labeling. If this strategy contains more than one LabelClass the result is an array with all the names of the fields used by all the LabelClass, with no duplicates.
      Returns:
    • setLayer

      void setLayer(FLayer layer)
    • shouldDrawLabels

      boolean shouldDrawLabels(double scale)