Class Symbol

java.lang.Object
viewer.symbols.Symbol
Direct Known Subclasses:
LineSymbol, PointSymbol, PolygonSymbol

public abstract class Symbol
extends java.lang.Object
abstract class that must be implemented by all classes representing symbols that can be displayed in a map
Author:
haunert
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.awt.Stroke DASHED
    Predefined stroke for a dashed line.
    static java.awt.Stroke DOTTED
    Predefined stroke for a dotted line.
    protected Feature myFeature
    The feature this symbol represents
  • Constructor Summary

    Constructors 
    Constructor Description
    Symbol​(Feature feature)
    Default constructor to enforce setting of feature.
  • Method Summary

    Modifier and Type Method Description
    abstract void draw​(java.awt.Graphics2D g, Transformation t)
    This method is called to draw this Symbol into a specified Graphics object.
    Envelope getBoundingBox()  
    Feature getFeature()
    Returns the feature this Symbol represents.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • myFeature

      protected Feature myFeature
      The feature this symbol represents
    • DASHED

      public static final java.awt.Stroke DASHED
      Predefined stroke for a dashed line.
    • DOTTED

      public static final java.awt.Stroke DOTTED
      Predefined stroke for a dotted line.
  • Constructor Details

    • Symbol

      public Symbol​(Feature feature)
      Default constructor to enforce setting of feature.
      Parameters:
      feature - the feature this symbol represents
  • Method Details

    • draw

      public abstract void draw​(java.awt.Graphics2D g, Transformation t)
      This method is called to draw this Symbol into a specified Graphics object.
      Parameters:
      g - the Graphics object
      t - the Transformation that maps world coordinates to image coordinates
    • getBoundingBox

      public Envelope getBoundingBox()
      Returns:
      the bounding box
    • getFeature

      public Feature getFeature()
      Returns the feature this Symbol represents.
      Returns:
      a feature, consisting of geometry and attributes