hep.wired.plot
Class WiredPlot

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by hep.wired.plot.WiredPlot
All Implemented Interfaces:
RecordPlot, ImageObserver, MenuContainer, Serializable, Accessible, org.freehep.swing.popup.HasPopupItems, org.freehep.swing.undo.UndoableEditProcessor, org.freehep.xml.io.XMLIO

public class WiredPlot
extends JPanel
implements RecordPlot, org.freehep.swing.popup.HasPopupItems, org.freehep.xml.io.XMLIO

Defines a single event display plot.

Version:
$Id: WiredPlot.java 14746 2013-05-02 18:59:56Z onoprien $
Author:
Mark Donszelmann
See Also:
Serialized Form

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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
 
Constructor Summary
WiredPlot(GraphicsPanel graphicsPanel)
          Creates a plot without a record.
WiredPlot(String name, GraphicsPanel graphicsPanel)
          Creates a plot with default GraphicsMode.
WiredPlot(String name, GraphicsPanel graphicsPanel, boolean supportUndo)
          Creates a plot with given parameters.
 
Method Summary
 void addChangeListener(ChangeListener a)
          Adds a change listener
 void beginUpdate()
          If multiple edits need to count as one major update, call this method to start a compound edit.
 RecordPlot copy(String name, Object record, boolean supportUndo)
          Returns a copy of this plot, attached to the given objects, from the given parameters.
 void drawShape(Shape shape)
          Draws the shape for feedback/interactivity purposes
 void endUpdate()
          If multiple edits need to count as one major update, call this method to end a compound edit.
 GraphicsPanel getGraphicsPanel()
          Returns the associated Graphics Panel.
 InteractionHandler getInteractionHandler()
          Return the current interaction handler.
 String getName()
          Returns the name of the plot.
 Object getRecord()
          Returns current record object.
 UndoableEditSupport getUndoableEditSupport()
          Returns the undo support object, or null if undo was not switched on.
 JPopupMenu modifyPopupMenu(JPopupMenu menu, Component source, Point p)
           
 void paint(Graphics g)
           
 void postEdit(org.freehep.swing.undo.DoableEdit edit)
          Handles an doable edit, please use postEdit(WiredEdit).
 void postEdit(UndoableEdit edit)
          Handles an undoable edit, please use postEdit(WiredEdit).
 void postEdit(WiredCompoundEdit edit)
          Handles a Wired Compound Edit.
 void postEdit(WiredEdit edit)
          Handles a Wired Edit.
 void removeChangeListener(ChangeListener r)
          Removbes a change listener
 void repaint()
          Repaint the plot
 boolean requestFocusInWindow()
          Requests focus in plot
 void restore(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void save(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void setBounds(int x, int y, int width, int height)
           
 void setInteractionHandler(InteractionHandler interactionHandler)
          Sets interaction handler on this plot.
 void setRecord(Object record)
          Sets record to be displayed by this plot.
 void setSelected(boolean selected)
          Called when this plot is selected or deselected.
 boolean supports(InteractionHandler interactionHandler)
          Returns true if this plot (and its projection) supports the specified interaction handler.
 boolean supports(UndoableEdit edit)
          Returns true if given edit is supported, which may depend on the current graphics panel.
 String toString()
           
 
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, getBaseline, getBaselineResizeBehavior, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, 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, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hep.wired.services.RecordPlot
getHeight, getWidth, getX, getY, setCursor
 

Constructor Detail

WiredPlot

public WiredPlot(GraphicsPanel graphicsPanel)
Creates a plot without a record.


WiredPlot

public WiredPlot(String name,
                 GraphicsPanel graphicsPanel)
Creates a plot with default GraphicsMode.


WiredPlot

public WiredPlot(String name,
                 GraphicsPanel graphicsPanel,
                 boolean supportUndo)
Creates a plot with given parameters.

Method Detail

copy

public RecordPlot copy(String name,
                       Object record,
                       boolean supportUndo)
Returns a copy of this plot, attached to the given objects, from the given parameters.

Specified by:
copy in interface RecordPlot

setInteractionHandler

public void setInteractionHandler(InteractionHandler interactionHandler)
Sets interaction handler on this plot.

Specified by:
setInteractionHandler in interface RecordPlot

setSelected

public void setSelected(boolean selected)
Called when this plot is selected or deselected. Changes its status and forwards the call to its graphics panel and interaction handler.

Specified by:
setSelected in interface RecordPlot

setRecord

public void setRecord(Object record)
Sets record to be displayed by this plot. Forwards the call to graphics panel and interaction handler, then repaints itself.

Specified by:
setRecord in interface RecordPlot

addChangeListener

public void addChangeListener(ChangeListener a)
Description copied from interface: RecordPlot
Adds a change listener

Specified by:
addChangeListener in interface RecordPlot

removeChangeListener

public void removeChangeListener(ChangeListener r)
Description copied from interface: RecordPlot
Removbes a change listener

Specified by:
removeChangeListener in interface RecordPlot

getName

public String getName()
Returns the name of the plot.

Specified by:
getName in interface RecordPlot
Overrides:
getName in class Component

getGraphicsPanel

public GraphicsPanel getGraphicsPanel()
Returns the associated Graphics Panel.

Specified by:
getGraphicsPanel in interface RecordPlot

getInteractionHandler

public InteractionHandler getInteractionHandler()
Return the current interaction handler.

Specified by:
getInteractionHandler in interface RecordPlot

getUndoableEditSupport

public UndoableEditSupport getUndoableEditSupport()
Returns the undo support object, or null if undo was not switched on.

Specified by:
getUndoableEditSupport in interface RecordPlot

getRecord

public Object getRecord()
Returns current record object.

Specified by:
getRecord in interface RecordPlot

supports

public boolean supports(InteractionHandler interactionHandler)
Returns true if this plot (and its projection) supports the specified interaction handler.

Specified by:
supports in interface RecordPlot

requestFocusInWindow

public boolean requestFocusInWindow()
Description copied from interface: RecordPlot
Requests focus in plot

Specified by:
requestFocusInWindow in interface RecordPlot
Overrides:
requestFocusInWindow in class JComponent

repaint

public void repaint()
Description copied from interface: RecordPlot
Repaint the plot

Specified by:
repaint in interface RecordPlot
Overrides:
repaint in class Component

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class Component

toString

public String toString()
Overrides:
toString in class Component

supports

public boolean supports(UndoableEdit edit)
Returns true if given edit is supported, which may depend on the current graphics panel.

Specified by:
supports in interface org.freehep.swing.undo.UndoableEditProcessor

postEdit

public void postEdit(UndoableEdit edit)
Handles an undoable edit, please use postEdit(WiredEdit).

Specified by:
postEdit in interface org.freehep.swing.undo.UndoableEditProcessor

postEdit

public void postEdit(org.freehep.swing.undo.DoableEdit edit)
Handles an doable edit, please use postEdit(WiredEdit).


postEdit

public void postEdit(WiredEdit edit)
Handles a Wired Edit. You may post the same edit to different plots, since edits are copied and afterwards attached to the plot. Any edits posted can be undone, if undoable support was switched on at creation time of the plot. Each plot has its own undo support.


postEdit

public void postEdit(WiredCompoundEdit edit)
Handles a Wired Compound Edit. You may post the same edit to different plots, since edits are copied (recursively) and afterwards attached to the plot. Any edits posted can be undone, if undoable support was switched on at creation time of the plot. Each plot has its own undo support.


beginUpdate

public void beginUpdate()
If multiple edits need to count as one major update, call this method to start a compound edit.

Specified by:
beginUpdate in interface org.freehep.swing.undo.UndoableEditProcessor

endUpdate

public void endUpdate()
If multiple edits need to count as one major update, call this method to end a compound edit.

Specified by:
endUpdate in interface org.freehep.swing.undo.UndoableEditProcessor

drawShape

public void drawShape(Shape shape)
Description copied from interface: RecordPlot
Draws the shape for feedback/interactivity purposes

Specified by:
drawShape in interface RecordPlot

paint

public void paint(Graphics g)
Overrides:
paint in class JComponent

modifyPopupMenu

public JPopupMenu modifyPopupMenu(JPopupMenu menu,
                                  Component source,
                                  Point p)
Specified by:
modifyPopupMenu in interface org.freehep.swing.popup.HasPopupItems

save

public void save(org.freehep.xml.io.XMLIOManager xmlioManager,
                 org.jdom.Element nodeEl)
Specified by:
save in interface org.freehep.xml.io.XMLIO

restore

public void restore(org.freehep.xml.io.XMLIOManager xmlioManager,
                    org.jdom.Element nodeEl)
Specified by:
restore in interface org.freehep.xml.io.XMLIO


Copyright © 1996-2013 FreeHEP. All Rights Reserved.