Package weka.gui
Class SimpleDateFormatEditor
- java.lang.Object
-
- weka.gui.SimpleDateFormatEditor
-
- All Implemented Interfaces:
java.beans.PropertyEditor
public class SimpleDateFormatEditor extends java.lang.Object implements java.beans.PropertyEditorClass for editing SimpleDateFormat strings.- Version:
- $Revision: 7059 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
SimpleDateFormat
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_FORMATthe default format
-
Constructor Summary
Constructors Constructor Description SimpleDateFormatEditor()Constructs a new SimpleDateFormatEditor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds an object to the list of those that wish to be informed when the date format changes.java.lang.StringgetAsText()Returns the date format string.java.awt.ComponentgetCustomEditor()Gets a GUI component with which the user can edit the date format.java.lang.StringgetJavaInitializationString()Returns the Java code that generates an object the same as the one being edited.java.lang.String[]getTags()Some objects can return tags, but a date format cannot.java.lang.ObjectgetValue()Gets the date format that is being edited.booleanisPaintable()Indicates whether the object can be represented graphically.voidpaintValue(java.awt.Graphics gfx, java.awt.Rectangle box)Paints a graphical representation of the object.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes an object from the list of those that wish to be informed when the date format changes.voidsetAsText(java.lang.String text)Sets the date format string.voidsetValue(java.lang.Object value)Sets the value of the date format to be edited.booleansupportsCustomEditor()Indicates whether the date format can be edited in a GUI, which it can.
-
-
-
Field Detail
-
DEFAULT_FORMAT
public static final java.lang.String DEFAULT_FORMAT
the default format- See Also:
- Constant Field Values
-
-
Method Detail
-
setValue
public void setValue(java.lang.Object value)
Sets the value of the date format to be edited.- Specified by:
setValuein interfacejava.beans.PropertyEditor- Parameters:
value- a SimpleDateFormat object to be edited
-
getValue
public java.lang.Object getValue()
Gets the date format that is being edited.- Specified by:
getValuein interfacejava.beans.PropertyEditor- Returns:
- the edited SimpleDateFormat object
-
isPaintable
public boolean isPaintable()
Indicates whether the object can be represented graphically. In this case it can.- Specified by:
isPaintablein interfacejava.beans.PropertyEditor- Returns:
- true
-
paintValue
public void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)Paints a graphical representation of the object. It just prints the format.- Specified by:
paintValuein interfacejava.beans.PropertyEditor- Parameters:
gfx- the graphics context to draw the representation tobox- the bounds within which the representation should fit.
-
getJavaInitializationString
public java.lang.String getJavaInitializationString()
Returns the Java code that generates an object the same as the one being edited.- Specified by:
getJavaInitializationStringin interfacejava.beans.PropertyEditor- Returns:
- the initialization string
-
getAsText
public java.lang.String getAsText()
Returns the date format string.- Specified by:
getAsTextin interfacejava.beans.PropertyEditor- Returns:
- the date format string
-
setAsText
public void setAsText(java.lang.String text)
Sets the date format string.- Specified by:
setAsTextin interfacejava.beans.PropertyEditor- Parameters:
text- the date format string
-
getTags
public java.lang.String[] getTags()
Some objects can return tags, but a date format cannot.- Specified by:
getTagsin interfacejava.beans.PropertyEditor- Returns:
- null
-
getCustomEditor
public java.awt.Component getCustomEditor()
Gets a GUI component with which the user can edit the date format.- Specified by:
getCustomEditorin interfacejava.beans.PropertyEditor- Returns:
- an editor GUI component
-
supportsCustomEditor
public boolean supportsCustomEditor()
Indicates whether the date format can be edited in a GUI, which it can.- Specified by:
supportsCustomEditorin interfacejava.beans.PropertyEditor- Returns:
- true
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds an object to the list of those that wish to be informed when the date format changes.- Specified by:
addPropertyChangeListenerin interfacejava.beans.PropertyEditor- Parameters:
listener- a new listener to add to the list
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes an object from the list of those that wish to be informed when the date format changes.- Specified by:
removePropertyChangeListenerin interfacejava.beans.PropertyEditor- Parameters:
listener- the listener to remove from the list
-
-