|
||||||||||
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.JPopupMenu com.jstatcom.ts.DefaultTSListPopup
public class DefaultTSListPopup
A PopupMenu
especially designed to work with the
TSList
component. It is invoked, when the RIGHT mouse button
is pressed over a time series list. The underlying TSList
can
be referenced by getTSList
after the popup was triggered. The
component also takes care, that the registered TSActionTypes
and TSMenuTypes
get a reference to the underlying
TSList
via the TSListAccessor
interface.
The DefaultTSListPopup
can be customized by adding/removing
TSActionTypes
or TSMenuTypes
. New
actions/menus can easily be created by subclassing TSActionTypes
or TSMenuTypes
. This is the preferred and easiest way of
costumizing the DefaultTSListPopup
, although subclassing or
using other methods provided by JPopupMenu
are also possible.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPopupMenu |
---|
javax.swing.JPopupMenu.Separator |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
DefaultTSListPopup(java.lang.String label)
Creates a DefaultTSListPopup with a descriptive name. |
Method Summary | |
---|---|
void |
addTSAction(TSActionTypes actionType)
Adds an action to this popup menu. |
void |
addTSActionAt(TSActionTypes actionType,
int pos)
Adds an action to this popup menu at a given index. |
void |
addTSMenu(com.jstatcom.ts.TSMenuTypes tsMenu)
Adds a menu to this popup menu. |
void |
addTSMenuAt(com.jstatcom.ts.TSMenuTypes tsMenu,
int pos)
Adds a menu to this popup menu at a given index. |
static DefaultTSListPopup |
getSharedInstance()
Returns an instance of the popup, that can be shared across all TSList instances. |
TSList |
getTSList()
Gets the reference to the underlying TSList that this
popup is invoked on. |
void |
processMouseEvent(java.awt.event.MouseEvent e,
javax.swing.MenuElement[] path,
javax.swing.MenuSelectionManager manager)
Triggers the popup menu if the invoker was a TSList . |
void |
removeAction(TSActionTypes actionType)
Removes actions from the popupmenu. |
void |
setTSList(TSList newTsList)
Sets the reference to the TSList that this popup is
invoked on. |
java.lang.String |
toString()
Returns a string representation of DefaultTSListPopup . |
Methods inherited from class javax.swing.JPopupMenu |
---|
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, processKeyEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, paint, paintImmediately, paintImmediately, print, printAll, 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, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, 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, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultTSListPopup(java.lang.String label)
DefaultTSListPopup
with a descriptive name. Use
this constructor only, if you need a instance that should be different
from getSharedInstance
.
label
- StringMethod Detail |
---|
public final void addTSAction(TSActionTypes actionType)
actionType
- the action to addpublic final void addTSActionAt(TSActionTypes actionType, int pos)
actionType
- the action to addpos
- index of new position
java.lang.IllegalArgumentException
- if pos
not validpublic final void addTSMenu(com.jstatcom.ts.TSMenuTypes tsMenu)
tsMenu
- the menu to addpublic final void addTSMenuAt(com.jstatcom.ts.TSMenuTypes tsMenu, int pos)
tsMenu
- the menu to addpos
- index of new position
java.lang.IllegalArgumentException
- if pos
not validpublic static DefaultTSListPopup getSharedInstance()
TSList
instances. It is also possible to create instances
with the constructor that can be individually configured and set to a
TSList
that should have a different popup.
public final TSList getTSList()
TSList
that this
popup is invoked on.
TSList
public void processMouseEvent(java.awt.event.MouseEvent e, javax.swing.MenuElement[] path, javax.swing.MenuSelectionManager manager)
TSList
.
processMouseEvent
in interface javax.swing.MenuElement
processMouseEvent
in class javax.swing.JPopupMenu
e
- the mouse eventpath
- can be null
in this contextmanager
- can be null
in this contextpublic final void removeAction(TSActionTypes actionType)
actionType
- the action to be removedpublic final void setTSList(TSList newTsList)
TSList
that this popup is
invoked on.
newTsList
- the list to be referencedpublic java.lang.String toString()
DefaultTSListPopup
.
toString
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |