Package ca.cgjennings.apps.arkham
Enum ViewQuality
- java.lang.Object
-
- java.lang.Enum<ViewQuality>
-
- ca.cgjennings.apps.arkham.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 staticget()
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 theStrangeEonsAppWindow
. 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()
Returnstrue
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.
-
-
-
Enum Constant Detail
-
LOW
public static final ViewQuality LOW
-
MEDIUM
public static final ViewQuality MEDIUM
-
HIGH
public static final ViewQuality HIGH
-
ULTRAHIGH
public static final ViewQuality ULTRAHIGH
-
-
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 namejava.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 bySheet.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()
Returnstrue
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
-
-