it.polito.elite.visualization.ontoviewer.behaviors
Class MyPickBehaviour

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Leaf
              extended by javax.media.j3d.Behavior
                  extended by it.polito.elite.visualization.ontoviewer.behaviors.MyPickBehaviour

public class MyPickBehaviour
extends javax.media.j3d.Behavior

Listener click mouse


Field Summary
protected  javax.media.j3d.WakeupCriterion[] conditions
           
protected  java.awt.event.MouseEvent mevent
           
protected  com.sun.j3d.utils.picking.PickCanvas pickCanvas
           
private  Scene3D scene
           
protected  javax.media.j3d.WakeupOr wakeupCondition
           
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
MyPickBehaviour(javax.media.j3d.Canvas3D canvas, Scene3D scene)
           
 
Method Summary
 java.awt.event.MouseEvent getMevent()
           
private  void handlePickedObject(java.lang.String uri)
           
private  void handlePickedRelationCone(java.util.HashSet<RelationData> set, int xpos, int ypos)
           
 void initialize()
           
private  void processMouseEvent(java.awt.event.MouseEvent evt)
           
 void processStimulus(java.util.Enumeration criteria)
           
private  void showContextMenu(java.lang.String uri, int xpos, int ypos)
           
 void updateScene(int xpos, int ypos)
          Where the processing is carried out.
 
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

conditions

protected javax.media.j3d.WakeupCriterion[] conditions

mevent

protected java.awt.event.MouseEvent mevent

pickCanvas

protected com.sun.j3d.utils.picking.PickCanvas pickCanvas

scene

private Scene3D scene

wakeupCondition

protected javax.media.j3d.WakeupOr wakeupCondition
Constructor Detail

MyPickBehaviour

public MyPickBehaviour(javax.media.j3d.Canvas3D canvas,
                       Scene3D scene)
Method Detail

getMevent

public java.awt.event.MouseEvent getMevent()

handlePickedObject

private void handlePickedObject(java.lang.String uri)

handlePickedRelationCone

private void handlePickedRelationCone(java.util.HashSet<RelationData> set,
                                      int xpos,
                                      int ypos)

initialize

public void initialize()
Specified by:
initialize in class javax.media.j3d.Behavior

processMouseEvent

private void processMouseEvent(java.awt.event.MouseEvent evt)

processStimulus

public void processStimulus(java.util.Enumeration criteria)
Specified by:
processStimulus in class javax.media.j3d.Behavior

showContextMenu

private void showContextMenu(java.lang.String uri,
                             int xpos,
                             int ypos)

updateScene

public void updateScene(int xpos,
                        int ypos)
Where the processing is carried out. This checks if an object has been picked and if it has prints out the user data for that shape.

Parameters:
xpos - int that stores the x-position of the mouse
ypos - int that stores the y-position of the mouse