jts
Class NeighborInteractor

java.lang.Object
  extended by interactors.Interactor
      extended by jts.NeighborInteractor

public class NeighborInteractor
extends Interactor

Interactor for showing externally connected objects.


Field Summary
(package private)  java.util.ArrayList<OntologyObject> neighbors
          the neighbor objects of the selected object
 
Fields inherited from class interactors.Interactor
handler
 
Constructor Summary
NeighborInteractor(InteractionHandler handler)
          Constructs a neighbor interactor.
 
Method Summary
 void draw(GL gl, GLU glu, GLUT glut)
          Highlights the neighboring objects of the selected object.
 java.awt.Cursor getCursor()
          Returns the neighbor cursor.
private static Geometry getGeometry(GraphicalObject graphics)
          Utility method for creating a JTS geomerty object from a graphical object that is a polygon.
static java.util.ArrayList<OntologyObject> getNeighbors(OntologyObject selected, Map map)
          Finds the externally connected objects for the specified object.
 void keyPressed(java.awt.event.KeyEvent arg0)
          Override the key shortcuts.
 void mousePressed(java.awt.event.MouseEvent arg0)
          Processes mouse presses: - Left click selects a new object and finds the neighbors - Right click deselects an object or ends the interaction if no object is selecteed
 void startInteraction()
          Finds the neighbors of the currently selected object.
 
Methods inherited from class interactors.Interactor
endInteraction, keyReleased, mouseDragged, mouseMoved, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

neighbors

java.util.ArrayList<OntologyObject> neighbors
the neighbor objects of the selected object

Constructor Detail

NeighborInteractor

public NeighborInteractor(InteractionHandler handler)
Constructs a neighbor interactor.

Parameters:
handler - - the interaction handler
Method Detail

draw

public void draw(GL gl,
                 GLU glu,
                 GLUT glut)
Highlights the neighboring objects of the selected object.

Overrides:
draw in class Interactor

startInteraction

public void startInteraction()
Finds the neighbors of the currently selected object.

Overrides:
startInteraction in class Interactor

getCursor

public java.awt.Cursor getCursor()
Returns the neighbor cursor.

Overrides:
getCursor in class Interactor

keyPressed

public void keyPressed(java.awt.event.KeyEvent arg0)
Override the key shortcuts.

Overrides:
keyPressed in class Interactor

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Processes mouse presses: - Left click selects a new object and finds the neighbors - Right click deselects an object or ends the interaction if no object is selecteed

Overrides:
mousePressed in class Interactor

getNeighbors

public static java.util.ArrayList<OntologyObject> getNeighbors(OntologyObject selected,
                                                               Map map)
Finds the externally connected objects for the specified object.

Parameters:
selected - - the selected object

getGeometry

private static Geometry getGeometry(GraphicalObject graphics)
Utility method for creating a JTS geomerty object from a graphical object that is a polygon.

Parameters:
graphics - - the graphical object, must be of type Polygon
Returns:
- the geometry