vmm.conformalmap
Class ConformalMap.ConformalMapView

java.lang.Object
  extended by vmm.core.View
      extended by vmm.core3D.View3D
          extended by vmm.conformalmap.ConformalMap.ConformalMapView
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
Enclosing class:
ConformalMap

public static class ConformalMap.ConformalMapView
extends View3D

A class that defines the default view for a ConformalMap. This subclass of View3D uses the enableThreeD property of View3D -- that property was introduced to make it possible to switch back and forth between 2D and 3D, which is something that is needed for conformal maps (and possibly nowhere else). See View3D.setEnableThreeD(boolean).


Field Summary
protected  ToggleAction use3DToggle
           
 
Fields inherited from class vmm.core3D.View3D
CROSS_EYE_STEREO_VIEW, leftStereographOSI, MONOCULAR_VIEW, projectionCommands, RED_GREEN_STEREO_VIEW, rightStereographOSI, set3DViewOptionsAction, setViewpointAction, stereoComposite, STEREOGRAPH_VIEW, transform3D, viewStyleCommands
 
Fields inherited from class vmm.core.View
backgroundCommands, buildAnimation, buildingImageForFilmstrip, currentGraphics, decorations, directOffscreenDrawing, fullOSI, needsRedraw, offscreenImageType, parameters, showAxesAction
 
Constructor Summary
ConformalMap.ConformalMapView()
           
 
Method Summary
 void addDecoration(Decoration d)
          Add a decoration that will appear in this View only.
 ActionList getActions()
          Generates a list of "Action commands" that can be applied to this View.
 MouseTask getDefaultMouseTask()
          Overridden to return a mouse task that lets the user switch between the view of the domain grid and the view of the value grid by shift-right-clicking (or shift-command-clicking on a Macintosh).
 boolean getDrawValueGrid()
          Tells whether the value grid (the image of the function) is currently displayed, as opposed to the domain grid.
 boolean getShowBothArgAndValue()
           
 boolean getUse3D()
           
 boolean getUseColor()
          Tells whether grid lines are drawn in colors.
 void readExtraXML(org.w3c.dom.Element viewInfo)
          Overridden to read back the extra transform info.
 void removeFigures()
           
 void setBackground(java.awt.Color c)
          Set the background color that will be used for rendering this view.
 void setDisplay(Display display)
          Set the display where this view draws its exhibit.
 void setExhibit(Exhibit exhibit)
          Set the exhibit shown in this view.
 void setShowAxes(boolean show)
          If set to true, an Axes decoration is added to the View.
 void setShowBothArgAndValue(boolean showBothArgAndValue)
           
 void setUse3D(boolean use3D)
          Sets whether to enable 3D in the view; this method is really not meant to be called except by this class.
 void setUseColor(boolean useColor)
          Set whether to use a range of colors for the grid lines.
 void takeExhibit(View view, boolean shareTransform)
          Set this View to view the same exhibit as another specififed view.
 
Methods inherited from class vmm.core3D.View3D
addExtraXML, clearOSI, clip, createAxes, createOSI, drawCollaredCurve, drawCollaredCurve, drawCollaredCurve, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawPixel, drawPixelDirect, drawPixels, drawString, drawWireframeSurface, finish, finishOSIDraw, finishStereoView, getEnableThreeD, getOrthographicProjection, getSavedAuxiliaryTransformForEnableThreeD, getSettingsCommands, getTransform3D, getViewCommands, getViewPoint, getViewStyle, getViewUp, moveStereographImages, needsNewOSI, prepareOSIForDrawing, putOSI, setEnableThreeD, setOrthographicProjection, setSavedAuxiliaryTransformForEnableThreeD, setTransform, setUpForLeftEye, setUpForRightEye, setViewPoint, setViewStyle, setViewUp, setWindowForUseWhileThreeDDisabled, stateChanged, stereographLeftEyeRect, stereographRightEyeRect
 
Methods inherited from class vmm.core.View
addParameter, beginDrawToOffscreenImage, clearDecorations, doDraw, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawLine, drawLineDirect, drawPixel, drawPixel, drawPixels, drawString, drawString, endDrawToOffscreenImage, fillRectDirect, forceRedraw, getActionsForViewAndExhibit, getAdditionalAnimations, getAdditionalAnimationsForViewAndExhibit, getAntialiased, getApplyGraphics2DTransform, getBackground, getColor, getDecorations, getDisplay, getExhibit, getFastDrawing, getForeground, getImage, getName, getParameterByName, getParameters, getPreserveAspect, getRequestedWindow, getSettingsCommandsForViewAndExhibit, getShowAxes, getStatusText, getTitle, getTransform, getViewAndExhibitParameters, getWindow, parameterChanged, removeDecoration, removeParameter, render, setAntialiased, setApplyGraphics2DTransform, setColor, setFastDrawing, setFastDrawing, setForeground, setName, setPreserveAspect, setStrokeSizeMultiplier, setWindow, setWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

use3DToggle

protected ToggleAction use3DToggle
Constructor Detail

ConformalMap.ConformalMapView

public ConformalMap.ConformalMapView()
Method Detail

removeFigures

public void removeFigures()

setExhibit

public void setExhibit(Exhibit exhibit)
Description copied from class: View3D
Set the exhibit shown in this view. It is overridden in this class to set View3D.transform3D and to manage stereographic viewing if necessary.

Overrides:
setExhibit in class View3D
Parameters:
exhibit - The exhibit to be installed in this View. The value can be null. In that case, no Exhibit will be associated with the View after the method executes. If exhibit is already installed in this View, then no changes are made.
See Also:
Display.install(View, Exhibit)

getUseColor

public boolean getUseColor()
Tells whether grid lines are drawn in colors.


setUseColor

public void setUseColor(boolean useColor)
Set whether to use a range of colors for the grid lines. The alternative is to draw them all using the view's foreground color. (This property is managed by a a checkbox.)


getDrawValueGrid

public boolean getDrawValueGrid()
Tells whether the value grid (the image of the function) is currently displayed, as opposed to the domain grid. (Note that the set method for this property if private.)


getDefaultMouseTask

public MouseTask getDefaultMouseTask()
Overridden to return a mouse task that lets the user switch between the view of the domain grid and the view of the value grid by shift-right-clicking (or shift-command-clicking on a Macintosh).

Overrides:
getDefaultMouseTask in class View3D
Returns:
The value returned in the top-level View class is a BasicMouseTask2D, which allows dragging and zooming of the 2D window.
See Also:
MouseTask

getActions

public ActionList getActions()
Description copied from class: View
Generates a list of "Action commands" that can be applied to this View. The commands must implement the ActionItem interface and will generally belong to one of the classes AbstractActionVMM, ToggleAction, ActionRadioGroup, or ActionList. Null items represent separators. The idea is that the list items will be added to a menu or otherwise presented to the user so that the user can invoke the commands (with ActionList items representing submenus). Null values can occur in the list; they are meant to become separaters in the menu.

Subclasses that override this method should generally call super.getActionss() and add their commands to the list retured by that method. This top-level View class does not define any Action commands; the return value is an empty non-null ArrayList.

Overrides:
getActions in class View

takeExhibit

public void takeExhibit(View view,
                        boolean shareTransform)
Description copied from class: View3D
Set this View to view the same exhibit as another specififed view. This is overridden here to copy the 3D transform from the specified view (if it has one) and to copy its viewStyle if it is a View3D and to properly handle the enableThreeD propety. Since a 3D View cannot make effective use of a 2D transform, the sharedTransform parameter is ignored if the transform in the given view is not a 3D transform.

Overrides:
takeExhibit in class View3D
Parameters:
view - The view whose Exhibit is to be copied. After the method is called, both views will be drawing the same exhibit. If null, then the exhibit of this view will also be set to null.
shareTransform - If true, the two views will share the same Transform, so that changes made to the transform in one will also result in a change in the other.

getUse3D

public boolean getUse3D()

setUse3D

public void setUse3D(boolean use3D)
Sets whether to enable 3D in the view; this method is really not meant to be called except by this class. This method is public only for use with SaveAndRestore.


getShowBothArgAndValue

public boolean getShowBothArgAndValue()

setShowBothArgAndValue

public void setShowBothArgAndValue(boolean showBothArgAndValue)

setDisplay

public void setDisplay(Display display)
Description copied from class: View3D
Set the display where this view draws its exhibit. This is overridden in this class to put the display into stereograpic view mode, if the view is currently set to use sterographic viewing.

Overrides:
setDisplay in class View3D
See Also:
Display.install(View, Exhibit)

setBackground

public void setBackground(java.awt.Color c)
Description copied from class: View
Set the background color that will be used for rendering this view. If the specified color is null, then the default color (white) is used. Note that the background color is automatically reset when an exhibit is installed into this View. If the exhibit is non-null, then the background color is set using Exhibit.getDefaultBackground(); if a null exhibit is installed, the background color is set to white. So, this method is only for adjusting the background color while an exhibit is displayed. Changing the background color will cause a redraw.

In addition to setting the background color, this method will set the foreground color to either black or white, depending on whehter the background color is light or dark. It is possible to change the foreground color to something else after setting the background.

Overrides:
setBackground in class View3D

setShowAxes

public void setShowAxes(boolean show)
Description copied from class: View
If set to true, an Axes decoration is added to the View. When set to false, the decoration is removed. The decoration is actually whatever is returned by the View.createAxes().

Overrides:
setShowAxes in class View

addDecoration

public void addDecoration(Decoration d)
Description copied from class: View
Add a decoration that will appear in this View only. Of course, the decoration must be one that is compatible with the View's Exhibit. Note that adding or removing a Decoration from a View causes a call to forceRedraw.

Specified by:
addDecoration in interface Decorateable
Overrides:
addDecoration in class View
Parameters:
d - The decoration to be added. If this is null or if it has already been added to the View, then nothing is done. The View is added as a ChangeListener to the decoration. This will cause the View to be automatically redrawn when the Decoration is changed.

readExtraXML

public void readExtraXML(org.w3c.dom.Element viewInfo)
                  throws java.io.IOException
Description copied from class: View3D
Overridden to read back the extra transform info.

Overrides:
readExtraXML in class View3D
Parameters:
viewInfo - The <view> element from the XML file that contains the information about this view. Some methods from the SaveAndRestore class might be useful for getting the data.
Throws:
java.io.IOException - If an error is found, an exception of type IOException should be thrown. This will abort the whole processing of the XML file.