pt.moredata.widgets
Class Calendar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bypt.moredata.widgets.Calendar
All Implemented Interfaces:
java.awt.event.ActionListener, DaySelectionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.io.Serializable

public class Calendar
extends javax.swing.JComponent
implements java.awt.event.ActionListener, java.awt.event.ItemListener, DaySelectionListener

Title: DataCalendar

Description: Bean para o tratamento de datas

Copyright:

     Copyright (C) 2002 Moredata This program is free
  software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation;
  either version 2 of the License, or (at your option) any later version. This
  program is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  details. You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, Inc,
  59 Temple Place-Suite 330, Boston, MA 02111-1307, USA. 

Company : Moredata

Version:
1.0
Author:
Sergio Ferreira
See Also:
Serialized Form

Nested Class Summary
 
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
static int ACCEPT_OPTION
          Description of the Field
static int CANCEL_OPTION
          Description of the Field
static int ERROR_OPTION
          Description of the Field
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Calendar()
          Construtor do calendário
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Used to process events from the previous month, previous year, next month, next year, okay and cancel buttons.
 void addActionListener(java.awt.event.ActionListener l)
          adds an ActionListener to the button
 void daySelected(int d)
          Used to process day selection events from the user.
protected  void fireActionPerformed(java.awt.event.ActionEvent event)
          Description of the Method
 java.util.Calendar getMaxValue()
          Retorna a Data Máxima que pode ser inserida no calendário
 java.util.Calendar getMinValue()
          Retorna a Data Minima que pode ser inserida no calendário
 java.lang.Object getObject()
          Devolve o valor relativo a data corrente Deveria ter em atencao a formatacao para poder tambem trabalhar com dateTime
 java.util.Calendar getSelectedDate()
          Devolve a data que se encontra seleccionada no calendário
 void itemStateChanged(java.awt.event.ItemEvent e)
          ItemListener método
 void removeActionListener(java.awt.event.ActionListener l)
          removes an ActionListener from the button
 void setMaxValue(int dia, int mes, int ano)
          Afectação do maximo que poderá ser apresentado pelo calendário
 void setMinValue(int dia, int mes, int ano)
          Afectação do minimo que poderá ser apresentado pelo calendário
 void setObject(int dia, int mes, int ano)
          Afectação da data que irá ser apresentada no calendário
 void setObject(java.lang.Object obj)
          Afectação da data que irá ser apresentada no calendário
 void Valida_Dia(java.lang.String dia_Seleccionado)
          Valida Dia seleccionado na caixa relativa ao Dia
 
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, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, 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, updateUI
 
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, 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, imageUpdate, 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

ERROR_OPTION

public static final int ERROR_OPTION
Description of the Field

See Also:
Constant Field Values

ACCEPT_OPTION

public static final int ACCEPT_OPTION
Description of the Field

See Also:
Constant Field Values

CANCEL_OPTION

public static final int CANCEL_OPTION
Description of the Field

See Also:
Constant Field Values
Constructor Detail

Calendar

public Calendar()
Construtor do calendário

Method Detail

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
ItemListener método

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - Description of the Parameter

Valida_Dia

public void Valida_Dia(java.lang.String dia_Seleccionado)
Valida Dia seleccionado na caixa relativa ao Dia

Parameters:
dia_Seleccionado - Description of the Parameter

getSelectedDate

public java.util.Calendar getSelectedDate()
Devolve a data que se encontra seleccionada no calendário


getObject

public java.lang.Object getObject()
Devolve o valor relativo a data corrente Deveria ter em atencao a formatacao para poder tambem trabalhar com dateTime

Returns:
date Data que se encontra seleccionada

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Used to process events from the previous month, previous year, next month, next year, okay and cancel buttons. Users should call super.actionPerformed(ActionEvent) if overriding this method.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Description of the Parameter

daySelected

public void daySelected(int d)
Used to process day selection events from the user. This method resets resets the Calendar object to the selected day. Subclasses should make a call to super.daySelected() if overriding this method.

Specified by:
daySelected in interface DaySelectionListener
Parameters:
d - Description of the Parameter

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
adds an ActionListener to the button

Parameters:
l - The feature to be added to the ActionListener attribute

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
removes an ActionListener from the button

Parameters:
l - Description of the Parameter

fireActionPerformed

protected void fireActionPerformed(java.awt.event.ActionEvent event)
Description of the Method

Parameters:
event - Description of the Parameter

setObject

public void setObject(int dia,
                      int mes,
                      int ano)
Afectação da data que irá ser apresentada no calendário

Parameters:
dia - Dia da data minima
mes - Mes da data minima
ano - da data minima

setObject

public void setObject(java.lang.Object obj)
Afectação da data que irá ser apresentada no calendário

Parameters:
obj - Objecto do tipo Date.

setMaxValue

public void setMaxValue(int dia,
                        int mes,
                        int ano)
Afectação do maximo que poderá ser apresentado pelo calendário

Parameters:
dia - Dia da data maxima
mes - Mes da data maxima
ano - da data maxima

setMinValue

public void setMinValue(int dia,
                        int mes,
                        int ano)
Afectação do minimo que poderá ser apresentado pelo calendário

Parameters:
dia - Dia da data minima
mes - Mes da data minima
ano - da data minima

getMaxValue

public java.util.Calendar getMaxValue()
Retorna a Data Máxima que pode ser inserida no calendário

Returns:
date Data Máxima que pode ser inserida no calendário

getMinValue

public java.util.Calendar getMinValue()
Retorna a Data Minima que pode ser inserida no calendário

Returns:
date Data Minima que pode ser inserida no calendário