Ontimize 5.2072EN

com.ontimize.gui.table
Class DateCellRenderer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended byjavax.swing.table.DefaultTableCellRenderer
                      extended bycom.ontimize.gui.table.CellRenderer
                          extended bycom.ontimize.gui.table.DateCellRenderer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants, javax.swing.table.TableCellRenderer

public class DateCellRenderer
extends CellRenderer
implements Internationalization

Renderer used to show the date and timestamp data in a table.

Version:
1.0 01/04/2001
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.ontimize.gui.table.CellRenderer
CellRenderer.CellRendererColorManager, CellRenderer.CellRendererFontManager
 
Nested classes inherited from class javax.swing.table.DefaultTableCellRenderer
javax.swing.table.DefaultTableCellRenderer.UIResource
 
Nested classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
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.text.SimpleDateFormat dateFormat
           
protected  java.lang.String datePattern
           
static boolean hourDefaultValueFirst
           
protected  boolean hourInFirstPlace
           
protected  boolean hourOnly
           
protected  java.lang.String hourPattern
           
protected  boolean withHour
           
 
Fields inherited from class com.ontimize.gui.table.CellRenderer
CELLRENDERER_NAME, cellRendererColorManager, cellRendererFontManager, component, configureRenderer, editableFontColor, emptyBorder, evenEditableBackgroundColor, evenRowBackgroundColor, focusBorder, focusBorderColor, font, fontColor, format, noRequiredInsertColumns, oddEditableBackgroundColor, oddRowBackgroundColor, prefSize, remarkEditable, remarkLines, requiredInsertColumns, selectedBackgroundColor, selectedEditableBackgroundColor, selectedFontColor
 
Fields inherited from class javax.swing.table.DefaultTableCellRenderer
noFocusBorder
 
Fields inherited from class javax.swing.JLabel
labelFor
 
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.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DateCellRenderer()
           
DateCellRenderer(boolean withHour)
           
DateCellRenderer(boolean withHour, boolean hourFirst)
           
DateCellRenderer(boolean withHour, boolean hourFirst, boolean onlyHour)
           
DateCellRenderer(java.util.Hashtable params)
           
 
Method Summary
protected  void buildPattern()
           
protected  void createFormatter(java.util.Locale locale)
           
protected  void createNewFormatter(java.util.Locale l)
           
 java.lang.String getDatePattern()
           
 java.lang.String getHourPattern()
           
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean selected, boolean hasFocus, int row, int column)
           
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
 boolean isHourInFirstPlace()
           
 boolean isHourOnly()
           
 boolean isWithHour()
           
 void setComponentLocale(java.util.Locale l)
           
 void setResourceBundle(java.util.ResourceBundle res)
          Sets the language resource bundle.
 
Methods inherited from class com.ontimize.gui.table.CellRenderer
calculatePreferredTextWidth, calculatePreferredTextWidth, getDarker, getDefaultFocusBorder, getEvenRowBackgroundColor, getFont, getFontMetrics, getName, getPreferredSize, getShownText, getSoftDarker, isInsertingRow, isRequiredInsertingRow, setCellRendererColorManager, setCellRendererFontManager, setEditableRemark, setEvenRowBackgroundColor, setFormater, setJComponent, setLineRemark, setTipWhenNeeded, updateUI
 
Methods inherited from class javax.swing.table.DefaultTableCellRenderer
firePropertyChange, firePropertyChange, isOpaque, repaint, repaint, revalidate, setBackground, setForeground, setValue, validate
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, 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, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, 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, 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, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hourDefaultValueFirst

public static boolean hourDefaultValueFirst

dateFormat

protected java.text.SimpleDateFormat dateFormat

datePattern

protected java.lang.String datePattern

hourPattern

protected java.lang.String hourPattern

withHour

protected boolean withHour

hourOnly

protected boolean hourOnly

hourInFirstPlace

protected boolean hourInFirstPlace
Constructor Detail

DateCellRenderer

public DateCellRenderer()

DateCellRenderer

public DateCellRenderer(java.util.Hashtable params)

DateCellRenderer

public DateCellRenderer(boolean withHour)

DateCellRenderer

public DateCellRenderer(boolean withHour,
                        boolean hourFirst)

DateCellRenderer

public DateCellRenderer(boolean withHour,
                        boolean hourFirst,
                        boolean onlyHour)
Method Detail

createNewFormatter

protected void createNewFormatter(java.util.Locale l)

createFormatter

protected void createFormatter(java.util.Locale locale)

buildPattern

protected void buildPattern()

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean selected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Overrides:
getTableCellRendererComponent in class CellRenderer

getDatePattern

public java.lang.String getDatePattern()

getHourPattern

public java.lang.String getHourPattern()

isWithHour

public boolean isWithHour()

isHourOnly

public boolean isHourOnly()

isHourInFirstPlace

public boolean isHourInFirstPlace()

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Parameters:
res - the new language bundle.

setComponentLocale

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

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Description copied from interface: Internationalization
Returns all the texts in the element suitable for being translated.

Specified by:
getTextsToTranslate in interface Internationalization
Returns:
all the texts in the element suitable for being translated.

Ontimize