JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing
Class JCPopupCalendar.DateRenderer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLabel
                          |
                          +--javax.swing.DefaultListCellRenderer
                                |
                                +--com.klg.jclass.swing.JCPopupCalendar.DateRenderer
All Implemented Interfaces:
Accessible, ImageObserver, ListCellRenderer, MenuContainer, Serializable, SwingConstants
Enclosing class:
JCPopupCalendar

public class JCPopupCalendar.DateRenderer
extends DefaultListCellRenderer

The default renderer for the JCPopupCalendar.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.DefaultListCellRenderer
DefaultListCellRenderer.UIResource
 
Nested classes inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int calendarType
          The type of calendar - either Date_TIME or DATE.
protected  DateFormat format
          The format object to format dates.
protected  com.klg.jclass.swing.JCPopupCalendar popupCalendar
          The parent popup calendar.
 
Fields inherited from class javax.swing.DefaultListCellRenderer
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 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
JCPopupCalendar.DateRenderer(com.klg.jclass.swing.JCPopupCalendar popupCalendar, int calendarType, Date d)
          Create a DateRenderer given its parent, the type of calendar, and an initial date.
JCPopupCalendar.DateRenderer(com.klg.jclass.swing.JCPopupCalendar popupCalendar, int calendarType, Date d, Locale l)
          Create a DateRenderer given its parent, the type of calendar, an initial date, and a locale.
 
Method Summary
 int getCalendarType()
          Get the calendar type for the renderer.
 DateFormat getFormat()
          Return the format used by the renderer.
 Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
          Return a component that has been configured to display the specified value.
 com.klg.jclass.swing.JCPopupCalendar getPopupCalendar()
          Return the renderer's JCPopupCalendar parent.
 void setCalendarType(int calendarType)
          Set the calendarType on the renderer.
 void setFormat(DateFormat df)
          Set the format to use for the renderer.
 void setLocale(Locale locale)
          Set the locale on the renderer.
 
Methods inherited from class javax.swing.DefaultListCellRenderer
firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, repaint, repaint, revalidate, 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, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, 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, 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, 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, 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

popupCalendar

protected com.klg.jclass.swing.JCPopupCalendar popupCalendar
The parent popup calendar.


calendarType

protected int calendarType
The type of calendar - either Date_TIME or DATE.


format

protected DateFormat format
The format object to format dates.

Constructor Detail

JCPopupCalendar.DateRenderer

public JCPopupCalendar.DateRenderer(com.klg.jclass.swing.JCPopupCalendar popupCalendar,
                                    int calendarType,
                                    Date d)
Create a DateRenderer given its parent, the type of calendar, and an initial date.

Parameters:
popupCalendar - The parent popup calendar
calendarType - The type of calendar. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE
d - The initial date for the editor

JCPopupCalendar.DateRenderer

public JCPopupCalendar.DateRenderer(com.klg.jclass.swing.JCPopupCalendar popupCalendar,
                                    int calendarType,
                                    Date d,
                                    Locale l)
Create a DateRenderer given its parent, the type of calendar, an initial date, and a locale.

Parameters:
popupCalendar - The parent popup calendar.
calendarType - The type of calendar. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE
d - The initial date for the editor.
l - The locale to use.
Method Detail

getPopupCalendar

public com.klg.jclass.swing.JCPopupCalendar getPopupCalendar()
Return the renderer's JCPopupCalendar parent.

Returns:
The parent

getCalendarType

public int getCalendarType()
Get the calendar type for the renderer. Will be one of JCPopupCalendar.DATE_TIME which means both the date and the time are shown or JCPopupCalendar.DATE which means only the date is shown.

Returns:
The current calendar type

setCalendarType

public void setCalendarType(int calendarType)
Set the calendarType on the renderer. This method will also update the format of the renderer to the default one for the new calendarType.

Parameters:
calendarType - The new calendarType. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE

setLocale

public void setLocale(Locale locale)
Set the locale on the renderer. This method will also update the format of the renderer to the default one for the new locale.

Overrides:
setLocale in class Component
Parameters:
locale - The new locale

getFormat

public DateFormat getFormat()
Return the format used by the renderer.

Returns:
The current formatter

setFormat

public void setFormat(DateFormat df)
Set the format to use for the renderer.

Parameters:
df - The new format

getListCellRendererComponent

public Component getListCellRendererComponent(JList list,
                                              Object value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus)
Return a component that has been configured to display the specified value. That component's paint method is then called to "render" the cell. If it is necessary to compute the dimensions of a list because the list cells do not have a fixed size, this method is called to generate a component on which getPreferredSize can be invoked.

Specified by:
getListCellRendererComponent in interface ListCellRenderer
Overrides:
getListCellRendererComponent in class DefaultListCellRenderer
Parameters:
list - The JList we're painting.
value - The value returned by list.getModel().getElementAt(index).
index - The cells index.
isSelected - True if the specified cell was selected.
cellHasFocus - True if the specified cell has the focus.
Returns:
A component whose paint() method will render the specified value.
See Also:
JList, ListSelectionModel, ListModel

Copyright © 2004 Quest Software Inc..
All rights reserved.