Class WayParams

java.lang.Object
org.ka2ddo.yaac.gui.osm.WayParams
All Implemented Interfaces:
Serializable

public class WayParams extends Object implements Serializable
This class contains the current graphical rendering settings for a WayType.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Preferences Node name for Way type rendering control persisting.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WayParams(WayType wayType)
    Create an instance of WayParams.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    float
    Get the maximum scale value for which this line type's label will be rendered.
    float
    Get the maximum scale value for which this line type will be rendered.
    Get the rendering color or texture for painting this type of Way.
    Get the Swing Stroke style to use for painting lines of this Way type.
    Get the WayType enumeration value associated with this WayParams object.
    int
    Returns a hash code value for the object.
    boolean
    Test if this way enumeration has the factory-default settings (i.e., don't need to save in preferences).
    boolean
    Report if Ways of this type should be rendered.
    void
    Load this WayParams object's values from Java Preferences.
    void
    Set this WayParams object back to the factory-default settings.
    void
    Save this WayParams object's values to Java Preferences.
    void
    setMaxLabelZoom(float maxLabelZoom)
    Set the maximum scale value for which this line type's label will be rendered.
    void
    setMaxLineZoom(float maxLineZoom)
    Set the maximum scale value for which this line type will be rendered.
    void
    setRenderColor(Paint renderColor)
    Set the rendering color or texture for painting this type of Way.
    void
    setRenderStroke(Stroke renderStroke)
    Set the Swing Stroke style to use for painting lines of this Way type.
    void
    setShown(boolean shown)
    Specify if Ways of this type should be rendered.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • WAY_TYPE_LAYERS

      public static final String WAY_TYPE_LAYERS
      Preferences Node name for Way type rendering control persisting.
      See Also:
  • Constructor Details

    • WayParams

      public WayParams(WayType wayType)
      Create an instance of WayParams.
      Parameters:
      wayType - the WayType object to initialize the WayParams object from
  • Method Details

    • restoreDefaults

      public void restoreDefaults()
      Set this WayParams object back to the factory-default settings.
    • isDefault

      public boolean isDefault()
      Test if this way enumeration has the factory-default settings (i.e., don't need to save in preferences).
      Returns:
      boolean true if this WayParams has the hard-coded defaults for its WayType
    • getWayType

      public WayType getWayType()
      Get the WayType enumeration value associated with this WayParams object.
      Returns:
      associated WayType value
    • getRenderColor

      public Paint getRenderColor()
      Get the rendering color or texture for painting this type of Way.
      Returns:
      Paint
    • setRenderColor

      public void setRenderColor(Paint renderColor)
      Set the rendering color or texture for painting this type of Way.
      Parameters:
      renderColor - Paint to use for rendering this Way type
    • getRenderStroke

      public Stroke getRenderStroke()
      Get the Swing Stroke style to use for painting lines of this Way type.
      Returns:
      Stroke for rendering
    • setRenderStroke

      public void setRenderStroke(Stroke renderStroke)
      Set the Swing Stroke style to use for painting lines of this Way type.
      Parameters:
      renderStroke - Stroke for rendering
    • getMaxLineZoom

      public float getMaxLineZoom()
      Get the maximum scale value for which this line type will be rendered.
      Returns:
      float scale value
    • setMaxLineZoom

      public void setMaxLineZoom(float maxLineZoom)
      Set the maximum scale value for which this line type will be rendered.
      Parameters:
      maxLineZoom - float scale value
    • getMaxLabelZoom

      public float getMaxLabelZoom()
      Get the maximum scale value for which this line type's label will be rendered.
      Returns:
      float scale value
    • setMaxLabelZoom

      public void setMaxLabelZoom(float maxLabelZoom)
      Set the maximum scale value for which this line type's label will be rendered.
      Parameters:
      maxLabelZoom - float scale value
    • isShown

      public boolean isShown()
      Report if Ways of this type should be rendered.
      Returns:
      boolean true if Ways of the associated type should be rendered, false if not
    • setShown

      public void setShown(boolean shown)
      Specify if Ways of this type should be rendered.
      Parameters:
      shown - boolean true if Ways of the associated type should be rendered, false if not
    • loadFromPreferences

      public void loadFromPreferences(Preferences prefs)
      Load this WayParams object's values from Java Preferences.
      Parameters:
      prefs - Preferences object to contain all the WayParams instances
    • saveToPreferences

      public void saveToPreferences(Preferences prefs)
      Save this WayParams object's values to Java Preferences.
      Parameters:
      prefs - Preferences object to contain all the WayParams instances
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
      See Also:
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.