visad.java2d
Class GraphicsModeControlJ2D

java.lang.Object
  extended by visad.Control
      extended by visad.GraphicsModeControl
          extended by visad.java2d.GraphicsModeControlJ2D
All Implemented Interfaces:
Serializable, Cloneable

public class GraphicsModeControlJ2D
extends GraphicsModeControl

GraphicsModeControlJ2D is the VisAD class for controlling various mode settings for rendering.

A GraphicsModeControlJ2D is not linked to any DisplayRealType or ScalarMap. It is linked to a DisplayImpl.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class visad.GraphicsModeControl
AVERAGE_COLOR_MODE, DASH_DOT_STYLE, DASH_STYLE, DOT_STYLE, SOLID_STYLE, STACK2D, SUM_COLOR_MODE, TEXTURE3D
 
Constructor Summary
GraphicsModeControlJ2D(DisplayImpl d)
           
 
Method Summary
 Object clone()
          A method to copy this object
 boolean equals(Object o)
          Indicates whether or not this instance equals an Object
 boolean getAdjustProjectionSeam()
          See if VisADGeometryArray.adjustLongitude/Seam should be used
 boolean getCacheAppearances()
          Get whether Appearances are cached or not
 int getColorMode()
          Get the color mode used for combining color values.
 int getCurvedSize()
          Get the undersampling factor of surface shape for curved texture maps
 int getLineStyle()
          Get the current line style used for LineAttributes.
 float getLineWidth()
          Get the current line width used for LineAttributes.
 boolean getMergeGeometries()
          Set whether Geometries for shapes should be merged into Group
 boolean getMissingTransparent()
          See whether missing values are rendered as transparent or not.
 boolean getMode2D()
          Get the 2D mode of the display.
 boolean getPointMode()
          Gets the point mode.
 float getPointSize()
          Get the current point size used for PointAttributes.
 int getPolygonMode()
          Get the current polygon mode.
 float getPolygonOffset()
          Get the current polygon offset.
 float getPolygonOffsetFactor()
          Get the current polygon offset factor.
 int getProjectionPolicy()
          Get the current projection policy for the display.
 boolean getScaleEnable()
          Get whether display scales are enabled or not
 int getTexture3DMode()
          Get the mode for Texture3D for volume rendering
 boolean getTextureEnable()
          See if texture mapping is enabled or not
 int getTransparencyMode()
          Get the current transparency mode
 void setAdjustProjectionSeam(boolean adjust)
          Set whether VisADGeometryArray.adjustLongitude/Seam should be used.
 void setCacheAppearances(boolean cache)
          Set whether the Appearances are reused
 void setColorMode(int mode)
          Set the color mode used for combining color values.
 void setCurvedSize(int curved_size)
          Set the undersampling factor of surface shape for curved texture maps
 void setLineStyle(int style)
          Set the line style used for LineAttributes.
 void setLineStyle(int style, boolean noChange)
          Set the line style used for LineAttributes.
 void setLineWidth(float width)
          Set the line width used for LineAttributes.
 void setLineWidth(float width, boolean noChange)
          Set the line width used for LineAttributes.
 void setMergeGeometries(boolean merge)
          Set whether Geometries for shapes should be merged into Group if possible to reduce memory use.
 void setMissingTransparent(boolean missing)
          Set the transparency of missing values.
 void setPointMode(boolean mode)
          Sets the point mode and updates the display.
 void setPointSize(float size)
          Set the point size used for PointAttributes.
 void setPointSize(float size, boolean noChange)
          Set the point size used for PointAttributes.
 void setPolygonMode(int mode)
          Sets the polygon mode.
 void setPolygonMode(int mode, boolean noChange)
          Sets the polygon mode.
 void setPolygonOffset(float polygonOffset)
          Sets the polygon offset and updates the display.
 void setPolygonOffset(float polygonOffset, boolean noChange)
          Sets the polygon offset.
 void setPolygonOffsetFactor(float polygonOffsetFactor)
          Sets the polygon offset factor.
 void setPolygonOffsetFactor(float polygonOffsetFactor, boolean noChange)
          Sets the polygon offset factor.
 void setProjectionPolicy(int policy)
          Sets the projection policy for the display.
 void setScaleEnable(boolean enable)
          Toggle the axis scales in the display
 void setTexture3DMode(int mode)
          Set the mode for Texture3D for volume rendering
 void setTextureEnable(boolean enable)
          Set whether texture mapping should be used or not.
 void setTransparencyMode(int mode)
          Sets the transparency mode.
 void syncControl(Control rmt)
          copy the state of a remote control to this control
 String toString()
           
 
Methods inherited from class visad.GraphicsModeControl
getSaveString, setSaveString
 
Methods inherited from class visad.Control
addControlListener, animation_string, changeControl, checkTicks, getDisplay, getDisplayRenderer, getInstanceNumber, incTick, nullControl, peekTicks, removeControlListener, resetTicks, setTicks, subCheckTicks, subPeekTicks, subResetTicks, subSetTicks
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphicsModeControlJ2D

public GraphicsModeControlJ2D(DisplayImpl d)
Method Detail

getMode2D

public boolean getMode2D()
Description copied from class: GraphicsModeControl
Get the 2D mode of the display.

Specified by:
getMode2D in class GraphicsModeControl
Returns:
true if display has a 2D mode.

getLineWidth

public float getLineWidth()
Get the current line width used for LineAttributes. The default is 1.0.

Specified by:
getLineWidth in class GraphicsModeControl
Returns:
line width (>= 1.0)

setLineWidth

public void setLineWidth(float width)
                  throws VisADException,
                         RemoteException
Set the line width used for LineAttributes. Calls changeControl and resets the display.

Specified by:
setLineWidth in class GraphicsModeControl
Parameters:
width - width to use (>= 1.0)
Throws:
VisADException - couldn't set the line width on local display
RemoteException - couldn't set the line width on remote display

setLineWidth

public void setLineWidth(float width,
                         boolean noChange)
Set the line width used for LineAttributes. Does not update display.

Specified by:
setLineWidth in class GraphicsModeControl
Parameters:
width - width to use (>= 1.0)
noChange - dummy flag

getPointSize

public float getPointSize()
Get the current point size used for PointAttributes. The default is 1.0.

Specified by:
getPointSize in class GraphicsModeControl
Returns:
point size (>= 1.0)

setPointSize

public void setPointSize(float size)
                  throws VisADException,
                         RemoteException
Set the point size used for PointAttributes. Calls changeControl and updates the display.

Specified by:
setPointSize in class GraphicsModeControl
Parameters:
size - size to use (>= 1.0)
Throws:
VisADException - couldn't set the point size on local display
RemoteException - couldn't set the point size on remote display

setPointSize

public void setPointSize(float size,
                         boolean noChange)
Set the point size used for PointAttributes. Doesn't update the display.

Specified by:
setPointSize in class GraphicsModeControl
Parameters:
size - size to use (>= 1.0)
noChange - dummy flag

getLineStyle

public int getLineStyle()
Get the current line style used for LineAttributes. The default is GraphicsModeControl.SOLID_STYLE.

Specified by:
getLineStyle in class GraphicsModeControl
Returns:
line style (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)

setLineStyle

public void setLineStyle(int style)
                  throws VisADException,
                         RemoteException
Set the line style used for LineAttributes. Calls changeControl and resets the display.

Specified by:
setLineStyle in class GraphicsModeControl
Parameters:
style - style to use (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)
Throws:
VisADException - couldn't set the line style on local display
RemoteException - couldn't set the line style on remote display

setLineStyle

public void setLineStyle(int style,
                         boolean noChange)
Set the line style used for LineAttributes. Does not update display.

Specified by:
setLineStyle in class GraphicsModeControl
Parameters:
style - style to use (SOLID_STYLE, DASH_STYLE, DOT_STYLE or DASH_DOT_STYLE)
noChange - dummy flag

getColorMode

public int getColorMode()
Get the color mode used for combining color values. The default is GraphicsModeControl.AVERAGE_COLOR_MODE.

Specified by:
getColorMode in class GraphicsModeControl
Returns:
color mode (AVERAGE_COLOR_MODE or SUM_COLOR_MODE)

setColorMode

public void setColorMode(int mode)
                  throws VisADException,
                         RemoteException
Set the color mode used for combining color values.

Specified by:
setColorMode in class GraphicsModeControl
Parameters:
mode - mode to use (AVERAGE_COLOR_MODE or SUM_COLOR_MODE)
Throws:
VisADException - unable to set color mode
RemoteException - unable to set color mode on remote display

getPointMode

public boolean getPointMode()
Gets the point mode.

Specified by:
getPointMode in class GraphicsModeControl
Returns:
True if the display is using points rather than connected lines or surfaces for rendering.

setPointMode

public void setPointMode(boolean mode)
                  throws VisADException,
                         RemoteException
Sets the point mode and updates the display.

Specified by:
setPointMode in class GraphicsModeControl
Parameters:
mode - true if the display should use points rather than connected lines or surfaces for rendering.
Throws:
VisADException - unable to enable point mode
RemoteException - unable to enable point mode on remote display

setTextureEnable

public void setTextureEnable(boolean enable)
                      throws VisADException,
                             RemoteException
Set whether texture mapping should be used or not.

Specified by:
setTextureEnable in class GraphicsModeControl
Parameters:
enable - true to use texture mapping (the default)
Throws:
VisADException - unable to enable texture mapping
RemoteException - unable to enable texture mapping on remote display

getTextureEnable

public boolean getTextureEnable()
See if texture mapping is enabled or not

Specified by:
getTextureEnable in class GraphicsModeControl
Returns:
true if texture mapping is enabled.

setScaleEnable

public void setScaleEnable(boolean enable)
                    throws VisADException,
                           RemoteException
Toggle the axis scales in the display

Specified by:
setScaleEnable in class GraphicsModeControl
Parameters:
enable - true to enable, false to disable
Throws:
VisADException - couldn't change state of scale enablement
RemoteException - couldn't change state of scale enablement on remote display

getScaleEnable

public boolean getScaleEnable()
Get whether display scales are enabled or not

Specified by:
getScaleEnable in class GraphicsModeControl
Returns:
true if enabled, otherwise false

getTransparencyMode

public int getTransparencyMode()
Get the current transparency mode

Specified by:
getTransparencyMode in class GraphicsModeControl
Returns:
transparency mode

setTransparencyMode

public void setTransparencyMode(int mode)
                         throws VisADException,
                                RemoteException
Sets the transparency mode.

Specified by:
setTransparencyMode in class GraphicsModeControl
Parameters:
mode - transparency mode to use. Legal value = 0.
Throws:
VisADException - bad mode or couldn't create necessary VisAD object
RemoteException - couldn't create necessary remote object

setProjectionPolicy

public void setProjectionPolicy(int policy)
                         throws VisADException,
                                RemoteException
Sets the projection policy for the display.

Specified by:
setProjectionPolicy in class GraphicsModeControl
Parameters:
policy - policy to be used
Throws:
VisADException - bad policy or can't create the necessary VisAD object
RemoteException - change policy on remote display

getProjectionPolicy

public int getProjectionPolicy()
Get the current projection policy for the display.

Specified by:
getProjectionPolicy in class GraphicsModeControl
Returns:
policy

setPolygonMode

public void setPolygonMode(int mode)
                    throws VisADException,
                           RemoteException
Sets the polygon mode.

Specified by:
setPolygonMode in class GraphicsModeControl
Parameters:
mode - the polygon mode to be used
Throws:
VisADException - bad mode or can't create the necessary VisAD object
RemoteException - can't change mode on remote display

setPolygonMode

public void setPolygonMode(int mode,
                           boolean noChange)
Sets the polygon mode. Does not update the display

Specified by:
setPolygonMode in class GraphicsModeControl
Parameters:
mode - the polygon mode to be used
noChange - dummy flag
Throws:
VisADException - bad mode or can't create the necessary VisAD object
RemoteException - can't change mode on remote display

getPolygonMode

public int getPolygonMode()
Get the current polygon mode.

Specified by:
getPolygonMode in class GraphicsModeControl
Returns:
mode

setPolygonOffset

public void setPolygonOffset(float polygonOffset)
                      throws VisADException,
                             RemoteException
Sets the polygon offset and updates the display.

Specified by:
setPolygonOffset in class GraphicsModeControl
Parameters:
polygonOffset - the polygon offset to be used
Throws:
VisADException - bad offset
RemoteException - can't change offset on remote display

setPolygonOffset

public void setPolygonOffset(float polygonOffset,
                             boolean noChange)
Sets the polygon offset.

Specified by:
setPolygonOffset in class GraphicsModeControl
Parameters:
polygonOffset - the polygon offset to be used
noChange - dummy variable

getPolygonOffset

public float getPolygonOffset()
Get the current polygon offset.

Specified by:
getPolygonOffset in class GraphicsModeControl
Returns:
offset

setPolygonOffsetFactor

public void setPolygonOffsetFactor(float polygonOffsetFactor)
                            throws VisADException,
                                   RemoteException
Sets the polygon offset factor.

Specified by:
setPolygonOffsetFactor in class GraphicsModeControl
Parameters:
polygonOffsetFactor - the polygon offset factor to be used
Throws:
VisADException - bad offset factor with change
RemoteException - can't change mode on remote display

setPolygonOffsetFactor

public void setPolygonOffsetFactor(float polygonOffsetFactor,
                                   boolean noChange)
Sets the polygon offset factor.

Specified by:
setPolygonOffsetFactor in class GraphicsModeControl
Parameters:
polygonOffsetFactor - the polygon offset factor to be used
noChange - dummy variable
Throws:
VisADException - bad offset factor with change
RemoteException - can't change offset on remote display

getPolygonOffsetFactor

public float getPolygonOffsetFactor()
Get the current polygon offset factor.

Specified by:
getPolygonOffsetFactor in class GraphicsModeControl
Returns:
offset

getMissingTransparent

public boolean getMissingTransparent()
See whether missing values are rendered as transparent or not.

Specified by:
getMissingTransparent in class GraphicsModeControl
Returns:
true if missing values are transparent.

setMissingTransparent

public void setMissingTransparent(boolean missing)
                           throws VisADException,
                                  RemoteException
Set the transparency of missing values.

Specified by:
setMissingTransparent in class GraphicsModeControl
Parameters:
missing - true if missing values should be rendered transparent.
Throws:
VisADException - Unable to change missing transparent
RemoteException - can't change missing transparent on remote display

getCurvedSize

public int getCurvedSize()
Get the undersampling factor of surface shape for curved texture maps

Specified by:
getCurvedSize in class GraphicsModeControl
Returns:
undersampling factor (default 10)

setCurvedSize

public void setCurvedSize(int curved_size)
Set the undersampling factor of surface shape for curved texture maps

Specified by:
setCurvedSize in class GraphicsModeControl
Parameters:
curved_size - undersampling factor (default 10)

setAdjustProjectionSeam

public void setAdjustProjectionSeam(boolean adjust)
                             throws VisADException,
                                    RemoteException
Set whether VisADGeometryArray.adjustLongitude/Seam should be used.

Specified by:
setAdjustProjectionSeam in class GraphicsModeControl
Parameters:
adjust - true to use adjust methods
Throws:
VisADException - Unable to change adjust seam property
RemoteException - can't change adjust seam property on remote display

getAdjustProjectionSeam

public boolean getAdjustProjectionSeam()
See if VisADGeometryArray.adjustLongitude/Seam should be used

Specified by:
getAdjustProjectionSeam in class GraphicsModeControl
Returns:
true if adjust methods should be used

setTexture3DMode

public void setTexture3DMode(int mode)
                      throws VisADException,
                             RemoteException
Set the mode for Texture3D for volume rendering

Specified by:
setTexture3DMode in class GraphicsModeControl
Parameters:
mode - mode for Texture3D (STACK2D or TEXTURE3D)
Throws:
VisADException - Unable to change Texture3D mode
RemoteException - can't change Texture3D mode on remote display

setCacheAppearances

public void setCacheAppearances(boolean cache)
Set whether the Appearances are reused

Specified by:
setCacheAppearances in class GraphicsModeControl
Parameters:
cache - true to cache and reuse appearances
Throws:
VisADException - Unable to change caching
RemoteException - can't change caching on remote display

getCacheAppearances

public boolean getCacheAppearances()
Get whether Appearances are cached or not

Specified by:
getCacheAppearances in class GraphicsModeControl
Returns:
true if caching

setMergeGeometries

public void setMergeGeometries(boolean merge)
Set whether Geometries for shapes should be merged into Group if possible to reduce memory use.

Specified by:
setMergeGeometries in class GraphicsModeControl
Parameters:
merge - true to merge geometries if possible
Throws:
VisADException - Unable to change caching
RemoteException - can't change caching on remote display

getMergeGeometries

public boolean getMergeGeometries()
Set whether Geometries for shapes should be merged into Group

Specified by:
getMergeGeometries in class GraphicsModeControl
Returns:
true if merging is used

getTexture3DMode

public int getTexture3DMode()
Get the mode for Texture3D for volume rendering

Specified by:
getTexture3DMode in class GraphicsModeControl
Returns:
mode for Texture3D (e.g., STACK2D or TEXTURE3D)

clone

public Object clone()
Description copied from class: GraphicsModeControl
A method to copy this object

Specified by:
clone in class GraphicsModeControl
Returns:
a copy of this object

syncControl

public void syncControl(Control rmt)
                 throws VisADException
copy the state of a remote control to this control

Specified by:
syncControl in class Control
Parameters:
rmt - remote Control whose state is copied
Throws:
VisADException - if a VisAD error occurs

equals

public boolean equals(Object o)
Description copied from class: Control
Indicates whether or not this instance equals an Object

Overrides:
equals in class Control
Parameters:
o - an Object
Returns:
true if and only if this instance is equal to o

toString

public String toString()
Overrides:
toString in class Control
Returns:
a simple String representation of this Control