Package weka.gui
Class SimpleDateFormatEditor
java.lang.Object
weka.gui.SimpleDateFormatEditor
- All Implemented Interfaces:
PropertyEditor
Class for editing SimpleDateFormat strings.
- Version:
- $Revision: 8034 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an object to the list of those that wish to be informed when the date format changes.Returns the date format string.Gets a GUI component with which the user can edit the date format.Returns the Java code that generates an object the same as the one being edited.String[]
getTags()
Some objects can return tags, but a date format cannot.getValue()
Gets the date format that is being edited.boolean
Indicates whether the object can be represented graphically.void
paintValue
(Graphics gfx, Rectangle box) Paints a graphical representation of the object.void
Removes an object from the list of those that wish to be informed when the date format changes.void
Sets the date format string.void
Sets the value of the date format to be edited.boolean
Indicates whether the date format can be edited in a GUI, which it can.
-
Field Details
-
DEFAULT_FORMAT
the default format- See Also:
-
-
Constructor Details
-
SimpleDateFormatEditor
public SimpleDateFormatEditor()Constructs a new SimpleDateFormatEditor.
-
-
Method Details
-
setValue
Sets the value of the date format to be edited.- Specified by:
setValue
in interfacePropertyEditor
- Parameters:
value
- a SimpleDateFormat object to be edited
-
getValue
Gets the date format that is being edited.- Specified by:
getValue
in interfacePropertyEditor
- Returns:
- the edited SimpleDateFormat object
-
isPaintable
public boolean isPaintable()Indicates whether the object can be represented graphically. In this case it can.- Specified by:
isPaintable
in interfacePropertyEditor
- Returns:
- true
-
paintValue
Paints a graphical representation of the object. It just prints the format.- Specified by:
paintValue
in interfacePropertyEditor
- Parameters:
gfx
- the graphics context to draw the representation tobox
- the bounds within which the representation should fit.
-
getJavaInitializationString
Returns the Java code that generates an object the same as the one being edited.- Specified by:
getJavaInitializationString
in interfacePropertyEditor
- Returns:
- the initialization string
-
getAsText
Returns the date format string.- Specified by:
getAsText
in interfacePropertyEditor
- Returns:
- the date format string
-
setAsText
Sets the date format string.- Specified by:
setAsText
in interfacePropertyEditor
- Parameters:
text
- the date format string
-
getTags
Some objects can return tags, but a date format cannot.- Specified by:
getTags
in interfacePropertyEditor
- Returns:
- null
-
getCustomEditor
Gets a GUI component with which the user can edit the date format.- Specified by:
getCustomEditor
in interfacePropertyEditor
- 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:
supportsCustomEditor
in interfacePropertyEditor
- Returns:
- true
-
addPropertyChangeListener
Adds an object to the list of those that wish to be informed when the date format changes.- Specified by:
addPropertyChangeListener
in interfacePropertyEditor
- Parameters:
listener
- a new listener to add to the list
-
removePropertyChangeListener
Removes an object from the list of those that wish to be informed when the date format changes.- Specified by:
removePropertyChangeListener
in interfacePropertyEditor
- Parameters:
listener
- the listener to remove from the list
-