interactors
Class CoordinatesInteractor

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

public class CoordinatesInteractor
extends Interactor

Interaction for modifying the coordinates of an object.


Field Summary
(package private)  float[] coords
          the coordinates of the selected object
(package private)  int selected
          the index of the currently selected vertex
 
Fields inherited from class interactors.Interactor
handler
 
Constructor Summary
CoordinatesInteractor(InteractionHandler handler)
          Constructs the coordinates interactor.
 
Method Summary
 void draw(GL gl, GLU glu, GLUT glut)
          Draws the coordinates of the selected object.
 java.awt.Cursor getCursor()
          Gets the coordinates cursor.
 void keyPressed(java.awt.event.KeyEvent arg0)
          Overrides the key shortcuts.
 void mouseDragged(java.awt.event.MouseEvent arg0)
          If a vertex is selected, then a mouse drag moves the selected vertex.
 void mousePressed(java.awt.event.MouseEvent arg0)
          Processes mouse presses: - Left click selects a new object if no object is selected - Left click without control down selects a coordinate if an object is currently selected - Left click with control down add a new coordinate to the selected object - Right click deselcted the current vertex if a vertex is selected, deselects the current object or ends the interaction if no object is selecteed
 void mouseReleased(java.awt.event.MouseEvent arg0)
          If a vertex was dragged, then the coordinates of the selected object are modified to reflect the change.
 void startInteraction()
          Gets the coordinates of the currently selected object.
 
Methods inherited from class interactors.Interactor
endInteraction, keyReleased, mouseMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coords

float[] coords
the coordinates of the selected object


selected

int selected
the index of the currently selected vertex

Constructor Detail

CoordinatesInteractor

public CoordinatesInteractor(InteractionHandler handler)
Constructs the coordinates interactor.

Parameters:
handler - - the interaction handler
Method Detail

getCursor

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

Overrides:
getCursor in class Interactor

startInteraction

public void startInteraction()
Gets the coordinates of the currently selected object.

Overrides:
startInteraction in class Interactor

draw

public void draw(GL gl,
                 GLU glu,
                 GLUT glut)
Draws the coordinates of the selected object.

Overrides:
draw in class Interactor

keyPressed

public void keyPressed(java.awt.event.KeyEvent arg0)
Overrides the key shortcuts. If an object is selected, then deletes the object. If a vertex is selected, then the select vertex is deleted.

Overrides:
keyPressed in class Interactor

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Processes mouse presses: - Left click selects a new object if no object is selected - Left click without control down selects a coordinate if an object is currently selected - Left click with control down add a new coordinate to the selected object - Right click deselcted the current vertex if a vertex is selected, deselects the current object or ends the interaction if no object is selecteed

Overrides:
mousePressed in class Interactor

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
If a vertex was dragged, then the coordinates of the selected object are modified to reflect the change.

Overrides:
mouseReleased in class Interactor

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent arg0)
If a vertex is selected, then a mouse drag moves the selected vertex.

Overrides:
mouseDragged in class Interactor