|
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 org.freehep.graphics3d.RotationSelectionPanel
Implements an ArcBall. The ball sits on top of the Canvas, allowing the user to grab it with the mouse and drag it to rotate the ball as well as the model shown on the canvas. The ongoing drag, as well as the outline of the ball is shown, while dragging. The resulting drag may also be shown by pressing Caps-Lock. Using the Ctrl, Shift or Ctrl+Shift keys will constrain the rotation to Camera, Body or User defined Axes. While moving the mouse and pressing the keys, the selected constraint axis will highlight. After pressing the mouse button (and a key), a rotation will start, constrained by the selected axis.
Original ArcBall C code from Ken Shoemake, Graphics Gems IV, 1993.
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 |
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 | |
RotationSelectionPanel()
Creates an ArcBall of default (0.8) size. |
|
RotationSelectionPanel(double size)
Creates an ArcBall of given size. |
Method Summary | |
double |
getBallSize()
|
void |
keyPressed(KeyEvent event)
Handles the pressing of the Ctrl, Shift and Caps-Lock keys |
void |
keyReleased(KeyEvent event)
Handles the release of the Ctrl, Shift and Caps-Lock keys |
void |
keyTyped(KeyEvent event)
Ignored |
void |
mouseDragged(MouseEvent event)
Left mouse button will update the (matrix) state of the ArcBall, and show the dragged (constraint) path. |
void |
mouseMoved(MouseEvent event)
Moving the mouse will highlight (if a key is pressed) one of the constraint axes. |
void |
mousePressed(MouseEvent event)
Left mouse button will store start state of the drag, as well as showing the constraint axis if any. |
void |
mouseReleased(MouseEvent event)
Left mouse button will store and if requested show the resulting dragged arc. |
void |
paintComponent(Graphics g)
|
void |
setOtherAxis(int index,
Vector3 axis)
Sets one of the user axes. |
Matrix4 |
toMatrix()
|
Quaternion |
toQuaternion()
|
Methods inherited from class org.freehep.swing.graphics.GraphicalSelectionPanel |
addActionEntry, addActionEntry, addGraphicalSelectionListener, cancelPopupProcessing, fireGraphicalSelectionMade, getBorder, getPopupMenu, isProcessingPopup, makeSelectionEvent, mouseClicked, mouseEntered, mouseExited, removeGraphicalSelectionListener, resetSelection, 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 RotationSelectionPanel()
public RotationSelectionPanel(double size)
Method Detail |
public void setOtherAxis(int index, Vector3 axis)
index
- in range 0..2axis
- public void mousePressed(MouseEvent event)
mousePressed
in interface MouseListener
mousePressed
in class GraphicalSelectionPanel
event
- MouseEvent describing actionpublic void mouseReleased(MouseEvent event)
mouseReleased
in interface MouseListener
mouseReleased
in class GraphicalSelectionPanel
event
- MouseEvent describing actionpublic void mouseDragged(MouseEvent event)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class GraphicalSelectionPanel
event
- MouseEvent describing actionpublic void mouseMoved(MouseEvent event)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class GraphicalSelectionPanel
event
- MouseEvent describing actionpublic void keyPressed(KeyEvent event)
keyPressed
in interface KeyListener
keyPressed
in class GraphicalSelectionPanel
event
- KeyEvent describing key which has been pressed.public void keyReleased(KeyEvent event)
keyReleased
in interface KeyListener
keyReleased
in class GraphicalSelectionPanel
event
- KeyEvent describing the key which has been releasedpublic void keyTyped(KeyEvent event)
keyTyped
in interface KeyListener
keyTyped
in class GraphicalSelectionPanel
event
- KeyEvent describing key which has been typed.public double getBallSize()
public void paintComponent(Graphics g)
public Matrix4 toMatrix()
public Quaternion toQuaternion()
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |