|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--quoggles.QGraphMouse
Implements actions resulting from mouse events.
| Field Summary | |
private boolean |
dragged
Used for dragging purposes: true iff user drags |
private javax.swing.JComponent |
draggedComp
Used for dragging purposes: component currently dragged |
private java.awt.geom.Point2D |
dragPoint1
Used for dragging purposes |
private java.awt.geom.Point2D |
dragPoint2
Used for dragging purposes |
private boolean |
dragSecondPoint
Used for dragging purposes |
private javax.swing.border.Border |
emptyBorder
Empty (i.e. invisible) border |
private javax.swing.JComponent |
ghostComp
Used for dragging purposes: Show "virtual component" at mouse pos |
private javax.swing.border.Border |
markBorder
Border used to highlight boxes |
private java.util.Collection |
markedBoxReps
Collection of all currently marked BoxRepresentations |
private java.util.Map |
markedCopyOrigMap
Maps copied marked nodes to their originals |
private org.graffiti.graph.Graph |
markedSubGraph
The induced subgraph of the marked nodes |
private QMain |
qMain
Used to communicate between the individual parts of the system |
private java.awt.Point |
relDrag
Used for dragging purposes |
private java.util.Map |
relDragMap
Saves all relative drag positions for all marked boxes |
private java.awt.geom.Point2D |
selRectPt1
Marks a corner of the selection rectangle |
private java.awt.geom.Point2D |
selRectPt2
Marks a corner of the selection rectangle |
private java.util.Collection |
showOrderComps
Components used to show the order of IO of marked sub graph |
| Constructor Summary | |
QGraphMouse(QMain q)
Constructor. |
|
| Method Summary | |
org.graffiti.graph.Graph |
getMarkedSubGraph()
Returns the currently marked sub graph. |
private void |
markBoxRep(BoxRepresentation boxRep)
Do something to highlight the boxRep. |
private void |
markedBoxRepsChanged()
Takes care to display / save order of IO for marked sub query. |
void |
mouseClicked(java.awt.event.MouseEvent e)
If double clicked on an icon, adds the corresponding box (uses the functionality of mousePressed, mouseDragged
and mouseReleased).
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Moves curently dragged component according to the mouse movement. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Empty. |
void |
mouseExited(java.awt.event.MouseEvent e)
Empty. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Empty except followMode is switched on. |
void |
mousePressed(java.awt.event.MouseEvent e)
As it might be the start of a drag, set all relevant flags and fields. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Calls checkConnections(true) if it succeeds a drag
operation and removes any visible "virtual component".
|
private void |
moveBoxRepresentation(BoxRepresentation rep,
java.awt.Point newPos)
Calculate the next possible position for the given box representation starting at the given position. |
void |
moveBoxRepresentation(BoxRepresentation rep,
java.awt.Point newPos,
boolean freePlacement)
If last parameter is false:
Calculate the next possible position for the given box representation
starting at the given position. |
private void |
moveOneOneConn(java.awt.Point pt,
boolean freePlacement)
Equivalent of moveBoxRepresentation for
OneOneConnector_Boxes |
void |
reset()
|
private void |
unMarkBoxRep(BoxRepresentation boxRep)
Remove anything that highlighted the boxRep. |
private void |
unMarkBoxRep(BoxRepresentation boxRep,
boolean inform)
Remove anything that highlighted the boxRep.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private QMain qMain
private java.awt.Point relDrag
private javax.swing.JComponent draggedComp
private final javax.swing.JComponent ghostComp
private boolean dragged
private java.awt.geom.Point2D dragPoint1
private java.awt.geom.Point2D dragPoint2
private boolean dragSecondPoint
private java.awt.geom.Point2D selRectPt1
private java.awt.geom.Point2D selRectPt2
private java.util.Map relDragMap
private final javax.swing.border.Border emptyBorder
private final javax.swing.border.Border markBorder
private java.util.Collection markedBoxReps
private org.graffiti.graph.Graph markedSubGraph
private java.util.Map markedCopyOrigMap
private java.util.Collection showOrderComps
| Constructor Detail |
public QGraphMouse(QMain q)
q - main component used for communication.| Method Detail |
public org.graffiti.graph.Graph getMarkedSubGraph()
public void mouseClicked(java.awt.event.MouseEvent e)
mousePressed, mouseDragged
and mouseReleased).
If double clicked on a box representation, removes this box.
mouseClicked in interface java.awt.event.MouseListenerMouseListener.mouseClicked(java.awt.event.MouseEvent)public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)
private void moveOneOneConn(java.awt.Point pt,
boolean freePlacement)
moveBoxRepresentation for
OneOneConnector_Boxes
pt - freePlacement -
public void moveBoxRepresentation(BoxRepresentation rep,
java.awt.Point newPos,
boolean freePlacement)
false:
Calculate the next possible position for the given box representation
starting at the given position. Snaps the component to this position.
This method is quite expensive (at least with this rather
quadratic implementation).
If last parameter is true, the box is just moved according
to the mouse pointer's position.
rep - newPos - freePlacement -
private void moveBoxRepresentation(BoxRepresentation rep,
java.awt.Point newPos)
rep - newPos - public void mouseMoved(java.awt.event.MouseEvent e)
followMode is switched on.
mouseMoved in interface java.awt.event.MouseMotionListenerMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(java.awt.event.MouseEvent e)
checkConnections(true) if it succeeds a drag
operation and removes any visible "virtual component".
Resets all flags etc. indicating a drag.
mouseReleased in interface java.awt.event.MouseListenerMouseListener.mouseReleased(java.awt.event.MouseEvent)public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerMouseListener.mouseExited(java.awt.event.MouseEvent)
private void unMarkBoxRep(BoxRepresentation boxRep,
boolean inform)
boxRep.
The given boolean value specifies whether or not the
markedBoxRepsChanged mthod is called.
boxRep - private void unMarkBoxRep(BoxRepresentation boxRep)
boxRep.
boxRep - private void markBoxRep(BoxRepresentation boxRep)
boxRep.
boxRep - private void markedBoxRepsChanged()
public void reset()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||