interactors
Class ScaleInteractor

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

public class ScaleInteractor
extends Interactor

Interaction for scaling an object.


Field Summary
(package private)  boolean mouseMoved
          specifies if the mouse has moved while scaling an object
(package private)  double scale
          the scale of the selected object
 
Fields inherited from class interactors.Interactor
handler
 
Constructor Summary
ScaleInteractor(InteractionHandler handler)
          Constructs the scale interactor.
 
Method Summary
 void draw(GL gl, GLU glu, GLUT glut)
          Draws the scaled outline of the selected object.
 java.awt.Cursor getCursor()
          Gets the scale cursor.
 void mouseMoved(java.awt.event.MouseEvent arg0)
          Moving the mouse modifies the the scale of the selected object.
 void mousePressed(java.awt.event.MouseEvent arg0)
          Processes mouse presses: - Left click selects a new object if no object is selected - Left click applies the new scale if an object was selected and the mouse was moved
 void startInteraction()
          Initializes the scale interaction.
 
Methods inherited from class interactors.Interactor
endInteraction, keyPressed, keyReleased, mouseDragged, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scale

double scale
the scale of the selected object


mouseMoved

boolean mouseMoved
specifies if the mouse has moved while scaling an object

Constructor Detail

ScaleInteractor

public ScaleInteractor(InteractionHandler handler)
Constructs the scale interactor.

Parameters:
handler - - the interaction handler
Method Detail

startInteraction

public void startInteraction()
Initializes the scale interaction.

Overrides:
startInteraction in class Interactor

draw

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

Overrides:
draw in class Interactor

getCursor

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

Overrides:
getCursor 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 applies the new scale if an object was selected and the mouse was moved. - Right click deselects the object or ends the interaction if no object is selecteed

Overrides:
mousePressed in class Interactor

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent arg0)
Moving the mouse modifies the the scale of the selected object. Moving the mouse up and left decreases the scale of the object, while moving the mouse down and right increases the scale of the object. The up and down movement cuases a larger change than left and right.

Overrides:
mouseMoved in class Interactor