com.jstatcom.table
Class JSCPopupTypes
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPopupMenu
-
- com.jstatcom.table.JSCPopupTypes
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.MenuElement
public abstract class JSCPopupTypes extends javax.swing.JPopupMenu implements java.awt.event.ActionListenerTheDataTablePopupTypesclass defines different popups that can be used by data tables. This class can be extended to provide special popup menus in a certain context on aJSCDataTable.It implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21) . If you compare
DataTablePopupTypes, always use the==operator. This is save, because they are Singletons (Gamma et al., 1995) .- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
javax.swing.JPopupMenu.Separator
-
-
Field Summary
Fields Modifier and Type Field and Description static JSCPopupTypesCLICK_01PopupMenufor click change between * and 0.static JSCPopupTypesCLICK_012PopupMenufor click change between * , 0 and !.static JSCPopupTypesPRECISIONPopupMenufor precision change, as well as to toggle the use of scientific representation of numbers.static JSCPopupTypesPRECISION_NOSCIENTIFICPopupMenufor precision change.-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent evt)DataTablePopupTypesimplementActionListenerand can therefore register themselves as listeners, for example with the menu items that are added to them.booleanequals(java.lang.Object o)Override prevention method to enforcea.equals(b)if and onlyif a==b.java.awt.ComponentgetDataTable()Gets a reference to the unterlying data table.java.lang.StringgetName()Gets the name of this type.inthashCode()Override prevention method invokes super method.voidprocessMouseEvent(java.awt.event.MouseEvent e, javax.swing.MenuElement[] path, javax.swing.MenuSelectionManager manager)Triggers the popup menu if the invoker was aJSCDataTablewith a number type.voidsetDataTable(java.awt.Component newDataTable)Sets a reference to the unterlying data table.java.lang.StringtoString()Gets a string representing this type, do not use for comparisons.-
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, hide, 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, 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, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
CLICK_01
public static final JSCPopupTypes CLICK_01
PopupMenufor click change between * and 0. If a subset restriction is set, the corresponding element is not changed.
-
CLICK_012
public static final JSCPopupTypes CLICK_012
PopupMenufor click change between * , 0 and !. If a subset restriction is set, the corresponding element is not changed.
-
PRECISION
public static final JSCPopupTypes PRECISION
PopupMenufor precision change, as well as to toggle the use of scientific representation of numbers.
-
PRECISION_NOSCIENTIFIC
public static final JSCPopupTypes PRECISION_NOSCIENTIFIC
PopupMenufor precision change.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent evt)
DataTablePopupTypesimplementActionListenerand can therefore register themselves as listeners, for example with the menu items that are added to them. Subclasses can overwrite the empty default implementation of this method.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
evt- the action event
-
equals
public final boolean equals(java.lang.Object o)
Override prevention method to enforcea.equals(b)if and onlyif a==b.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare with- Returns:
trueif equal,falseotherwise
-
getDataTable
public final java.awt.Component getDataTable()
Gets a reference to the unterlying data table.- Returns:
- the data table
-
getName
public final java.lang.String getName()
Gets the name of this type.- Overrides:
getNamein classjava.awt.Component- Returns:
- a descriptive name
-
hashCode
public final int hashCode()
Override prevention method invokes super method.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code
-
processMouseEvent
public void processMouseEvent(java.awt.event.MouseEvent e, javax.swing.MenuElement[] path, javax.swing.MenuSelectionManager manager)Triggers the popup menu if the invoker was aJSCDataTablewith a number type.- Specified by:
processMouseEventin interfacejavax.swing.MenuElement- Overrides:
processMouseEventin classjavax.swing.JPopupMenu- Parameters:
e- the mouse eventpath- can benullin this contextmanager- can benullin this context
-
setDataTable
public final void setDataTable(java.awt.Component newDataTable)
Sets a reference to the unterlying data table.- Parameters:
newDataTable- the data table
-
toString
public final java.lang.String toString()
Gets a string representing this type, do not use for comparisons.- Overrides:
toStringin classjava.awt.Component- Returns:
- string representation
-
-
DMelt 3.0 © DataMelt by jWork.ORG