|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.freehep.swing.graphics.GraphicalSelectionPanel
The primary superclass of all graphical selection panels. These panels are expected to handle all of the interaction with the user, and generate a GraphicalSelectionEvent when a selection has been made. Note that GraphicalSelectionPanels use the information about the size of the component to send back meaningful zoom transformation and the like. To keep these calculations simple, Borders are not allowed on these components. If a Border is desired, then embed the selection panel within a container and put the Border on the container.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected ActionMap |
actionMap
The hash map which maps keys to actions. |
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction |
defaultModeAction
The "Leave" action in the popup menu. |
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction |
nextAction
The "Next" action in the popup menu. |
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction |
previousAction
The "Previous" action in the popup menu. |
protected LinkedList |
selectionActions
The list of selection actions. |
protected static Stroke |
thickStroke
Thick stroke for the black part of the selection box. |
protected static Stroke |
thinStroke
Thin stroke for the white part of the selection box. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
GraphicalSelectionPanel()
Creates a selection panel which is transparent. |
Method Summary | |
protected void |
addActionEntry(int keyCode,
Action action)
This utility method binds an action to a particular key. |
protected void |
addActionEntry(KeyStroke keyStroke,
Action action)
This utility method binds an action to a KeyStroke. |
void |
addGraphicalSelectionListener(GraphicalSelectionListener listener)
Add a GraphicalSelectionListener. |
protected void |
cancelPopupProcessing()
This resets a flag which indicates when a popup menu is being processed. |
protected void |
fireGraphicalSelectionMade(GraphicalSelectionEvent gsEvent)
Send the GraphicalSelectionMade event to all currently registered GraphicalSelectionListeners. |
Border |
getBorder()
This component does not support borders. |
JPopupMenu |
getPopupMenu()
This method returns the popup menu for this component. |
boolean |
isProcessingPopup(MouseEvent e)
This method determines whether or not a popup menu is being processed. |
void |
keyPressed(KeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(KeyEvent e)
Process key-released events. |
void |
keyTyped(KeyEvent e)
Invoked when a key has been typed. |
protected void |
makeSelectionEvent(int type)
A utility function which creates an appropriate selection event when the user accepts the current selection and sends it to all listeners. |
void |
mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons down). |
void |
mousePressed(MouseEvent e)
Invoked when the mouse button has been pressed on a component. |
void |
mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
removeGraphicalSelectionListener(GraphicalSelectionListener listener)
Remove a GraphicalSelectionListener. |
void |
resetSelection()
The default implementation of this method does nothing. |
void |
setBorder(Border border)
This component does not support borders. |
void |
setBounds(int x,
int y,
int width,
int height)
Moves and resizes this component. |
protected void |
setSelectionActionsEnabled(boolean enable)
Activate or inactivate all of the selection actions. |
protected boolean |
testPopupTrigger(MouseEvent e)
A utility method which tests to see if the given mouse event should trigger the popup menu. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LinkedList selectionActions
protected ActionMap actionMap
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction defaultModeAction
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction nextAction
protected org.freehep.swing.graphics.GraphicalSelectionPanel.SelectionAction previousAction
protected static final Stroke thinStroke
protected static final Stroke thickStroke
Constructor Detail |
public GraphicalSelectionPanel()
Method Detail |
protected void setSelectionActionsEnabled(boolean enable)
public void resetSelection()
public JPopupMenu getPopupMenu()
protected void cancelPopupProcessing()
public boolean isProcessingPopup(MouseEvent e)
e
- MouseEvent passed into mouse handling routine
public final void setBorder(Border border)
border
- must be nullpublic final Border getBorder()
public void setBounds(int x, int y, int width, int height)
x
- x-coordinate of componenty
- y-coordinate of componentwidth
- width of the componentheight
- height of the componentpublic void addGraphicalSelectionListener(GraphicalSelectionListener listener)
listener
- the GraphicalSelectionListener to addpublic void removeGraphicalSelectionListener(GraphicalSelectionListener listener)
listener
- the GraphicalSelectionListener to removeprotected void fireGraphicalSelectionMade(GraphicalSelectionEvent gsEvent)
gsEvent
- the GraphicalSelectionEvent which is sent to all
currently registered GraphicalSelectionListenerspublic void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
e
- MouseEvent describing actionpublic void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
e
- MouseEvent describing actionpublic void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
e
- MouseEvent describing actionpublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- MouseEvent describing actionpublic void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
e
- MouseEvent describing actionpublic void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
e
- MouseEvent describing actionpublic void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
e
- MouseEvent describing actionpublic void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
e
- KeyEvent describing key which has been pressed.public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
e
- KeyEvent describing the key which has been releasedpublic void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
e
- KeyEvent describing key which has been typed.protected void makeSelectionEvent(int type)
protected boolean testPopupTrigger(MouseEvent e)
protected void addActionEntry(int keyCode, Action action)
protected void addActionEntry(KeyStroke keyStroke, Action action)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |