Ontimize 5.2072EN

com.ontimize.gui.field
Class SpinnerDataField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.ontimize.gui.field.DataField
                      extended bycom.ontimize.gui.field.SpinnerDataField
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, ApplicationPreferencesListener, DataComponent, java.util.EventListener, FormComponent, HasHelpIdComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, SecureElement, java.io.Serializable, ValueChangeDataComponent

public class SpinnerDataField
extends DataField

Field similar to JSpinner that allows to modify value (increasing/decreasing) with two selectors.

XML parameters for configuration of this field can be found here:
init(Hashtable)

Since:
5.2059EN
Author:
Imatia Innovation SL
See Also:
Serialized Form

Nested Class Summary
protected static class SpinnerDataField.EJSpinner
           
protected  class SpinnerDataField.InnerDocumentListener
           
protected  class SpinnerDataField.InnerListener
          This class implements a inner listener for field.
 
Nested classes inherited from class com.ontimize.gui.field.DataField
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButton
 
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
static java.lang.String CALENDAR
           
protected  java.lang.String format
           
static java.lang.String FORMAT
           
protected  javax.swing.JCheckBoxMenuItem includeMenu
           
protected  SpinnerDataField.InnerDocumentListener innerDocumentListener
           
protected  SpinnerDataField.InnerListener innerListener
          The inner listener instance.
static java.lang.String MAX
           
static java.lang.String MIN
           
static java.lang.String NUMBER
           
protected  int numberclass
           
static java.lang.String NUMBERCLASS
           
static java.lang.String STEP
           
protected  java.lang.String type
           
static java.lang.String TYPE
           
static java.lang.String TYPE_DATE
           
static java.lang.String TYPE_NUMBER
           
static java.lang.String TYPE_TEXT
           
protected  java.lang.Object values
           
static java.lang.String VALUES
           
 
Fields inherited from class com.ontimize.gui.field.DataField
advancedQueryMode, ALIGN, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alignment, ASTERISK_REQUIRED_STYLE, ATTR, attribute, backgroundColor, BGCOLOR, bold, BOLD, BORDER, BORDER_REQUIRED_STYLE, borderText, BOTTOM, CENTER, CLIPBOARD_COPY, CLIPBOARD_COPY_es_ES, CLIPBOARD_CUT, CLIPBOARD_CUT_es_ES, CLIPBOARD_PASTE, CLIPBOARD_PASTE_es_ES, conditions, dataField, DEFAULT_BORDER, DEFAULT_BOTTOM_MARGIN, DEFAULT_FIELD_LEFT_MARGIN, DEFAULT_FIELD_RIGHT_MARGIN, DEFAULT_LABEL_LEFT_MARGIN, DEFAULT_LABEL_RIGHT_MARGIN, DEFAULT_PARENT_MARGIN, DEFAULT_PARENT_MARGIN_FOR_SCROLL, DEFAULT_TOP_MARGIN, defaultAsteriskColor, DEFAULTBORDER, defaultDisableBackgroundColor, defaultFieldButtonHigh, defaultPreferenceTextNotRetrievedFromPreferences, DEFINE_HELP_FIELD_PREFERENCE, dim, DIM, disabledbgcolor, DISABLEDBGCOLOR, empty, enabled, ENABLED, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, isEnabled, LABELALIGN, labelComponent, LABELFONT, LABELFONTCOLOR, labelPosition, LABELPOSITION, LABELSIZE, labelText, LABELVISIBLE, LEFT, locale, LOWERED, menuCopy, menuCut, menuDefineHelpPreference, menuHelpPreferences, menuPaste, modifiable, NO_STR, NONE, noRequiredBorder, OPAQUE, originalSize, OUTBORDER, panel, parentForm, permissionActivate, permissionVisible, popupMenu, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, resources, restricted, RIGHT, show, showLabel, SIZE, TEXT_STR, TEXTALIGN, textAlignment, textHelpPreference, TIP, tipKey, TOP, validData, VALIGN, Valignment, valueListener, valueSave, VISIBLE, VISUALIZE_HELP_FIELD_PREFERENCE, weightDataFieldH, weightPanelH, width, WIDTH, x, X, y, Y, YES_STR
 
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 com.ontimize.gui.field.DataComponent
COMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
SpinnerDataField(java.util.Hashtable parameters)
           
 
Method Summary
protected  void createDataField()
           
protected  void createPopupMenu()
          Creates a pop-up menu.
 void deleteData()
          The method to delete data for component.
 int getSQLDataType()
          Returns the sql data type according to java.sql.Types
 java.lang.Object getValue()
          Gets the value of a component.
 void init(java.util.Hashtable parameters)
          Method that reads the xml parameters.
protected  void installInnerDocumentListener()
           
protected  void installInnerListener()
          Installs the inner listener.
 boolean isEmpty()
          Checks the data existence in component.
 boolean isModified()
          This method should be return true when data have been modified.
 void setAdvancedQueryMode(boolean enabled)
           
 void setComponentLocale(java.util.Locale l)
           
 void setEnabled(boolean enabled)
          Enables the field to insert data.
protected  void setInnerListenerEnabled(boolean enabled)
           
 void setValue(java.lang.Object value)
          Sets the value for component.
protected  void showPopupMenu(java.awt.Component c, int x, int y)
          Shows the pop-up menu.
 
Methods inherited from class com.ontimize.gui.field.DataField
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, defineHelpField, finalize, fireValueChanged, getAttribute, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelComponentText, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getText, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModifiable, isRequired, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setResourceBundle, setVisible, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, updateUI, validateComponentPositions
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, 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, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, 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, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static java.lang.String TYPE

TYPE_NUMBER

public static java.lang.String TYPE_NUMBER

TYPE_TEXT

public static java.lang.String TYPE_TEXT

TYPE_DATE

public static java.lang.String TYPE_DATE

VALUES

public static java.lang.String VALUES

MIN

public static java.lang.String MIN

MAX

public static java.lang.String MAX

STEP

public static java.lang.String STEP

NUMBER

public static java.lang.String NUMBER

NUMBERCLASS

public static java.lang.String NUMBERCLASS

CALENDAR

public static java.lang.String CALENDAR

FORMAT

public static java.lang.String FORMAT

type

protected java.lang.String type

numberclass

protected int numberclass

format

protected java.lang.String format

values

protected java.lang.Object values

innerListener

protected SpinnerDataField.InnerListener innerListener
The inner listener instance.


includeMenu

protected javax.swing.JCheckBoxMenuItem includeMenu

innerDocumentListener

protected SpinnerDataField.InnerDocumentListener innerDocumentListener
Constructor Detail

SpinnerDataField

public SpinnerDataField(java.util.Hashtable parameters)
Method Detail

init

public void init(java.util.Hashtable parameters)
Method that reads the xml parameters.

Specified by:
init in interface FormComponent
Overrides:
init in class DataField
Parameters:
parameters - the Hashtable with parameters. Allows the next parameters:

attribute values default required meaning
max no Maximum value for spinner when not specified 'values' and type is number.
min no Minimum value for spinner when not specified 'values' and type is number.
numberclass Integer/Float/Long/Double Integer no Number class that uses spinner in data model. It used when type is number
step no Step used to increase/decrease value in spinner when type is number.
type text/number text no The type of data allowed for this field.
values no Used to set a fixed values to spinner. Available for type text and number.

setInnerListenerEnabled

protected void setInnerListenerEnabled(boolean enabled)

installInnerListener

protected void installInnerListener()
Installs the inner listener.


installInnerDocumentListener

protected void installInnerDocumentListener()

deleteData

public void deleteData()
Description copied from interface: DataComponent
The method to delete data for component.


getSQLDataType

public int getSQLDataType()
Description copied from interface: DataComponent
Returns the sql data type according to java.sql.Types

Returns:
the Integer type

isModified

public boolean isModified()
Description copied from interface: DataComponent
This method should be return true when data have been modified. The method setValue() should be change this condition.

Specified by:
isModified in interface DataComponent
Overrides:
isModified in class DataField

isEmpty

public boolean isEmpty()
Description copied from interface: DataComponent
Checks the data existence in component.

Returns:
true when component is empty

getValue

public java.lang.Object getValue()
Description copied from interface: DataComponent
Gets the value of a component.

Returns:
the object with value.

setValue

public void setValue(java.lang.Object value)
Description copied from interface: DataComponent
Sets the value for component.

Parameters:
value - the object with value to set

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: DataField
Enables the field to insert data.

Specified by:
setEnabled in interface FormComponent
Overrides:
setEnabled in class DataField
Parameters:
enabled - the condition to set enable

createDataField

protected void createDataField()

createPopupMenu

protected void createPopupMenu()
Description copied from class: DataField
Creates a pop-up menu.

Overrides:
createPopupMenu in class DataField

showPopupMenu

protected void showPopupMenu(java.awt.Component c,
                             int x,
                             int y)
Description copied from class: DataField
Shows the pop-up menu.

Overrides:
showPopupMenu in class DataField
Parameters:
c - the component
x - the x coordinate
y - the y coordinate

setAdvancedQueryMode

public void setAdvancedQueryMode(boolean enabled)

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization
Overrides:
setComponentLocale in class DataField

Ontimize