Enum ViewQuality

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ViewQuality>

    public enum ViewQuality
    extends java.lang.Enum<ViewQuality>
    An enumeration of the different preview quality settings available from the View menu. Objects that wish to modify their behaviour based on the view quality setting should always use the static get() method of this class to obtain the current setting and not try to read the value directly from settings themselves.

    Objects can be notified when the view quality changes by registering a property change listener for the property named StrangeEonsAppWindow.VIEW_QUALITY_PROPERTY with the StrangeEonsAppWindow. For example, the following Java code would print a message to the standard error stream whenever the quality changes:

     StrangeEons.getWindow().addPropertyChangeListener(
            StrangeEonsAppWindow.VIEW_QUALITY_PROPERTY,
            new PropertyChangeListener() {
                    public void propertyChange( PropertyChangeEvent evt ) {
                            final ViewQuality oldVQ = (ViewQuality) evt.getOldValue();
                            final ViewQuality newVQ = (ViewQuality) evt.getNewValue();
                            System.err.println( "The quality changed from " + oldVQ + " to " + newVQ );
                            // do something useful...
                    }
            }
     );
     
    Since:
    3.0
    Author:
    Chris Jennings
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void applyPreviewWindowHints​(java.awt.Graphics2D g)  
      static ViewQuality get()
      Returns the current view quality.
      RenderTarget getRenderTarget()
      Returns an appropriate rendering target to use when rendering sheets at this view quality.
      double getSheetViewerUpsample​(Sheet<?> sheet)
      Returns the upsampling factor to use for a sheet in the sheet viewer.
      static boolean isManagedAutomatically()
      Returns true if the view quality is set to automatic management mode.
      static ViewQuality valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ViewQuality[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static ViewQuality[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ViewQuality c : ViewQuality.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ViewQuality valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getRenderTarget

        public RenderTarget getRenderTarget()
        Returns an appropriate rendering target to use when rendering sheets at this view quality.
        Returns:
        a rendering quality appropriate for the view quality
      • getSheetViewerUpsample

        public double getSheetViewerUpsample​(Sheet<?> sheet)
        Returns the upsampling factor to use for a sheet in the sheet viewer. To render a sheet, multiply this by Sheet.getTemplateResolution().
        Parameters:
        sheet - the sheet to determine the upsample factor for
        Returns:
        the suggested upsample factor for the sheet at this quality level
      • applyPreviewWindowHints

        public abstract void applyPreviewWindowHints​(java.awt.Graphics2D g)
      • get

        public static ViewQuality get()
        Returns the current view quality.
        Returns:
        the current quality setting
      • isManagedAutomatically

        public static boolean isManagedAutomatically()
        Returns true if the view quality is set to automatic management mode. When automatic management is enabled, get() will return a fixed value but specific rendering systems may choose to use a different quality setting depending on system performance.
        Returns:
        true if rendering systems may manage performance automatically