com.jaxfront.swing.ui.beans
Class JCalendarPopUp

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 com.jaxfront.swing.ui.beans.JCalendarPopUp
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.AncestorListener

public class JCalendarPopUp
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.awt.event.FocusListener, javax.swing.event.AncestorListener

JCalendarPopUp add's the ability to the JCalendar to be shown like a a JPopupMenu

Version:
1.60
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.awt.Dimension fixedPopupWidth
           
 
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
JCalendarPopUp(SimpleType model)
          JCalendarPopUp constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Tracks performed actions.
 void addFocusListener(java.awt.event.FocusListener focusListener)
           
 void addKeyListener(java.awt.event.KeyListener focusListener)
           
 void ancestorAdded(javax.swing.event.AncestorEvent event)
           
 void ancestorMoved(javax.swing.event.AncestorEvent event)
           
 void ancestorRemoved(javax.swing.event.AncestorEvent event)
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 java.awt.Color getBackground()
          Returns the current set background color of the textfield.
 java.util.Calendar getCalendar()
          Returns the current calendar.
 java.lang.String getCurrentDateFromTextField()
           
 java.awt.Color getForeground()
          Returns the current foreground color of the textfield.
 java.lang.String getHelpId()
          Returns the help id.
 javax.swing.JFormattedTextField getTextField()
          Returns the current textfield.
 boolean isEditable()
          Returns true if the textfield is editable.
 boolean isEnabled()
          Returns true if the textfield is enabled.
 boolean isForceRefreshData()
          Returns true if the data should be refreshed.
 boolean isPopUpVisible()
          Returns true if the popup is visible.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Listens for propertyChange events and fires property changes.
 void release()
           
 void removeFocusListener(java.awt.event.FocusListener focusListener)
           
 void removeKeyListener(java.awt.event.KeyListener focusListener)
           
 void requestFocus()
          Requests focus for this component.
 void setBackground(java.awt.Color color)
          Sets a background color to the textfield.
 void setDate(java.util.Date date)
          Sets the current date for the calendar
 void setEditable(boolean value)
          Sets the textfield editable or ineditable.
 void setEnabled(boolean value)
          Sets the textfield enabled or unenabled.
 void setForceRefreshData(boolean newForceRefreshData)
          Sets if the data should be refreshed.
 void setForeground(java.awt.Color color)
          Sets the foreground color to the textfield.
 void setRequired(boolean aBoolean)
          Sets if this component requires user entry or not.
 void setText(java.lang.String text)
           
 void setToolTipText(java.lang.String aText)
          Sets a tool tip text to the textfield.
 
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, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
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, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, 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, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, 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

fixedPopupWidth

public static java.awt.Dimension fixedPopupWidth
Constructor Detail

JCalendarPopUp

public JCalendarPopUp(SimpleType model)
JCalendarPopUp constructor.

Method Detail

addFocusListener

public void addFocusListener(java.awt.event.FocusListener focusListener)
Overrides:
addFocusListener in class java.awt.Component

addKeyListener

public void addKeyListener(java.awt.event.KeyListener focusListener)
Overrides:
addKeyListener in class java.awt.Component

removeFocusListener

public void removeFocusListener(java.awt.event.FocusListener focusListener)
Overrides:
removeFocusListener in class java.awt.Component

removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener focusListener)
Overrides:
removeKeyListener in class java.awt.Component

ancestorAdded

public void ancestorAdded(javax.swing.event.AncestorEvent event)
Specified by:
ancestorAdded in interface javax.swing.event.AncestorListener

ancestorMoved

public void ancestorMoved(javax.swing.event.AncestorEvent event)
Specified by:
ancestorMoved in interface javax.swing.event.AncestorListener

ancestorRemoved

public void ancestorRemoved(javax.swing.event.AncestorEvent event)
Specified by:
ancestorRemoved in interface javax.swing.event.AncestorListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Tracks performed actions.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - an actionEvent that occured
See Also:
ActionListener.actionPerformed(ActionEvent)

getBackground

public java.awt.Color getBackground()
Returns the current set background color of the textfield.

Overrides:
getBackground in class java.awt.Component
Returns:
java.awt.Color the current background color
See Also:
Component.getBackground()

getCalendar

public java.util.Calendar getCalendar()
Returns the current calendar.

Returns:
Calendar the current calendar

getCurrentDateFromTextField

public java.lang.String getCurrentDateFromTextField()

getForeground

public java.awt.Color getForeground()
Returns the current foreground color of the textfield.

Overrides:
getForeground in class java.awt.Component
Returns:
java.awt.Color the current foreground color
See Also:
Component.getForeground()

getHelpId

public java.lang.String getHelpId()
Returns the help id.

Returns:
String help id

getTextField

public javax.swing.JFormattedTextField getTextField()
Returns the current textfield.

Returns:
JTextField the current textfield

isEditable

public boolean isEditable()
Returns true if the textfield is editable.

Returns:
boolean true, if the textfield is editable, false otherwise

isEnabled

public boolean isEnabled()
Returns true if the textfield is enabled.

Overrides:
isEnabled in class java.awt.Component
Returns:
true, if the textfield is enabled, false otherwise
See Also:
Component.isEnabled()

isForceRefreshData

public boolean isForceRefreshData()
Returns true if the data should be refreshed.

Returns:
boolean true, if the data should be refreshed, false otherwise

isPopUpVisible

public boolean isPopUpVisible()
Returns true if the popup is visible.

Returns:
boolean true, if the popup is visible, false otherwise

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Listens for propertyChange events and fires property changes.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(PropertyChangeEvent)

requestFocus

public void requestFocus()
Requests focus for this component.

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

release

public void release()

setBackground

public void setBackground(java.awt.Color color)
Sets a background color to the textfield.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
color - a new background color for the textfield
See Also:
Component.setBackground(Color)

setDate

public void setDate(java.util.Date date)
Sets the current date for the calendar

Parameters:
date - the current date

setEditable

public void setEditable(boolean value)
Sets the textfield editable or ineditable.

Parameters:
value - if true, the textfield becomes editable

setEnabled

public void setEnabled(boolean value)
Sets the textfield enabled or unenabled.

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
value - if true, the textfield becomes enabled
See Also:
Component.setEnabled(boolean)

setForceRefreshData

public void setForceRefreshData(boolean newForceRefreshData)
Sets if the data should be refreshed.

Parameters:
newForceRefreshData - true, if the data should be refreshed if possible

setForeground

public void setForeground(java.awt.Color color)
Sets the foreground color to the textfield.

Overrides:
setForeground in class javax.swing.JComponent
Parameters:
color - a new foreground color
See Also:
Component.setForeground(Color)

setRequired

public void setRequired(boolean aBoolean)
Sets if this component requires user entry or not.

Parameters:
aBoolean - true if this component is required

setToolTipText

public void setToolTipText(java.lang.String aText)
Sets a tool tip text to the textfield.

Overrides:
setToolTipText in class javax.swing.JComponent
Parameters:
aText - a text
See Also:
JComponent.setToolTipText(String)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

setText

public void setText(java.lang.String text)