Class Style

  • All Implemented Interfaces:
    Cloneable
    Direct Known Subclasses:
    Style2D

    public abstract class Style
    extends Object
    implements Cloneable
    Base class for resolved styles. Styles are resolved according a particular rendering context. The base class make no assumption about the output device (AWT, SWT, etc.). However, a particular output device may need to be choosen for concrete subclasses, for example Style2D for targeting Java2D.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double maxScale
      Maximum scale at which the geometry has to be painted with this style
      protected double minScale
      Minimum scale at which the geometry has to be painted with this style
    • Constructor Summary

      Constructors 
      Constructor Description
      Style()  
    • Field Detail

      • maxScale

        protected double maxScale
        Maximum scale at which the geometry has to be painted with this style
      • minScale

        protected double minScale
        Minimum scale at which the geometry has to be painted with this style
    • Constructor Detail

      • Style

        public Style()
    • Method Detail

      • getMaxScale

        public double getMaxScale()
        Gets the maximum scale at which the geometry has to be painted with this style (inclusive)
        Returns:
        - the maximum painting scale
      • getMinScale

        public double getMinScale()
        Gets the minimum scale at which the geometry has to be painted with this style (inclusive)
        Returns:
        - the minimum painting scale
      • setMinMaxScale

        public void setMinMaxScale​(double minScale,
                                   double maxScale)
        Sets minimum and maximum scale, and performs integrity checks on these value (will throw and IllegalArgumentException in minScale > maxScale)
      • isScaleInRange

        public boolean isScaleInRange​(double scale)
        Checks whethere the style should be used for painting at scale scale
        Parameters:
        scale - The scale queried
        Returns:
        True if scale is whithin the scale range of this style (false otherwise)