|
||||||||||
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.opensourcephysics.display.DrawingPanel
org.opensourcephysics.display.InteractivePanel
InteractivePanel is a drawing panel that invokes the handleMouseAction method in Interactive objects.
Nested Class Summary | |
protected class |
InteractivePanel.IADMouseController
The inner class that will handle all mouse related events. |
Nested classes inherited from class org.opensourcephysics.display.DrawingPanel |
DrawingPanel.ZoomBox |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
containsInteractive
|
protected InteractiveMouseHandler |
interactive
|
static int |
MOUSE_CLICKED
|
static int |
MOUSE_DRAGGED
|
static int |
MOUSE_ENTERED
|
static int |
MOUSE_EXITED
|
static int |
MOUSE_MOVED
|
static int |
MOUSE_PRESSED
|
static int |
MOUSE_RELEASED
|
protected int |
mouseAction
|
protected java.awt.event.MouseEvent |
mouseEvent
|
Fields inherited from class org.opensourcephysics.display.DrawingPanel |
antialiasShapeOn, antialiasTextOn, autoscaleMargin, autoscaleX, autoscaleY, bgColor, blMessageBox, BOTTOM_LEFT, BOTTOM_RIGHT, bottomGutter, brMessageBox, clipAtGutter, coordinateStrBuilder, customInspector, decimalFormat, dimensionSetter, drawableList, enableZoom, fixedPixelPerUnit, glassPanel, glassPanelLayout, height, leftGutter, mouseController, offscreenImage, optionController, pixelMatrix, pixelTransform, popupmenu, propertiesItem, rightGutter, scientificFormat, showCoordinates, squareAspect, tlMessageBox, TOP_LEFT, TOP_RIGHT, topGutter, trMessageBox, validImage, viewRect, width, workingImage, xceil, xfloor, xmax, xmaxPreferred, xmin, xminPreferred, xPixPerUnit, yceil, yfloor, ymax, ymaxPreferred, ymin, yminPreferred, yPixPerUnit, zoomBox, zoomMode |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, 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.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
InteractivePanel()
Constructs an InteractivePanel with an internal handler. |
|
InteractivePanel(InteractiveMouseHandler in)
Constructs an InteractivePanel with the given handler. |
Method Summary | |
void |
addDrawable(Drawable drawable)
Adds a drawable object to the drawable list. |
void |
clear()
Removes all drawable objects from the drawable list. |
Interactive |
getInteractive()
Gets the interactive object that was accessed by the last mouse event. |
int |
getMouseAction()
Gets the last mouse action. |
int |
getMouseButton()
Gets the mouse button of the last mouse event. |
int |
getMouseClickCount()
Gets the click count of the last mouse event. |
int |
getMouseIntX()
Gets the x pixel coordinate of the last mouse event. |
int |
getMouseIntY()
Gets the y pixel coordinate of the last mouse event. |
double |
getMouseX()
Gets the x world coordinate of the last mouse event. |
double |
getMouseY()
Gets the y world coordinate of the last moust event |
void |
handleMouseAction(InteractivePanel panel,
java.awt.event.MouseEvent evt)
Handles mouse actions by dragging the current interactive drawable object. |
void |
saveMouseEvent(int type,
java.awt.event.MouseEvent evt)
Saves the last mouse event. |
void |
setInteractiveMouseHandler(InteractiveMouseHandler handler)
Sets the interactive mouse handler. |
void |
setShowCoordinates(boolean show)
Shows the coordinates in the text box in the lower left hand corner. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MOUSE_PRESSED
public static final int MOUSE_RELEASED
public static final int MOUSE_DRAGGED
public static final int MOUSE_CLICKED
public static final int MOUSE_ENTERED
public static final int MOUSE_EXITED
public static final int MOUSE_MOVED
protected boolean containsInteractive
protected int mouseAction
protected java.awt.event.MouseEvent mouseEvent
protected InteractiveMouseHandler interactive
Constructor Detail |
public InteractivePanel(InteractiveMouseHandler in)
in
- InteractiveMouseHandlerpublic InteractivePanel()
Method Detail |
public void addDrawable(Drawable drawable)
addDrawable
in class DrawingPanel
drawable
- public void clear()
clear
in class DrawingPanel
public void setInteractiveMouseHandler(InteractiveMouseHandler handler)
handler
- the mouse handlerpublic void handleMouseAction(InteractivePanel panel, java.awt.event.MouseEvent evt)
handleMouseAction
in interface InteractiveMouseHandler
panel
- evt
- public Interactive getInteractive()
public void setShowCoordinates(boolean show)
setShowCoordinates
in class DrawingPanel
show
- public int getMouseButton()
public int getMouseClickCount()
public int getMouseAction()
public int getMouseIntX()
public int getMouseIntY()
public double getMouseX()
public double getMouseY()
public void saveMouseEvent(int type, java.awt.event.MouseEvent evt)
type
- evt
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |