LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJDateSelector

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by leon.view.win.swing.component.LyJDateSelector
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, LyEventTransmitter, LyGetIdInterface, LyGetValueInterface, LySetValueInterface

public class LyJDateSelector
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, LyGetValueInterface, LySetValueInterface, LyGetIdInterface, LyEventTransmitter

This class implements the calendar selection tool for swing viewer.

See Also:
LySwingDate, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String __VERSION
           
static float COL_SPACING
          Separation space between days in the calendar representation.
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LyJDateSelector()
          Default date selector constructor.
LyJDateSelector(java.util.Locale loc)
          Date selector constructor.
LyJDateSelector(java.lang.String id, java.util.TimeZone tz, java.util.Locale loc)
          Date selector constructor.
 
Method Summary
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 int getDayCount(java.util.Calendar calDate)
          Gets the number of days in the specified month/year.
 java.lang.String getId()
          Return current component identification (LyGetIdInterface interface).
 int getNavigationArea(int x, int y)
          Checks if the specified (x,y) position is in the navigation area.
 java.awt.Dimension getPreferredSize()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          This date selector doesn't handle selection events, so it has no selection transmitter.
 java.lang.String getValue()
          (non-Javadoc).
 void mouseClicked(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mouseDragged(java.awt.event.MouseEvent e)
          Nothing is done when mouse is dragged over a component.
 void mouseEntered(java.awt.event.MouseEvent e)
          Nothing is done when mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Nothing is done when mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mousePressed(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mouseReleased(java.awt.event.MouseEvent e)
          Nothing is done on mouse release.
 void paintComponent(java.awt.Graphics g)
          (non-Javadoc).
 void setDateFormat(java.lang.String format)
          Sets the requested date format.
 void setValue(java.lang.String str)
          (non-Javadoc).
 void update(java.awt.Graphics g)
          (non-Javadoc).
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

COL_SPACING

public static float COL_SPACING
Separation space between days in the calendar representation.

Constructor Detail

LyJDateSelector

public LyJDateSelector()
Default date selector constructor.

The identifier used in this constructor is DEFAULT_IDENTIFIER. No timezone or locale is used.


LyJDateSelector

public LyJDateSelector(java.util.Locale loc)
Date selector constructor.

The identifier used in this constructor is DEFAULT_IDENTIFIER. No timezone is used.

Parameters:
loc - the locale for the week data

LyJDateSelector

public LyJDateSelector(java.lang.String id,
                       java.util.TimeZone tz,
                       java.util.Locale loc)
Date selector constructor.

Parameters:
id - the date selector identifier
tz - the timezone of the date this component represents
loc - the locale for the week data
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
(non-Javadoc).

Overrides:
getPreferredSize in class javax.swing.JComponent
See Also:
Component.getPreferredSize()

update

public void update(java.awt.Graphics g)
(non-Javadoc).

Overrides:
update in class javax.swing.JComponent
See Also:
Component.update(java.awt.Graphics)

paintComponent

public void paintComponent(java.awt.Graphics g)
(non-Javadoc).

Overrides:
paintComponent in class javax.swing.JComponent
See Also:
JComponent.paintComponent(java.awt.Graphics)

getValue

public java.lang.String getValue()
(non-Javadoc).

Specified by:
getValue in interface LyGetValueInterface
See Also:
LyGetValueInterface.getValue()

setValue

public void setValue(java.lang.String str)
(non-Javadoc).

Specified by:
setValue in interface LySetValueInterface
Parameters:
str - the new value of the Value attribute
See Also:
LySetValueInterface.setValue(java.lang.String)

getId

public java.lang.String getId()
Description copied from interface: LyGetIdInterface
Return current component identification (LyGetIdInterface interface).

Specified by:
getId in interface LyGetIdInterface

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mouseClicked in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Nothing is done on mouse release.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Nothing is done when mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseEntered(java.awt.event.MouseEvent)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Nothing is done when mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Nothing is done when mouse is dragged over a component.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)

getDayCount

public int getDayCount(java.util.Calendar calDate)
Gets the number of days in the specified month/year.

Parameters:
calDate - the calendar where its days are counted
Returns:
the number of days in the calendar

getNavigationArea

public int getNavigationArea(int x,
                             int y)
Checks if the specified (x,y) position is in the navigation area.

Parameters:
x - mouse click x coordinate
y - mouse click y coordinate
Returns:
0 for the left area, 1 for the right or -1 if there is no navigation area at the specified position

setDateFormat

public void setDateFormat(java.lang.String format)
Sets the requested date format.

Parameters:
format - new format as defined in the SimpleDateFormat class

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
This date selector doesn't handle selection events, so it has no selection transmitter.

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
null
See Also:
LyEventTransmitter.getSelectionTransmitter()

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com