|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinteractors.InteractionHandler
public class InteractionHandler
Class for handling interactions between the user and objects in the map. Different interactions are split up into different interator classes, which perform a single interaction.
Field Summary | |
---|---|
private Canvas |
canvas
the canvas |
static java.lang.String |
CONCEPT_NEIGHBORHOOD_INTERACTOR
|
static java.lang.String |
CONSTRAINT_INTERACTOR
|
static java.lang.String |
COORDINATES_INTERACTOR
|
private javax.swing.JMenuItem |
coordinatesMenu
|
private java.awt.geom.Point2D |
currentPoint
the current mouse location, in virtual coordinates |
private javax.swing.JMenuItem |
deleteMenu
|
static java.lang.String |
DISTANCE_INTERACTOR
|
private javax.swing.JMenu |
interactionMenu
the interaction menu for the popup |
(package private) java.util.LinkedHashMap<java.lang.String,Interactor> |
interactions
a mapping of interactor names to interactors |
private Interactor |
interactor
the current interaction |
private MainWindow |
mainWindow
the main frame |
private Map |
map
the map to edit |
static java.lang.String |
MEASUREMENT_INTERACTOR
|
static java.lang.String |
NEW_SHAPE_INTERACTOR
|
static java.lang.String |
ORIENTATION_INTERACTOR
|
static java.lang.String |
PICK_INTERACTOR
|
private java.awt.geom.Point2D |
pickedPoint
the previously point clicked by the mouse, in virtual coordinates |
private boolean |
playbackMode
specifies if the editor is currently displaying a recording |
private javax.swing.JPopupMenu |
popupMenu
the popup menu |
private java.awt.geom.Point2D |
previousPoint
the previous mouse location, in virtual coordinates |
private javax.swing.JMenuItem |
propertiesMenu
|
static java.lang.String |
RECORDING_INTERACTOR
|
static java.lang.String |
RELATION_INTERACTOR
|
private double |
ROTATE_AMOUNT
the amout to rotate the canvas |
private javax.swing.JMenu |
rotateMenu
|
static java.lang.String |
ROUTE_INTERACTOR
|
private double |
SCALE_AMOUNT
the amout to scale the canvas |
static java.lang.String |
SCALE_INTERACTOR
|
private javax.swing.JMenuItem |
scaleMenu
|
private java.awt.Point |
screenCurrentPoint
the current mouse location, in screen coordinates |
private java.awt.Point |
screenPickedPoint
the previously point clicked by the mouse, in screen coordinates |
private java.awt.Point |
screenPreviousPoint
the previous mouse location, in screen coordinates |
private OntologyObject |
selectedObject
the object currently selected |
private SpatialRelation |
selectedRelation
|
private javax.swing.JPopupMenu.Separator |
separator
|
private javax.swing.JMenuItem |
snapMenu
|
static java.lang.String |
TOPOLOGY_INTERACTOR
|
private double |
TRANSLATE_AMOUNT
the amout to translate the canvas |
Constructor Summary | |
---|---|
InteractionHandler(MainWindow mainWindow,
Canvas canvas)
Constructs the interaction handler. |
Method Summary | |
---|---|
void |
addInteractor(java.lang.String name,
Interactor interactor)
Adds a new interactor to the popup menu. |
private void |
buildPopupMenu()
Constructs the popup menu. |
void |
draw(GL gl,
GLU glu,
GLUT glut)
Draws the current interaction. |
Canvas |
getCanvas()
Gets the canvas. |
java.awt.geom.Point2D |
getCurrentPoint()
Gets the current mouse location in virtual coordinates. |
MainWindow |
getMainFrame()
|
Map |
getMap()
Gets the map. |
MapImporter |
getMapLoader()
Gets the map importer. |
java.awt.geom.Point2D |
getPickedPoint()
Gets the last picked point in virtual coordinates. |
java.awt.geom.Point2D |
getPreviousPoint()
Gets the previous mouse location in virtual coordinates. |
java.awt.Point |
getScreenCurrentPoint()
Gets the current mouse location in screen coordinates. |
java.awt.Point |
getScreenPickedPoint()
Gets the last picked point in screen coordinates. |
java.awt.Point |
getScreenPreviousPoint()
Gets the previous mouse location in screen coordinates. |
OntologyObject |
getSelectedObject()
Gets the currently selected object. |
SpatialRelation |
getSelectedRelation()
Gets the currently selected relation. |
void |
keyPressed(java.awt.event.KeyEvent arg0)
Informs the current interactor of a key pressed events. |
void |
keyReleased(java.awt.event.KeyEvent arg0)
Informs the current interactor of a key released event. |
void |
keyTyped(java.awt.event.KeyEvent arg0)
Not implemented. |
void |
mouseClicked(java.awt.event.MouseEvent arg0)
Not implemented. |
void |
mouseDragged(java.awt.event.MouseEvent arg0)
Updates the current and previous points. |
void |
mouseEntered(java.awt.event.MouseEvent arg0)
Not implemented. |
void |
mouseExited(java.awt.event.MouseEvent arg0)
Not implemented. |
void |
mouseMoved(java.awt.event.MouseEvent arg0)
Updates the current and previous points and informs the current interacotr of a mouse moved event. |
void |
mousePressed(java.awt.event.MouseEvent arg0)
Updates the current and picked point and informs the current interactor of the mouse press. |
void |
mouseReleased(java.awt.event.MouseEvent arg0)
Informs the current interactor of a mouse released event. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
The mouse wheel controls the current zoom factor. |
void |
redo()
Redoes the previsouly undone actions. |
void |
setInteractor(java.lang.String name)
Sets the current interactor. |
void |
setMap(Map map)
Sets the map to edit. |
void |
setPlaybackMode(boolean mode)
Sets if the editor is in playback mode. |
void |
setSelectedObject(OntologyObject object)
Sets the given object as selected and deselects the previously selected object. |
void |
setSelectedRelation(SpatialRelation relation)
Sets the relation that is currently selected. |
void |
snapSelectedObjectToGrid()
Aligns the currently selected object with the grid. |
void |
undo()
Undoes the previous action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.LinkedHashMap<java.lang.String,Interactor> interactions
public static java.lang.String PICK_INTERACTOR
public static java.lang.String RELATION_INTERACTOR
public static java.lang.String SCALE_INTERACTOR
public static java.lang.String NEW_SHAPE_INTERACTOR
public static java.lang.String COORDINATES_INTERACTOR
public static java.lang.String MEASUREMENT_INTERACTOR
public static java.lang.String RECORDING_INTERACTOR
public static java.lang.String ROUTE_INTERACTOR
public static java.lang.String CONSTRAINT_INTERACTOR
public static java.lang.String DISTANCE_INTERACTOR
public static java.lang.String TOPOLOGY_INTERACTOR
public static java.lang.String ORIENTATION_INTERACTOR
public static java.lang.String CONCEPT_NEIGHBORHOOD_INTERACTOR
private Interactor interactor
private boolean playbackMode
private MainWindow mainWindow
private Canvas canvas
private Map map
private java.awt.Point screenPickedPoint
private java.awt.geom.Point2D pickedPoint
private java.awt.Point screenCurrentPoint
private java.awt.geom.Point2D currentPoint
private java.awt.Point screenPreviousPoint
private java.awt.geom.Point2D previousPoint
private javax.swing.JPopupMenu popupMenu
private javax.swing.JMenu interactionMenu
private javax.swing.JMenuItem propertiesMenu
private javax.swing.JMenuItem coordinatesMenu
private javax.swing.JMenuItem scaleMenu
private javax.swing.JMenuItem snapMenu
private javax.swing.JMenuItem deleteMenu
private javax.swing.JMenu rotateMenu
private javax.swing.JPopupMenu.Separator separator
private OntologyObject selectedObject
private SpatialRelation selectedRelation
private double TRANSLATE_AMOUNT
private double SCALE_AMOUNT
private double ROTATE_AMOUNT
Constructor Detail |
---|
public InteractionHandler(MainWindow mainWindow, Canvas canvas)
mainWindow
- - the main framecanvas
- - the canvasMethod Detail |
---|
private void buildPopupMenu()
public void addInteractor(java.lang.String name, Interactor interactor)
name
- - the interactor nameinteractor
- - the new interactorpublic void setMap(Map map)
map
- - the new mappublic void setSelectedRelation(SpatialRelation relation)
relation
- - the selected relationpublic SpatialRelation getSelectedRelation()
public void setInteractor(java.lang.String name)
name
- - the new interactionpublic void snapSelectedObjectToGrid()
public void setSelectedObject(OntologyObject object)
object
- - the object to selectpublic OntologyObject getSelectedObject()
public void draw(GL gl, GLU glu, GLUT glut)
public Canvas getCanvas()
public void setPlaybackMode(boolean mode)
public Map getMap()
public MapImporter getMapLoader()
public MainWindow getMainFrame()
public java.awt.Point getScreenPickedPoint()
public java.awt.geom.Point2D getPickedPoint()
public java.awt.Point getScreenPreviousPoint()
public java.awt.geom.Point2D getPreviousPoint()
public java.awt.Point getScreenCurrentPoint()
public java.awt.geom.Point2D getCurrentPoint()
public void keyPressed(java.awt.event.KeyEvent arg0)
keyPressed
in interface java.awt.event.KeyListener
public void undo()
public void redo()
public void keyReleased(java.awt.event.KeyEvent arg0)
keyReleased
in interface java.awt.event.KeyListener
public void mousePressed(java.awt.event.MouseEvent arg0)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent arg0)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent arg0)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent arg0)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void mouseClicked(java.awt.event.MouseEvent arg0)
mouseClicked
in interface java.awt.event.MouseListener
public void keyTyped(java.awt.event.KeyEvent arg0)
keyTyped
in interface java.awt.event.KeyListener
public void mouseEntered(java.awt.event.MouseEvent arg0)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent arg0)
mouseExited
in interface java.awt.event.MouseListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |