|
|||||||||
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.fraid.graphics.GraphicsUser
org.fraid.graphics.GraphicsPanel
public class GraphicsPanel
Objects of this class provide medium for 2D plotting.
Must be used only embedded in a SliderPanel
.
Each instance selfregisters in the GraphicsStore at creation.
GraphicsStore
,
Serialized FormNested Class Summary | |
---|---|
class |
GraphicsPanel.KeyPressedAction
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
boolean |
mIsZooming
Do not use this variable. |
java.awt.Point |
mLastPopUpPosition
Do not use this variable. |
Fields inherited from class org.fraid.graphics.GraphicsUser |
---|
mAlgorithmThread, mImageSize, mPlugIn |
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.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
void |
clearZoomRegions()
Cleans up when the zoom is canceled. |
void |
cornerButtonPressed()
Depending on the state will stop painting or perform undo. |
void |
destroy()
Cleans up when the window containing this panel is destroyed. |
void |
doZoom()
Starts the zoom recalculations after the zoom parameters have been set. |
void |
drawZoomRegions(java.awt.Point endPoint)
Marks the zoom region when the mouse is dragged. |
java.lang.Integer |
getKey()
Returns the GraphicsStore key associated with this panel. |
SliderPanel |
getOwner()
Returns the owning SliderPanel . |
javax.swing.JPopupMenu |
getPopUp()
Retruns the associated popup menu. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
|
void |
interruptWatchingThread()
Will stop the screen painting thread. |
void |
notifyWatchingThread()
Will wake up the screen painting thread. |
protected void |
paintComponent(java.awt.Graphics g)
The major repainting routine. |
void |
recalculateAndRepaint()
Recalculates and repaints the image. |
void |
registerPrivateKeyboardActions()
|
void |
repaintAfterPlugInChange()
Use when changing the plugin. |
void |
scrollOffscreen(int direction,
int disp)
Scrolls the offscreen image and starts recalculation with the new values. |
void |
setInitialZoomMousePosition(java.awt.Point p)
Sets the start position of the zooming region. |
void |
setOffscreenImage(java.awt.image.BufferedImage bi)
Used by the PaintAlgorithmThread to set the generated image after it is done. |
void |
setOffscreenImage(int[] offscreenPixels)
Used by the PaintAlgorithmThread to set the generated image after it is done. |
void |
setOffScreenOrigin(int x,
int y)
Sets the upper left corner of the plotting area to point where it should. |
BehaviorBean |
setPlugIn(java.lang.String aPlugInName)
The method used to initialize the tripple GraphicsPanel -
BehaviourPlugIn - PaintAlgorithmThread . |
void |
setStop()
Called by the PaintAlgorithmThread to set the CornerButton to stop
when calculations start. |
protected void |
setThreadNames()
|
void |
stateChanged(javax.swing.event.ChangeEvent aEvent)
Called when a function we are drawing changed. |
Methods inherited from class org.fraid.graphics.GraphicsUser |
---|
getAlgorithm, getImageSize, getPlugIn, setAlgorithm, setPlugIn |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, 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 |
Methods inherited from interface java.awt.image.ImageObserver |
---|
imageUpdate |
Field Detail |
---|
public java.awt.Point mLastPopUpPosition
public boolean mIsZooming
Method Detail |
---|
public void registerPrivateKeyboardActions()
public BehaviorBean setPlugIn(java.lang.String aPlugInName) throws PlugInException
GraphicsPanel
-
BehaviourPlugIn
- PaintAlgorithmThread
.
Do not use any other way for initialization.
setPlugIn
in class GraphicsUser
aPlugInName
- a String
which could be: 1)String representation
of an XML serialized BehaviourPlugIn
, 2) PlugIn class name or
3)a file name of an XML serialized BehaviourPlugIn
(checked in this order).
BehaviourPlugInAdapter
value
PlugInException
- if the aPlugInName doesn't match anything.PlugInFactory
protected void setThreadNames()
public void destroy()
destroy
in class GraphicsUser
public void stateChanged(javax.swing.event.ChangeEvent aEvent)
stateChanged
in interface javax.swing.event.ChangeListener
aEvent
- a ChangeEvent
which the method doesn't usepublic void notifyWatchingThread()
PaintAlgorithmThread
.
notifyWatchingThread
in class GraphicsUser
public void interruptWatchingThread()
PaintAlgorithmThread
.
interruptWatchingThread
in class GraphicsUser
public java.lang.Integer getKey()
GraphicsStore
key associated with this panel.
Object
valuepublic javax.swing.JPopupMenu getPopUp()
getPopUp
in class GraphicsUser
JPopupMenu
valuepublic SliderPanel getOwner()
SliderPanel
.
SliderPanel
valuepublic void setOffScreenOrigin(int x, int y)
PaintAlgorithmThread
.
setOffScreenOrigin
in class GraphicsUser
x
- an int
valuey
- an int
valuepublic void setOffscreenImage(java.awt.image.BufferedImage bi)
PaintAlgorithmThread
to set the generated image after it is done.
setOffscreenImage
in class GraphicsUser
bi
- a BufferedImage
valuesetOffscreenImage( BufferedImage )
public void setOffscreenImage(int[] offscreenPixels)
PaintAlgorithmThread
to set the generated image after it is done.
setOffscreenImage
in class GraphicsUser
offscreenPixels
- an array to pass to MemoryImageSource.setOffscreenImage( int[] )
public void cornerButtonPressed()
SliderPanel
's CornerButton action listener.
public void setStop()
PaintAlgorithmThread
to set the CornerButton
to stop
when calculations start.
setStop
in class GraphicsUser
public void scrollOffscreen(int direction, int disp)
direction
- Adjustable.HORIZONTAL
or Adjustable.VERTICAL
disp
- displacement in this directionpublic void recalculateAndRepaint()
recalculateAndRepaint
in class GraphicsUser
GraphicsPanel.repaintPanelAfterPlugInChange()
public void repaintAfterPlugInChange()
GraphicsPanel.recalculateAndRepaint()
won't work in that case.
public void setInitialZoomMousePosition(java.awt.Point p)
p
- a Point
valuepublic void doZoom()
public void clearZoomRegions()
public void drawZoomRegions(java.awt.Point endPoint)
endPoint
- the endPoint of the region, the start point has been set by
setInitialZoomMousePosition(Point)
.public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
getToolTipText
in class javax.swing.JComponent
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- a Graphics
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |