interactors
Class RelationInteractor

java.lang.Object
  extended by interactors.Interactor
      extended by interactors.RelationInteractor

public class RelationInteractor
extends Interactor

Interaction for creating a relation between two objects.


Field Summary
 
Fields inherited from class interactors.Interactor
handler
 
Constructor Summary
RelationInteractor(InteractionHandler handler)
          Constructs the relation interactor.
 
Method Summary
private  void createRelation(OntologyObject object1, OntologyObject object2)
          Creates a relation between the given objects.
 void draw(GL gl, GLU glu, GLUT glut)
          Draws a line between the selected object and the current mouse location.
 java.awt.Cursor getCursor()
          Gets the relation cursor.
 void mousePressed(java.awt.event.MouseEvent arg0)
          Left click selects an object if no object is selected.
 
Methods inherited from class interactors.Interactor
endInteraction, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, startInteraction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationInteractor

public RelationInteractor(InteractionHandler handler)
Constructs the relation interactor.

Parameters:
handler - - the interacion handler
Method Detail

draw

public void draw(GL gl,
                 GLU glu,
                 GLUT glut)
Draws a line between the selected object and the current mouse location.

Overrides:
draw in class Interactor

getCursor

public java.awt.Cursor getCursor()
Gets the relation cursor.

Overrides:
getCursor in class Interactor

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Left click selects an object if no object is selected. If an object is currently selected, then left click creates a relation between the previously selected object and the newly selected object. Right click deselects the current object or ends the interaction if no object is selected.

Overrides:
mousePressed in class Interactor

createRelation

private void createRelation(OntologyObject object1,
                            OntologyObject object2)
Creates a relation between the given objects.

Parameters:
object1 - - the first object
object2 - - the second object