cc.gammasoft.date
Class AbstractDateModel

java.lang.Object
  |
  +--cc.gammasoft.date.AbstractDateModel
All Implemented Interfaces:
DateModel
Direct Known Subclasses:
DefaultDateModel

public abstract class AbstractDateModel
extends java.lang.Object
implements DateModel

AbstractObjectModel is used to store the selected calendar value .There is also a feature is implemented for selected values. If this the feature is enabled, this model will keep track of the selected values and will store them in a TreeSet.

Author:
levent Tinaz

Field Summary
 
Fields inherited from interface cc.gammasoft.date.DateModel
TODAY
 
Constructor Summary
AbstractDateModel()
          Constructs a new AbstractDateModel with todays date.
AbstractDateModel(java.util.Calendar calendar)
          Constructs AbstractDateModel with the parameter.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Adds the specified change listener to receive state change events from this model.
 void enableReselection(boolean value)
          Enables or disables selected calendar values should be re-selected depending on the value of parameter.
 void enableSelectionTracking(boolean value)
          Enables or disables selected calendar values should be tracked depending on the value of parameter.
 void fireValueChanged()
          Dispatches state change events for listeners
 java.util.TreeSet getSelectedValues()
          returns selected calendar values.
 java.lang.String getSQLDateValue()
          process a getSQLDateValue()
 java.lang.String getTimestampValue()
          process a getTimeStampValue()
 java.util.Calendar getValue()
          Returns model's current value
 boolean isReselectionEnabled()
          Determines whether selected calendar values should be re-selected.
 boolean isSelectionTrackingEnabled()
          Determines whether calendar values should be tracked.
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          Removes the specified change listener so that it no longer receives change listener events from this model.
 void setSelectedValues(java.util.Calendar[] values)
          sets selected values.
 boolean setSQLDate(java.lang.String SQLDate)
          process a setValue(String SQLDate)
 boolean setTimestamp(java.lang.String timeStamp)
          process a setValue(String SQLDateTime)
 boolean setValue(java.util.Calendar calendar)
          sets current value
 boolean setValue(int year, int month, int date)
          sets current value with year, month, date
 boolean setValue(java.lang.String sqlDate)
          process a setValue(String sqlDate)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDateModel

public AbstractDateModel()
Constructs a new AbstractDateModel with todays date.


AbstractDateModel

public AbstractDateModel(java.util.Calendar calendar)
Constructs AbstractDateModel with the parameter.

Method Detail

setValue

public boolean setValue(java.util.Calendar calendar)
sets current value

Specified by:
setValue in interface DateModel
Returns:
boolean if it returns false, the model's value will not be set.

setValue

public boolean setValue(int year,
                        int month,
                        int date)
sets current value with year, month, date

Specified by:
setValue in interface DateModel
Returns:
boolean if it returns false, the model's value will not be set.

setValue

public boolean setValue(java.lang.String sqlDate)
process a setValue(String sqlDate)

Specified by:
setValue in interface DateModel

setSQLDate

public boolean setSQLDate(java.lang.String SQLDate)
process a setValue(String SQLDate)

Specified by:
setSQLDate in interface DateModel

setTimestamp

public boolean setTimestamp(java.lang.String timeStamp)
process a setValue(String SQLDateTime)

Specified by:
setTimestamp in interface DateModel

getSQLDateValue

public java.lang.String getSQLDateValue()
process a getSQLDateValue()

Specified by:
getSQLDateValue in interface DateModel

getTimestampValue

public java.lang.String getTimestampValue()
process a getTimeStampValue()

Specified by:
getTimestampValue in interface DateModel

getValue

public java.util.Calendar getValue()
Returns model's current value

Specified by:
getValue in interface DateModel
Returns:
Calendar calendar.

enableSelectionTracking

public void enableSelectionTracking(boolean value)
Enables or disables selected calendar values should be tracked depending on the value of parameter.

Specified by:
enableSelectionTracking in interface DateModel

isSelectionTrackingEnabled

public boolean isSelectionTrackingEnabled()
Determines whether calendar values should be tracked.

Specified by:
isSelectionTrackingEnabled in interface DateModel
Returns:
boolean. If the return value is true, this feature has been enabled.

enableReselection

public void enableReselection(boolean value)
Enables or disables selected calendar values should be re-selected depending on the value of parameter.

Specified by:
enableReselection in interface DateModel

isReselectionEnabled

public boolean isReselectionEnabled()
Determines whether selected calendar values should be re-selected.

Specified by:
isReselectionEnabled in interface DateModel
Returns:
boolean. If the return value is true, this feature has been enabled.

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds the specified change listener to receive state change events from this model.

Specified by:
addChangeListener in interface DateModel

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes the specified change listener so that it no longer receives change listener events from this model.

Specified by:
removeChangeListener in interface DateModel
Parameters:
listener - the change listener.

getSelectedValues

public java.util.TreeSet getSelectedValues()
returns selected calendar values.

Specified by:
getSelectedValues in interface DateModel
Returns:
TreeSet

setSelectedValues

public void setSelectedValues(java.util.Calendar[] values)
sets selected values.

Specified by:
setSelectedValues in interface DateModel

fireValueChanged

public void fireValueChanged()
Dispatches state change events for listeners

Specified by:
fireValueChanged in interface DateModel


Gammasoft Inc All Rights Reserved.