|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.View vmm.ode.ODE_2D.ODEView
public class ODE_2D.ODEView
Represents the default view for an ODEFirstOrder2D.
Field Summary | |
---|---|
protected ToggleAction |
animateDrawingToggle
|
protected ToggleAction |
connectDotsToggle
|
protected AbstractActionVMM |
continueOrbitAction
|
protected AbstractActionVMM |
eraseOrbitsAction
|
protected ActionRadioGroup |
orbitTypeSelect
|
protected ToggleAction |
showControlPanelToggle
|
protected ToggleAction |
showDirectionFieldToggle
|
protected ToggleAction |
showProjectedOrbitsToggle
|
Fields inherited from class vmm.core.View |
---|
backgroundCommands, buildAnimation, buildingImageForFilmstrip, currentGraphics, decorations, directOffscreenDrawing, fullOSI, needsRedraw, offscreenImageType, parameters, showAxesAction |
Constructor Summary | |
---|---|
ODE_2D.ODEView()
|
Method Summary | |
---|---|
void |
addExtraXML(org.w3c.dom.Document containingDocument,
org.w3c.dom.Element viewElement)
This method is called when an XML representation of this view is being constructed by the SaveAndRestore class to give the View a chance to add any extra infomation that
is not saved by default. |
ActionList |
getActions()
Generates a list of "Action commands" that can be applied to this View. |
boolean |
getAnimateDrawing()
|
boolean |
getConnectDotsOnOrbit()
Tells whether orbits should be drawn as dots or as solid lines. |
protected vmm.ode.ODE_2D.Orbit |
getCurrentOrbit()
Returns the current orbit (shown in green), if any. |
double |
getCurrentTimeFromControlPanel()
|
MouseTask |
getDefaultMouseTask()
Returns a MouseTask that can be installed in the Display attached to this View. |
int |
getOrbitType()
|
boolean |
getShowControlPanel()
|
boolean |
getShowDirectionField()
|
boolean |
getShowProjectedOrbits()
|
void |
readExtraXML(org.w3c.dom.Element viewInfo)
This method is called when this View is being reconstructed from an XML representation by the SaveAndRestore class. |
void |
setAnimateDrawing(boolean animateDrawing)
|
void |
setConnectDotsOnOrbit(boolean connectDotsOnOrbit)
Set the property that tells whether an orbit should be drawn simply as a sequence of dots, or the dots should be connected to make a solid curve. |
protected void |
setCurrentOrbit(vmm.ode.ODE_2D.Orbit orbit)
Sets the current orbit (shown in green). |
void |
setDisplay(Display display)
Sets the Display where this View is installed. |
void |
setExhibit(Exhibit ex)
Set the Exhibit that is shown in this View. |
void |
setOrbitType(int type)
|
void |
setShowControlPanel(boolean showControlPanel)
|
void |
setShowDirectionField(boolean showDirectionField)
The showDirectionField property determines whether a direction field is drawn for the exhibit in this view. |
void |
setShowProjectedOrbits(boolean showProjectedOrbits)
When the showProjectedOrbits property is true, an auxiliary view is added to the bottom of the display where the x- and y-coordinates of the points on the current orbit are plotted. |
void |
startOrbitAtPoint(double[] initialPointData)
|
void |
stateChanged(javax.swing.event.ChangeEvent evt)
A View listens for state change events that are generated when the Exhibit or Decoration that it is displaying is changed, or by the transform (that converts real coords to pixel coords). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ToggleAction showDirectionFieldToggle
protected ToggleAction showProjectedOrbitsToggle
protected ToggleAction animateDrawingToggle
protected ToggleAction showControlPanelToggle
protected AbstractActionVMM continueOrbitAction
protected ToggleAction connectDotsToggle
protected AbstractActionVMM eraseOrbitsAction
protected ActionRadioGroup orbitTypeSelect
Constructor Detail |
---|
public ODE_2D.ODEView()
Method Detail |
---|
public boolean getShowDirectionField()
public void setShowDirectionField(boolean showDirectionField)
public boolean getAnimateDrawing()
public void setAnimateDrawing(boolean animateDrawing)
protected vmm.ode.ODE_2D.Orbit getCurrentOrbit()
protected void setCurrentOrbit(vmm.ode.ODE_2D.Orbit orbit)
public boolean getConnectDotsOnOrbit()
setConnectDotsOnOrbit(boolean)
public void setConnectDotsOnOrbit(boolean connectDotsOnOrbit)
public boolean getShowProjectedOrbits()
public int getOrbitType()
public void setOrbitType(int type)
public boolean getShowControlPanel()
public void setShowControlPanel(boolean showControlPanel)
public void setShowProjectedOrbits(boolean showProjectedOrbits)
public ActionList getActions()
View
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.
getActions
in class View
public void setDisplay(Display display)
View
install
method in the Display class, which is used to install a
View into a Display. It is not meant to be called directly (since that would bypass a lot of
the set-up performed automatically by the install
method).
setDisplay
in class View
Display.install(View, Exhibit)
public void setExhibit(Exhibit ex)
View
repaint
method is called.
This setExhibit method will be called automatically when an Exhibit is installed in a Display;
although it might be called directly, that would be much less usual since it would
by-pass all the set-up that is done automatically by the Display's install
method.
If the exhibit is non-null, then the foreground and background colors of the view are set to the default foreground and background colors of the exhibit. If the exhibit is null, then the view's foreground and background are set to black and white.
Note when overriding this method: You should almost certainly start by saying "if (exhibit == getExhibit()) return". That is, in general, this method should do nothing when the exhibit that is being installed is already installed.
setExhibit
in class View
ex
- 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.Display.install(View, Exhibit)
public void stateChanged(javax.swing.event.ChangeEvent evt)
View
stateChanged
in interface javax.swing.event.ChangeListener
stateChanged
in class View
View.forceRedraw()
public MouseTask getDefaultMouseTask()
View
getDefaultMouseTask
in class View
BasicMouseTask2D
, which allows
dragging and zooming of the 2D window.MouseTask
public double getCurrentTimeFromControlPanel()
public void startOrbitAtPoint(double[] initialPointData)
public void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)
View
SaveAndRestore
class to give the View a chance to add any extra infomation that
is not saved by default. Any Parameters associated with the View are
saved automatically, as are the transform and the applyGraphics2DTransform,
antialiased, and preserveAspect properties. Decorations associated with the View are
not saved automatically UNLESS they are marked with the VMMSave
annotation. Property variables will also be saved automatically IF they are marked
with VMMSave
annotations.
The method in this top-level View class does nothing.
When a subclass overrides this method, it should start by calling super.addExtraXML(containingDocument,viewElement) to make sure that information from the superclass is saved.
addExtraXML
in class View
containingDocument
- The overall XML document that contains the view Element that is being created.
This parameter is necessary because it is needed to create any nested subelements that are to be added
to the view element.viewElement
- The XML element that is being constructed. This element already exists; the
purpose of this method to add any extra information that would be needed to reconstruct this view
object from the XML represenation.View.readExtraXML(Element)
public void readExtraXML(org.w3c.dom.Element viewInfo) throws java.io.IOException
View
SaveAndRestore
class. The View object has already been created, and default information
(parameters, colors, and transform) have been retrieved.
This method is responsible
for retrieving any data that was written by View.addExtraXML(Document, Element)
,
except that properties written with SaveAndRestore.addProperty(Object, String, Document, Element)
are retrieved automatically, and decorations written with SaveAndRestore.addDecorationElement(Document, Element, Decoration)
are retrieved automatically.
The method in this top-level View class does nothing.
In general, when a subclass overrides this method, it should be sure to call super.readExtraXML(viewInfo).
readExtraXML
in class View
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.
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |