Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.widgets
Class IncrementableTextField  view IncrementableTextField download IncrementableTextField.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byjpicedt.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 Class Summary
 
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
 
Field Summary
private  java.lang.String actionCommand
           
private  javax.swing.JButton bMinus
           
private  javax.swing.JButton bPlus
           
private  java.lang.String dialogTitle
           
private  javax.swing.JLabel iconLabel
           
private  double increment
           
private  boolean isHighBounded
           
private  boolean isLowBounded
           
private  double maximum
           
private  double minimum
           
private  java.lang.String postFix
           
private  javax.swing.JLabel postFixLabel
           
private  DecimalNumberField tf
           
private  double value
           
 
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.Container
 
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
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(double initialValue, double increment, javax.swing.Icon icon, java.lang.String postFix, boolean drawBorder)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          this method is public as an implementation side effect
 void addActionListener(java.awt.event.ActionListener l)
          adds an ActionListener to the component
protected  void fireActionPerformed(java.awt.event.ActionEvent event)
          Notify all listeners that have registered interest for notification on this event type.
 java.lang.String getActionCommand()
           
 double getMaximum()
           
 double getMinimum()
           
 java.lang.String getPostFix()
           
 double getValue()
           
 boolean isEnabled()
          Return the "enabled" state of this component
 boolean isHighBounded()
           
 boolean isLowBounded()
           
 void removeActionListener(java.awt.event.ActionListener l)
          removes an ActionListener from the component
 void setActionCommand(java.lang.String s)
          sets the actionCommand for this component to the given string
 void setBoundValues(int minimum, int maximum)
          sets minimum and maximum bounds for "value" to the given doubles
 void setDialogTitle(java.lang.String title)
          sets the title of the JDialog that opens when a NumberFormatException occurs
 void setEnabled(boolean b)
          set the enable state of this component
 void setHighBounded(boolean state)
           
 void setLowBounded(boolean state)
           
 void setMaximum(double maximum)
          sets maximum bound for "value" to the given double
 void setMinimum(double minimum)
          sets minimum bound for "value" to the given double
 void setPostFix(java.lang.String s)
          sets the post-fix string
 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.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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