|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--did.gui.DIDSelectionHandler
File: DIDSelectionHandler.java Version: Description: This class provides the mult-selection capability for the ImageCanvas. It is registered with the ImageCanvas and intercepts mouse events. When two or more ROIs overlap this class populates the activeRoi attribute in the ImageCanvas object it is registered to with the ROI that should be active. It accomplishes this by building a stack of ROIs that contain the point where the user clicks and then rotating through that stack. Note: This class also extends the KeyListener interface but does not implement any special code. Due to an unresolved issue which does not allow KeyEvent detection on any other object than the main Frame all key detection is being handled in the main Frame. This is only a stopgap measure. Once the soure of the error has been identified all KeyEvent detection should be moved to the appropriate classes. Modification Log: Date Name Comment xx-xx-xxxx XXX xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Constructor Summary | |
DIDSelectionHandler(DIDImageCanvas canvas)
Method used to instantiate the class. |
Method Summary | |
void |
keyPressed(java.awt.event.KeyEvent e)
This method is triggered when the user presses a key. |
void |
keyReleased(java.awt.event.KeyEvent e)
This method is triggered when the user releases a key. |
void |
keyTyped(java.awt.event.KeyEvent e)
This method is triggered when the user presses then releases a key. |
void |
mouseClicked(java.awt.event.MouseEvent e)
This method is called when the mouse is pressed then released. |
void |
mouseDragged(java.awt.event.MouseEvent e)
This method is called when the mouse is being dragged (Mouse pressed then moved while button is held down within the component. |
void |
mouseEntered(java.awt.event.MouseEvent e)
This method is called when the mouse enters the component. |
void |
mouseExited(java.awt.event.MouseEvent e)
This method is called when the mouse leaves the component. |
void |
mouseMoved(java.awt.event.MouseEvent e)
This method is called when the mouse is moving within the component. |
void |
mousePressed(java.awt.event.MouseEvent e)
Captures mouse button press. |
void |
mouseReleased(java.awt.event.MouseEvent e)
This method is called when the user releases the mouse button. |
void |
resetSelection()
Method used to re-initialize the selection model. |
DIDRoiIFC |
selectRoi(java.awt.event.MouseEvent e)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DIDSelectionHandler(DIDImageCanvas canvas)
canvas
- The ImageCanvas to which this listener is registered.Method Detail |
public void mousePressed(java.awt.event.MouseEvent e)
Captures mouse button press. This method is the begining of ROI manipulation. All ROI selection behavior is manipulated through a stack and a vector. The stack determines which ROI(s) fall within the current mouse x,y coordinate and the vector contains all the ROIs of the image. First, the method checks the existing selection stack to see if it has any members. If it does then check to see if the current mouse xy is in all the members. If it is then it is safe to make the next ROI in the stack the current ROI and continue with the mouseDragged event. If the stack fails any of these tests then a new one must be built. Next, if the selection stack is empty OR all of the ROIs in the selection stack don't contain the latest mouse x,y then it is necessary to (re)build the selection stack. This is accomplished by looping through the vector containing all the images ROI's and asking each if the mouse x,y is inside their boundries. Those that do are added to the selection stack. The stack is then interrigated to see if it contains any ROIs. If it does then current ROI becomes the top ROI in the stack. If the stack is empty that means the user has clicked on an empty portion of the image and a new ROI is created and initalized.
e
- MouseEvent refelecting the current mouse properties.mouseReleased(java.awt.event.MouseEvent)
public DIDRoiIFC selectRoi(java.awt.event.MouseEvent e)
- public void resetSelection()
public void mouseReleased(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void mouseClicked(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void mouseDragged(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void mouseEntered(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void mouseExited(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void mouseMoved(java.awt.event.MouseEvent e)
e
- MouseEvent refelecting the current mouse properties.public void keyPressed(java.awt.event.KeyEvent e)
e
- KeyEvent refelecting the current keyboard properties.public void keyReleased(java.awt.event.KeyEvent e)
e
- KeyEvent refelecting the current keyboard properties.public void keyTyped(java.awt.event.KeyEvent e)
e
- KeyEvent refelecting the current keyboard properties.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |