|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsyn3d.base.ActiveNode
syn3d.nodes.GroupNode
syn3d.nodes.SceneNode
public class SceneNode
Nested Class Summary | |
---|---|
protected class |
SceneNode.SceneTimerTask
Notify listeners that this scene has changed. |
Field Summary | |
---|---|
protected static int |
anonymousSceneNumber
|
protected ListenerManager |
dirtyNodes
An array of Dirty nodes to update before calling listeners The dirty nodes are then automatically removed from this array, as they're supposed to be cleaned up |
protected java.lang.String |
fileName
Current file name used for saving the scene |
static int |
FLY_BY_MODE
In fly-by mode, the user can freely move in the scene. |
protected static javax.swing.Icon |
icon
|
protected ListenerManager |
listeners
An array of UniverseChangeListener objects |
static int |
REFRESH_PERIOD
|
protected long |
refreshPeriod
|
protected boolean |
refreshPeriodChanged
True when the user has changed the period for refreshing the scene> |
static int |
ROTATION_MODE
In rotation mode, the user rotates the whole scene and can zoom in or out. |
protected java.util.Timer |
timer
This timer is used to gather notify events and send them at a reasonable rate to 3D motors. |
protected int |
viewingMode
|
Fields inherited from class syn3d.base.ActiveNode |
---|
children, name, parent |
Constructor Summary | |
---|---|
SceneNode(ActiveNode parent)
|
Method Summary | |
---|---|
void |
addDirtyNode(DirtyNode node)
|
void |
addListener(SceneChangeListener dsl)
|
void |
autoZoom()
Auto zooms the scene out of all objects |
void |
changeProjection()
Turns perspective on an off |
void |
doAction(java.lang.Object action)
When the user has selected an action in the list return by getActions(), this method is called. |
java.util.List |
getActions()
Returns a list of possible actions on this node. |
javax.swing.Icon |
getIcon()
Utility method to specialize the swing tree renderer. |
long |
getRefreshPeriod()
|
static SceneNode |
getScene(ActiveNode node)
Use this function to get the scene containing this node |
int |
getViewingMode()
|
void |
init2DPosition(int posX,
int posY)
Initialize 2D rotation algorithm with the current position as origin. |
boolean |
isVisible()
|
void |
notificationEnd(java.lang.Object referer)
Register the scene as the unique listener for data events in the whole scene graph. |
protected void |
notifyChange()
|
void |
notifyListeners()
Call this when the scene changed, to notify all registered listeners |
ActiveNode |
pick(int posX,
int posY)
Selects a single pick at the given position. |
protected void |
propagateHighlightEvent(ActiveNode node,
boolean on)
Catch highlight events as this can cause repaint. |
protected void |
propagateInternalChangeEvent(ActiveNode node)
Receive change notification events for objects in this scene and propagate them to this scene listeners. |
void |
remove()
Removes this node from the parent list. |
void |
removeDirtyNode(DirtyNode node)
|
void |
removeListener(SceneChangeListener dsl)
|
void |
reset()
Reset all values to default |
void |
restoreReferences(ActiveNode parent)
Restore a serialized object to the scene graph. |
void |
restoreScene(PluginManager pm)
Restore scene : subclasses can restore the scene once all ActiveNOde have been initialised |
void |
rotate2D(int newX,
int newY)
Does a rotation of the scene according to moves in a 2D coordinate system. |
boolean |
saveChildren()
The scene/swing tree is serialized from root to leaf, hierachically. |
void |
setRefreshPeriod(long period)
|
void |
setViewingMode(int viewingMode)
|
void |
setVisible(boolean status)
|
java.util.ArrayList |
toggleAllPicks(int posX,
int posY)
Adds or removes all picks between the given position and the last position, to the selected objects. |
java.util.ArrayList |
toggleSinglePick(int posX,
int posY)
Adds or removes a single pick at the given position to the selected objects. |
void |
translate2D(int newX,
int newY)
Does a translation of the scene according to moves in a 2D coordinate system. |
void |
zoom(int zoomIncrement)
Zooms in or out of the scene according to the increment. |
void |
zoom2D(int newX,
int newY)
Uses the 2D increments in position to compute a zoom factor, then zooms the scene accordingly. |
Methods inherited from class syn3d.nodes.GroupNode |
---|
getScene |
Methods inherited from class syn3d.base.ActiveNode |
---|
addChild, findDescendantOfType, findDescendantOfType, get3DObject, getChildren, getName, getParent, highlight, notifyInternalChange, notifyStructuralChange, propagateAddChildEvent, propagateChangeNameEvent, propagateRemoveChildEvent, propagateStructuralChangeEvent, removeChild, removeNodeTree, removeNodeTreeFrom, setName, setParent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ROTATION_MODE
public static final int FLY_BY_MODE
protected int viewingMode
protected java.lang.String fileName
protected transient ListenerManager listeners
protected transient ListenerManager dirtyNodes
protected static int anonymousSceneNumber
protected transient java.util.Timer timer
protected boolean refreshPeriodChanged
public static int REFRESH_PERIOD
protected long refreshPeriod
protected static javax.swing.Icon icon
Constructor Detail |
---|
public SceneNode(ActiveNode parent)
Method Detail |
---|
public int getViewingMode()
public void setViewingMode(int viewingMode)
viewingMode
- The viewingMode to set.public void restoreScene(PluginManager pm)
public static SceneNode getScene(ActiveNode node)
node
- A node whose scene is unknown
public java.util.List getActions()
ActiveNode
getActions
in class ActiveNode
public void doAction(java.lang.Object action)
ActiveNode
doAction
in class ActiveNode
action
- An action previously declared by the getActions method.public boolean isVisible()
public void setVisible(boolean status)
public void setRefreshPeriod(long period)
public long getRefreshPeriod()
public javax.swing.Icon getIcon()
ActiveNode
getIcon
in class ActiveNode
public void restoreReferences(ActiveNode parent)
ActiveNode
restoreReferences
in class ActiveNode
parent
- The active node to attach this one to once it has been successfully de-serializedpublic boolean saveChildren()
ActiveNode
saveChildren
in class ActiveNode
public void notificationEnd(java.lang.Object referer)
notificationEnd
in interface EndNotificationListener
protected void notifyChange()
public void remove()
remove
in class ActiveNode
public void addListener(SceneChangeListener dsl)
public void removeListener(SceneChangeListener dsl)
public void addDirtyNode(DirtyNode node)
public void removeDirtyNode(DirtyNode node)
public void notifyListeners()
protected void propagateInternalChangeEvent(ActiveNode node)
propagateInternalChangeEvent
in class ActiveNode
protected void propagateHighlightEvent(ActiveNode node, boolean on)
propagateHighlightEvent
in class ActiveNode
public void init2DPosition(int posX, int posY)
public void rotate2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void translate2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void zoom2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void zoom(int zoomIncrement)
zoomIncrement
- A value typically 1 or -1, but which can be greater for fast zooms.
Positive values zoom in, negative values zoom out.public void changeProjection()
public void reset()
public void autoZoom()
public java.util.ArrayList toggleSinglePick(int posX, int posY)
posX
- the 2D X position where to do the pickingposY
- the 2D Y position where to do the picking
ActiveNode.higlight(boolean,Object)
public java.util.ArrayList toggleAllPicks(int posX, int posY)
posX
- the 2D X position defining a region with the last position. All objects in this region should be picked.posX
- the 2D Y position defining a region with the last position. All objects in this region should be picked.
ActiveNode.higlight(boolean,Object)
public ActiveNode pick(int posX, int posY)
posX
- the 2D X position where to do the pickingposY
- the 2D Y position where to do the picking
ActiveNode.higlight(boolean,Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |