|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.freehep.swing.graphics.GraphicalSelectionPanel
org.freehep.swing.graphics.PointSelectionPanel
public class PointSelectionPanel
This panel allows the user to select a point on the screen. The crosshair cursor fill follow the system pointer when the left mouse button is pressed. The system pointer will become invisible while the user is actively repositioning the crosshair. This panel will also respond to keystroke input.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class org.freehep.swing.graphics.GraphicalSelectionPanel |
---|
actionMap, defaultModeAction, nextAction, previousAction, selectionActions, thickStroke, thinStroke |
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 | |
---|---|
PointSelectionPanel()
Construct a PointSelectionPanel. |
Method Summary | |
---|---|
boolean |
getCursorVisible()
Get the visibility of the crosshair cursor. |
void |
keyReleased(KeyEvent e)
Process key-released events. |
AffineTransform |
makeAffineTransform()
Make the affine transform which will center the display on the current point if applied. |
protected void |
makeSelectionEvent(int actionCode)
A utility function which creates an appropriate selection event when the user accepts the current selection. |
void |
mouseDragged(MouseEvent e)
The crosshair cursor follows the system pointer during a mouse drag event. |
void |
mousePressed(MouseEvent e)
The crosshair cursor will begin to follow the system pointer; the system pointer is made invisible. |
void |
mouseReleased(MouseEvent e)
The crosshair cursor will stop following the system pointer when the mouse is released. |
void |
paintComponent(Graphics g)
|
void |
resetSelection()
Reset the selection; this remove the crosshair cursor from the screen. |
void |
setCursorVisible(boolean visible)
Set the visiblility of the crosshair cursor. |
void |
updatePosition(int x,
int y)
This method updates the position of the crosshair cursor. |
Methods inherited from class org.freehep.swing.graphics.GraphicalSelectionPanel |
---|
addActionEntry, addActionEntry, addGraphicalSelectionListener, cancelPopupProcessing, fireGraphicalSelectionMade, getBorder, getPopupMenu, isProcessingPopup, keyPressed, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, removeGraphicalSelectionListener, setBorder, setBounds, setSelectionActionsEnabled, testPopupTrigger |
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 |
Constructor Detail |
---|
public PointSelectionPanel()
Method Detail |
---|
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
keyReleased
in class GraphicalSelectionPanel
e
- KeyEvent describing the key which has been releasedpublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class GraphicalSelectionPanel
e
- the mouse pressed event to which to respondpublic void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class GraphicalSelectionPanel
e
- the mouse release event to which to respondpublic void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class GraphicalSelectionPanel
e
- the mouse drag event to which to respondpublic void updatePosition(int x, int y)
x
- the x coordinate for the cursor (in pixels in the
PointSelectionPanel's coordinate system)y
- the y coordinate for the cursor (in pixels in the
PointSelectionPanel's coordinate system)public void setCursorVisible(boolean visible)
visible
- boolean indicating whether or not the crosshair
cursor should be visiblepublic boolean getCursorVisible()
public void resetSelection()
resetSelection
in class GraphicalSelectionPanel
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public AffineTransform makeAffineTransform()
protected void makeSelectionEvent(int actionCode)
makeSelectionEvent
in class GraphicalSelectionPanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |