Ontimize 5.2072EN

com.ontimize.gui.field
Class HourDateDataField

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.TextFieldDataField
                          extended bycom.ontimize.gui.field.DateDataField
                              extended bycom.ontimize.gui.field.HourDateDataField
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, AdvancedDataComponent, ApplicationPreferencesListener, DataComponent, java.util.EventListener, FormComponent, Freeable, HasHelpIdComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, OpenDialog, SecureElement, java.io.Serializable, ValueChangeDataComponent

public class HourDateDataField
extends DateDataField

This class implements a data field with date and hours. Moreover, it is possible to show an associated calendar with this field.

Author:
Imatia Innovation
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.ontimize.gui.field.DateDataField
DateDataField.CloseAction
 
Nested classes inherited from class com.ontimize.gui.field.TextFieldDataField
TextFieldDataField.EJTextField, TextFieldDataField.InnerDocumentListener
 
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
protected  java.lang.String dateAttribute
           
protected  boolean dateVisible
           
protected  javax.swing.JTextField hourField
           
 
Fields inherited from class com.ontimize.gui.field.DateDataField
advancedHelpBMenu, calendarButton, calendarChange, calendarComp, calendarTitleKey, DEBUG_DATE, emphasizeInvalidDate, frame, locale, mainCalendar, vCalendar
 
Fields inherited from class com.ontimize.gui.field.TextFieldDataField
disabledTextColor, innerListener
 
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, 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.AdvancedDataComponent
ADVANCED_QUERY
 
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
HourDateDataField(java.util.Hashtable parameters)
          The class constructor.
 
Method Summary
 void deleteData()
          Deletes the date of the data field.
protected  void formatHour()
          Formats the hour.
 java.lang.Object getDateValue()
          Gets the Date value.
 javax.swing.JTextField getHourField()
          Gets the hour field.
 java.lang.Object getValue()
          Gets the Timestamp value.
 void init(java.util.Hashtable parameters)
          Initializes parameters.
 boolean isEmpty()
          Checks the presence and validity of data.
 void setComponentLocale(java.util.Locale loc)
          Sets the Component Locale, to format date, specified in parameter.
 void setEnabled(boolean enabled)
          Checks the variable that indicates if user has permission to introduce values into the datafield.
 void setFontSize(int fontSize)
          Sets font size to size parameter.
 void setParentForm(Form form)
          Method declaration to set the form that contains the component.
 void setResourceBundle(java.util.ResourceBundle res)
          Sets the resource bundle.
 void setValue(java.lang.Object value)
          Sets the field value by program when auxValue is a instance of java.sql.timestamp or java.util.
 void setValueFromComponent(java.lang.Object componentValue)
          Sets the field value by user when auxValue is a instance of java.sql.timestamp or java.util.
 void setVisible(boolean visible)
          Description method to set visible or not the component according the boolean condition in parameter.
protected  void updateBackgroundColor()
          Updates the background color.
 
Methods inherited from class com.ontimize.gui.field.DateDataField
colorSelection, createPopupMenu, format, free, getDataFieldPreferredSize, getSameCountryLocale, getSQLDataType, hiddenCalendar, installInnerListener, isModified, setAdvancedQueryMode, setDocument, setEmphasizeInvalidDate, setParentFrame, showCalendar, showPopupMenu
 
Methods inherited from class com.ontimize.gui.field.TextFieldDataField
createDataField, getAttribute, getInnerListenerEnabled, getInnerValue, getLabelComponentText, getText, isInnerValueEqual, isModifiable, isRequired, setInnerListenerEnabled, setInnerValue
 
Methods inherited from class com.ontimize.gui.field.DataField
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, defineHelpField, finalize, fireValueChanged, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setFont, setFontColor, setLabelFontColor, setModifiable, setRequired, setRequiredFieldBackground, 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
 
Methods inherited from interface com.ontimize.gui.field.DataComponent
getLabelComponentText, isHidden, isModifiable, isRequired, setModifiable, setRequired
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
getConstraints, isEnabled
 
Methods inherited from interface com.ontimize.gui.i18n.Internationalization
getTextsToTranslate
 
Methods inherited from interface com.ontimize.gui.field.IdentifiedElement
getAttribute
 
Methods inherited from interface com.ontimize.gui.SecureElement
initPermissions, isRestricted
 

Field Detail

hourField

protected javax.swing.JTextField hourField

dateVisible

protected boolean dateVisible

dateAttribute

protected java.lang.String dateAttribute
Constructor Detail

HourDateDataField

public HourDateDataField(java.util.Hashtable parameters)
The class constructor. Calls to super with parameters, fixes the constrains, sets listeners and initializes parameters.

Parameters:
parameters - the Hashtable with parameters.
Method Detail

init

public void init(java.util.Hashtable parameters)
Initializes parameters.

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

attribute values default required meaning
datevisible yes/no yes no Indicates the visibility condition of date field and calendar button.
date no The date for the field will be fixed by this attribute. Creates a dependence with other date field.
hourfieldsize integer value 6 no The number of columns in the hour JTextField.

setFontSize

public void setFontSize(int fontSize)
Description copied from class: DataField
Sets font size to size parameter.

Overrides:
setFontSize in class DataField
Parameters:
fontSize - the font size parameter

setParentForm

public void setParentForm(Form form)
Description copied from interface: AccessForm
Method declaration to set the form that contains the component. This method must be called automatically during the form building.

Specified by:
setParentForm in interface AccessForm
Overrides:
setParentForm in class DataField

setVisible

public void setVisible(boolean visible)
Description copied from interface: FormComponent
Description method to set visible or not the component according the boolean condition in parameter.

Specified by:
setVisible in interface FormComponent
Overrides:
setVisible in class DataField

getDateValue

public java.lang.Object getDateValue()
Description copied from class: DateDataField
Gets the Date value.

Overrides:
getDateValue in class DateDataField
Returns:
an Object with the Date value

formatHour

protected void formatHour()
Formats the hour.

See Also:
HourDocument.format()

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: DateDataField
Checks the variable that indicates if user has permission to introduce values into the datafield.

Specified by:
setEnabled in interface FormComponent
Overrides:
setEnabled in class DateDataField
Parameters:
enabled - boolean to change permissions

setComponentLocale

public void setComponentLocale(java.util.Locale loc)
Description copied from class: DateDataField
Sets the Component Locale, to format date, specified in parameter.

Specified by:
setComponentLocale in interface Internationalization
Overrides:
setComponentLocale in class DateDataField

isEmpty

public boolean isEmpty()
Description copied from class: DateDataField
Checks the presence and validity of data.

Specified by:
isEmpty in interface DataComponent
Overrides:
isEmpty in class DateDataField
Returns:
boolean true with valid data. False with invalid or empty data.

deleteData

public void deleteData()
Description copied from class: DateDataField
Deletes the date of the data field. During the method execution the inner Listener is disabled.

Specified by:
deleteData in interface DataComponent
Overrides:
deleteData in class DateDataField

getValue

public java.lang.Object getValue()
Description copied from class: DateDataField
Gets the Timestamp value.

Specified by:
getValue in interface DataComponent
Overrides:
getValue in class DateDataField
Returns:
an Object with the Timestamp value

setValueFromComponent

public void setValueFromComponent(java.lang.Object componentValue)
Description copied from class: DateDataField
Sets the field value by user when auxValue is a instance of java.sql.timestamp or java.util. During the method execution the inner Listener is disabled.

Overrides:
setValueFromComponent in class DateDataField
Parameters:
componentValue - Date or Timestamp Object
See Also:
ValueEvent.USER_CHANGE

setValue

public void setValue(java.lang.Object value)
Description copied from class: DateDataField
Sets the field value by program when auxValue is a instance of java.sql.timestamp or java.util. During the method execution the inner Listener is disabled.

Specified by:
setValue in interface DataComponent
Overrides:
setValue in class DateDataField
Parameters:
value - Date or Timestamp Object
See Also:
ValueEvent.PROGRAMMATIC_CHANGE

getHourField

public javax.swing.JTextField getHourField()
Gets the hour field.

Returns:
the hour field value.

updateBackgroundColor

protected void updateBackgroundColor()
Description copied from class: DataField
Updates the background color.

Overrides:
updateBackgroundColor in class DataField

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Description copied from class: DateDataField
Sets the resource bundle. Also changes the title calendar in case this is specified.

Specified by:
setResourceBundle in interface Internationalization
Overrides:
setResourceBundle in class DateDataField
Parameters:
res - the resource bundle to change

Ontimize