Class LabelStyle

java.lang.Object
com.vividsolutions.jump.workbench.ui.renderer.style.LabelStyle
All Implemented Interfaces:
Style, Cloneable

public class LabelStyle extends Object implements Style
  • Field Details

  • Constructor Details

    • LabelStyle

      public LabelStyle()
  • Method Details

    • initialize

      public void initialize(Layer layer)
      Description copied from interface: Style
      Called before #paint is applied to each Feature.
      Specified by:
      initialize in interface Style
      Parameters:
      layer - the layer on which to apply this style
    • paint

      public void paint(Feature f, Graphics2D g, Viewport viewport) throws NoninvertibleTransformException
      Specified by:
      paint in interface Style
      Throws:
      NoninvertibleTransformException
    • angle

      public static double angle(Feature feature, String angleAttributeName, double defaultAngle)
    • findPoint

      public org.locationtech.jts.geom.Coordinate findPoint(org.locationtech.jts.geom.Geometry geometry)
      Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope.
    • findPointForVertexSymbology

      public org.locationtech.jts.geom.Coordinate findPointForVertexSymbology(org.locationtech.jts.geom.Geometry geometry, int value)
      [Giuseppe Aruta 2018-10-29] Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope. Find right distance to symbol size in order to write the label outside the symbol
      Parameters:
      geometry - a Geometry to symbolize
      value - a symbol size
      Returns:
      the position of the symbol according to the Geometry Envelope the symbol size and the horizontal and vertical alignment
    • height

      public static double height(Feature feature, String heightAttributeName, double defaultHeight)
    • paint

      public void paint(Graphics2D g, String text, Viewport viewport, Point2D viewCentre, double angle, double height, int dim)
    • getVerticalAlignmentOffset

      public double getVerticalAlignmentOffset(int dim)
      Returns:
      approximate alignment offset for estimation
    • getHorizontalAlignmentOffset

      public double getHorizontalAlignmentOffset(String text)
      Returns:
      approximate alignment offset for estimation
    • getAttribute

      public String getAttribute()
    • getAngleAttribute

      public String getAngleAttribute()
    • getHeightAttribute

      public String getHeightAttribute()
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Style
      Returns:
      false if #paint should not be called e.g. because vertices are not shown. Don't need to check whether the layer is visible.
    • getColor

      public Color getColor()
    • getFont

      public Font getFont()
    • isScaling

      public boolean isScaling()
    • getHeight

      public double getHeight()
    • isHidingOverlappingLabels

      public boolean isHidingOverlappingLabels()
    • isHidingAtScale

      public boolean isHidingAtScale()
    • getHideAtScale

      public boolean getHideAtScale()
    • getVerticalAlignment

      public String getVerticalAlignment()
    • getHorizontalPosition

      public String getHorizontalPosition()
    • getHorizontalAlignment

      public int getHorizontalAlignment()
    • getHidingOverlappingLabels

      public boolean getHidingOverlappingLabels()
    • getOutlineShowing

      public boolean getOutlineShowing()
    • getOutlineWidth

      public double getOutlineWidth()
    • getScaleToHideAt

      public double getScaleToHideAt()
    • getOutlineColor

      public Color getOutlineColor()
    • setVerticalAlignment

      public void setVerticalAlignment(String verticalAlignment)
    • setHorizontalPosition

      public void setHorizontalPosition(String horizontalPosition)
    • setHorizontalAlignment

      public void setHorizontalAlignment(int horizontalAlignment)
    • setAttribute

      public void setAttribute(String attribute)
    • setAngleAttribute

      public void setAngleAttribute(String angleAttribute)
    • setHeightAttribute

      public void setHeightAttribute(String heightAttribute)
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface Style
    • setColor

      public void setColor(Color color)
    • setFont

      public void setFont(Font font)
    • setScaling

      public void setScaling(boolean scaling)
    • setHeight

      public void setHeight(double height)
    • setHidingOverlappingLabels

      public void setHidingOverlappingLabels(boolean hidingOverlappingLabels)
    • setOutlineShowing

      public void setOutlineShowing(boolean outlineShowing)
    • setOutlineWidth

      public void setOutlineWidth(double outlineWidth)
    • setScaleToHideAt

      public void setScaleToHideAt(double scaleToHideAt)
    • setOutlineColor

      public void setOutlineColor(Color outlineColor, int alpha)
    • setOutlineColor

      public void setOutlineColor(Color outlineColor)
    • setHideAtScale

      public void setHideAtScale(boolean hideAtScale)
    • clone

      public Object clone()
      Specified by:
      clone in interface Style
      Overrides:
      clone in class Object