java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jpicedt.widgets.IncrementableTextField
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public class IncrementableTextField
- extends javax.swing.JPanel
- implements java.awt.event.ActionListener
A JComponent that encompasses a traditional JTextField together with a +/- arrow field that allows the user to increment/decrement
the field's value.
- Since:
- PicEdt 1.3
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 |
Fields inherited from class java.awt.Container |
|
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, 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, transferFocusBackward, transferFocusUpCycle |
bPlus
private javax.swing.JButton bPlus
bMinus
private javax.swing.JButton bMinus
tf
private DecimalNumberField tf
iconLabel
private javax.swing.JLabel iconLabel
postFixLabel
private javax.swing.JLabel postFixLabel
value
private double value
increment
private double increment
isLowBounded
private boolean isLowBounded
isHighBounded
private boolean isHighBounded
minimum
private double minimum
maximum
private double maximum
dialogTitle
private java.lang.String dialogTitle
postFix
private java.lang.String postFix
actionCommand
private java.lang.String actionCommand
IncrementableTextField
public IncrementableTextField(double initialValue,
double increment,
javax.swing.Icon icon,
java.lang.String postFix)
- Creates a new IncrementableTextField with an etched border drawn around it.
IncrementableTextField
public IncrementableTextField(double initialValue,
double increment,
javax.swing.Icon icon,
java.lang.String postFix,
boolean drawBorder)
setBoundValues
public void setBoundValues(int minimum,
int maximum)
- sets minimum and maximum bounds for "value" to the given doubles
setMinimum
public void setMinimum(double minimum)
- sets minimum bound for "value" to the given double
setMaximum
public void setMaximum(double maximum)
- sets maximum bound for "value" to the given double
getMaximum
public double getMaximum()
getMinimum
public double getMinimum()
setLowBounded
public void setLowBounded(boolean state)
isLowBounded
public boolean isLowBounded()
setHighBounded
public void setHighBounded(boolean state)
isHighBounded
public boolean isHighBounded()
setDialogTitle
public void setDialogTitle(java.lang.String title)
- sets the title of the JDialog that opens when a NumberFormatException occurs
setPostFix
public void setPostFix(java.lang.String s)
- sets the post-fix string
getPostFix
public java.lang.String getPostFix()
setActionCommand
public void setActionCommand(java.lang.String s)
- sets the actionCommand for this component to the given string
getActionCommand
public java.lang.String getActionCommand()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- this method is public as an implementation side effect
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
getValue
public double getValue()
setValue
public void setValue(double value)
- sets the DecimalNumberField double value, as well as the internal copy, to the given value, possibly modifying it so that it fits within the limits.
setEnabled
public void setEnabled(boolean b)
- set the enable state of this component
isEnabled
public boolean isEnabled()
- Return the "enabled" state of this component
fireActionPerformed
protected void fireActionPerformed(java.awt.event.ActionEvent event)
- Notify all listeners that have registered interest for
notification on this event type. The event instance
is lazily created using the parameters passed into
the fire method.
addActionListener
public void addActionListener(java.awt.event.ActionListener l)
- adds an ActionListener to the component
removeActionListener
public void removeActionListener(java.awt.event.ActionListener l)
- removes an ActionListener from the component