it.polito.elite.visualization.ontoviewer.scenes3D
Class SceneFocusTree2

java.lang.Object
  extended by it.polito.elite.visualization.ontoviewer.scenes3D.Scene3D
      extended by it.polito.elite.visualization.ontoviewer.scenes3D.SceneFocusTree2

public class SceneFocusTree2
extends Scene3D


Field Summary
private  java.util.Hashtable<java.lang.String,javax.media.j3d.BranchGroup> conceptsBg
           
private  java.util.Hashtable<java.lang.String,javax.media.j3d.BranchGroup> conceptSpheresBg
           
private  java.util.HashSet<java.lang.String> expandable
           
private  java.lang.String expanded
           
private  javax.media.j3d.BranchGroup fakeBG
           
private  javax.vecmath.Vector3f fakeSpherePosition
           
private  java.util.HashSet<java.lang.String> nodes2_BeDrawn
           
private  java.util.HashSet<java.lang.String> onScene
           
private  boolean redraw
           
private  int sceneRootLvl
           
private  boolean showRelationWithObjectNotOnScene
           
 
Fields inherited from class it.polito.elite.visualization.ontoviewer.scenes3D.Scene3D
behaviorCURS, behaviorROT, behaviorTRAS, behaviorZOOM, bgLabelScene, bgSCENE, currentConceptURI, currentInstanceURI, numScenes, positions, refMainPanel, rootPosition, sceneID, simplePick, tgROT, tgSCENE
 
Constructor Summary
SceneFocusTree2(Pane3DScene _mf, java.lang.String uri)
           
 
Method Summary
private  void attachDrawnNodesToScene(java.util.HashSet<java.lang.String> set)
          procedure which draws the nodes in the internal queue and then clears the queue itself
private  float calculateNewRadius(float angle1, float angle2, float distance)
           
private  void collapseSubTree(java.lang.String uri, ConceptData data)
          Recursive procedure that Collapse a subTree
private  float computeConceptSphereRadius(int subTreeDepth)
           
private  void computeNodePosition(java.lang.String uri, javax.vecmath.Vector3f center)
           
private  javax.media.j3d.Transform3D computeOrientation(javax.vecmath.Vector3f finalPos)
           
private  javax.media.j3d.TransformGroup createFakeConceptSphere(java.lang.String uri, javax.media.j3d.BranchGroup sphereBG)
           
 void createScene()
           
private  javax.media.j3d.BranchGroup drawConcept(java.lang.String uri, ConceptData data, javax.vecmath.Vector3f center, javax.vecmath.Vector3f center_father)
           
private  void drawConceptRelations(javax.media.j3d.BranchGroup bgx, ConceptData data, java.lang.String uri, javax.vecmath.Vector3f center_father)
           
private  void DrawIncomingRelation(javax.media.j3d.TransformGroup tgx, javax.vecmath.Vector3f center_father, java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> arcs, java.lang.String conceptUri, ConceptData data)
           
private  javax.media.j3d.TransformGroup drawISA(javax.media.j3d.TransformGroup tgx, javax.vecmath.Vector3f posFather, javax.vecmath.Vector3f center)
           
private  void DrawOutgoingRelation(javax.media.j3d.TransformGroup tgx, javax.vecmath.Vector3f center_father, java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> arcs, java.lang.String conceptUri, ConceptData data)
           
private  void drawParents(javax.media.j3d.BranchGroup parentBG, ConceptData data)
           
private  void drawRelationsToNodeNotOnScreen(javax.media.j3d.TransformGroup tgx, javax.vecmath.Vector3f center, javax.vecmath.Vector3f center_father, java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> relationsNotOnScreen, float conceptSphereRadius, LinkDirectionEnum dir)
           
private  void drawRelationsToNodeOnScreen(javax.media.j3d.TransformGroup tgx, java.lang.String endUri, javax.vecmath.Vector3f center, ConceptData data, java.util.HashSet<RelationData> relationsSet)
           
private  void DrawSemanticRelation(javax.media.j3d.TransformGroup tgx, ConceptData data, javax.vecmath.Vector3f center_father, java.lang.String conceptUri)
           
 void expand_OR_collapseElement(java.lang.String uri)
           
private  void expandConcept(java.lang.String uri)
          This method expand a concept on the scene that is expandable(a withe one) Such action implies the collapsing of all the nodes except the one in the direct line of ancestor from the current concept to the root.
 void fadeInAnimation()
           
 void fadeOutAnimation(java.lang.String uri, Scene3D nextScene)
           
private  void fadeOutFakeSphere(javax.media.j3d.BranchGroup bgAnimation, long time, javax.vecmath.Vector3f finalPosition, javax.media.j3d.TransformGroup fakeTG, Scene3D nextScene)
           
private  void fadeOutScene(javax.media.j3d.BranchGroup bgAnimation, long time, javax.vecmath.Vector3f center)
           
private  float getSubDistanceRadius(int numberOfChildren)
           
private  float getSubRadius(int numberOfChildren)
           
private  void redraw()
           
private  void removeChildrenFromScene(java.lang.String uri)
           
 void selectElement(java.lang.String uri)
           
private  void setPos(java.lang.String uri, javax.vecmath.Vector3f center, java.lang.String parent, javax.vecmath.Vector3f center_father, boolean propagate)
           
 boolean showContextMenu(java.awt.PopupMenu menu, java.lang.String uri)
           
 boolean showRelationContextMenu(java.awt.PopupMenu menu, java.util.HashSet<RelationData> relSet)
           
 
Methods inherited from class it.polito.elite.visualization.ontoviewer.scenes3D.Scene3D
addBehaviors, addPopUpMenu, addSceneLabel, backToInitialSceneView, centralPositionAtGivenHeightScale, createBGandTGforTheScene, createBranchGroup, createRandomSet, createTransformGroup, get2DTo3DPoint, get3DTo2DPoint, getBounds, getCanvas3DSize, getCurrentConceptURI, getCurrentInstanceURI, getSceneBranchGroup, getSceneID, getShapes, recreateSceneFromScratch, removeBehaviours, removePopUpMenu, repaintCanvas, setCurrentConceptURI, setCurrentInstanceURI, showSelectionPopUp, updateView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conceptsBg

private java.util.Hashtable<java.lang.String,javax.media.j3d.BranchGroup> conceptsBg

conceptSpheresBg

private java.util.Hashtable<java.lang.String,javax.media.j3d.BranchGroup> conceptSpheresBg

expandable

private java.util.HashSet<java.lang.String> expandable

expanded

private java.lang.String expanded

fakeBG

private javax.media.j3d.BranchGroup fakeBG

fakeSpherePosition

private javax.vecmath.Vector3f fakeSpherePosition

nodes2_BeDrawn

private java.util.HashSet<java.lang.String> nodes2_BeDrawn

onScene

private java.util.HashSet<java.lang.String> onScene

redraw

private boolean redraw

sceneRootLvl

private int sceneRootLvl

showRelationWithObjectNotOnScene

private boolean showRelationWithObjectNotOnScene
Constructor Detail

SceneFocusTree2

public SceneFocusTree2(Pane3DScene _mf,
                       java.lang.String uri)
Method Detail

attachDrawnNodesToScene

private void attachDrawnNodesToScene(java.util.HashSet<java.lang.String> set)
procedure which draws the nodes in the internal queue and then clears the queue itself


calculateNewRadius

private float calculateNewRadius(float angle1,
                                 float angle2,
                                 float distance)

collapseSubTree

private void collapseSubTree(java.lang.String uri,
                             ConceptData data)
Recursive procedure that Collapse a subTree

Parameters:
data - Concept that should be collapsed
uri - URI of the concept to be collapsed along with its subtree

computeConceptSphereRadius

private float computeConceptSphereRadius(int subTreeDepth)

computeNodePosition

private void computeNodePosition(java.lang.String uri,
                                 javax.vecmath.Vector3f center)

computeOrientation

private javax.media.j3d.Transform3D computeOrientation(javax.vecmath.Vector3f finalPos)

createFakeConceptSphere

private javax.media.j3d.TransformGroup createFakeConceptSphere(java.lang.String uri,
                                                               javax.media.j3d.BranchGroup sphereBG)

createScene

public void createScene()
Specified by:
createScene in class Scene3D

drawConcept

private javax.media.j3d.BranchGroup drawConcept(java.lang.String uri,
                                                ConceptData data,
                                                javax.vecmath.Vector3f center,
                                                javax.vecmath.Vector3f center_father)

drawConceptRelations

private void drawConceptRelations(javax.media.j3d.BranchGroup bgx,
                                  ConceptData data,
                                  java.lang.String uri,
                                  javax.vecmath.Vector3f center_father)

DrawIncomingRelation

private void DrawIncomingRelation(javax.media.j3d.TransformGroup tgx,
                                  javax.vecmath.Vector3f center_father,
                                  java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> arcs,
                                  java.lang.String conceptUri,
                                  ConceptData data)

drawISA

private javax.media.j3d.TransformGroup drawISA(javax.media.j3d.TransformGroup tgx,
                                               javax.vecmath.Vector3f posFather,
                                               javax.vecmath.Vector3f center)

DrawOutgoingRelation

private void DrawOutgoingRelation(javax.media.j3d.TransformGroup tgx,
                                  javax.vecmath.Vector3f center_father,
                                  java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> arcs,
                                  java.lang.String conceptUri,
                                  ConceptData data)

drawParents

private void drawParents(javax.media.j3d.BranchGroup parentBG,
                         ConceptData data)

drawRelationsToNodeNotOnScreen

private void drawRelationsToNodeNotOnScreen(javax.media.j3d.TransformGroup tgx,
                                            javax.vecmath.Vector3f center,
                                            javax.vecmath.Vector3f center_father,
                                            java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> relationsNotOnScreen,
                                            float conceptSphereRadius,
                                            LinkDirectionEnum dir)

drawRelationsToNodeOnScreen

private void drawRelationsToNodeOnScreen(javax.media.j3d.TransformGroup tgx,
                                         java.lang.String endUri,
                                         javax.vecmath.Vector3f center,
                                         ConceptData data,
                                         java.util.HashSet<RelationData> relationsSet)

DrawSemanticRelation

private void DrawSemanticRelation(javax.media.j3d.TransformGroup tgx,
                                  ConceptData data,
                                  javax.vecmath.Vector3f center_father,
                                  java.lang.String conceptUri)

expand_OR_collapseElement

public void expand_OR_collapseElement(java.lang.String uri)
Specified by:
expand_OR_collapseElement in class Scene3D

expandConcept

private void expandConcept(java.lang.String uri)
This method expand a concept on the scene that is expandable(a withe one) Such action implies the collapsing of all the nodes except the one in the direct line of ancestor from the current concept to the root. A subtree of 3 level depth is drawed beneth the selected concept. The nodes belonging to the ancestor line and the expandable ones in the subtree are saved in an expandable list

Parameters:
uri - the concept to be expanded

fadeInAnimation

public void fadeInAnimation()
Specified by:
fadeInAnimation in class Scene3D

fadeOutAnimation

public void fadeOutAnimation(java.lang.String uri,
                             Scene3D nextScene)
Specified by:
fadeOutAnimation in class Scene3D

fadeOutFakeSphere

private void fadeOutFakeSphere(javax.media.j3d.BranchGroup bgAnimation,
                               long time,
                               javax.vecmath.Vector3f finalPosition,
                               javax.media.j3d.TransformGroup fakeTG,
                               Scene3D nextScene)

fadeOutScene

private void fadeOutScene(javax.media.j3d.BranchGroup bgAnimation,
                          long time,
                          javax.vecmath.Vector3f center)

getSubDistanceRadius

private float getSubDistanceRadius(int numberOfChildren)

getSubRadius

private float getSubRadius(int numberOfChildren)

redraw

private void redraw()

removeChildrenFromScene

private void removeChildrenFromScene(java.lang.String uri)

selectElement

public void selectElement(java.lang.String uri)
Specified by:
selectElement in class Scene3D

setPos

private void setPos(java.lang.String uri,
                    javax.vecmath.Vector3f center,
                    java.lang.String parent,
                    javax.vecmath.Vector3f center_father,
                    boolean propagate)

showContextMenu

public boolean showContextMenu(java.awt.PopupMenu menu,
                               java.lang.String uri)
Specified by:
showContextMenu in class Scene3D

showRelationContextMenu

public boolean showRelationContextMenu(java.awt.PopupMenu menu,
                                       java.util.HashSet<RelationData> relSet)
Specified by:
showRelationContextMenu in class Scene3D