org.das2.components
Class DatumEditor

java.lang.Object
  extended by org.das2.components.DatumEditor
All Implemented Interfaces:
java.beans.PropertyEditor, javax.swing.CellEditor, javax.swing.table.TableCellEditor

public class DatumEditor
extends java.lang.Object
implements java.beans.PropertyEditor, javax.swing.table.TableCellEditor


Constructor Summary
DatumEditor()
          Creates a new instance of DatumEditor
 
Method Summary
 void addActionListener(java.awt.event.ActionListener al)
           
 void addCellEditorListener(javax.swing.event.CellEditorListener l)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void cancelCellEditing()
           
 java.lang.String getAsText()
           
 java.lang.Object getCellEditorValue()
          Returns the value stored in this editor.
 java.awt.Component getCustomEditor()
           
 Datum getDatum()
           
 java.lang.String getJavaInitializationString()
          This PropertyEditor implementation does not support generating java code.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
           
 java.lang.String[] getTags()
          This PropertyEditor implementation does not support enumerated values.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           
 Units getUnits()
           
 java.lang.Object getValue()
           
 boolean isCellEditable(java.util.EventObject anEvent)
           
 boolean isPaintable()
           
 void paintValue(java.awt.Graphics g, java.awt.Rectangle r)
          Does nothing.
 void removeActionListener(java.awt.event.ActionListener al)
           
 void removeCellEditorListener(javax.swing.event.CellEditorListener l)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void setAsText(java.lang.String text)
           
 void setColumns(int columns)
           
 void setUnits(Units units)
           
 void setValue(java.lang.Object value)
           
 boolean shouldSelectCell(java.util.EventObject anEvent)
           
 boolean stopCellEditing()
           
 boolean supportsCustomEditor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatumEditor

public DatumEditor()
Creates a new instance of DatumEditor

Method Detail

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface java.beans.PropertyEditor

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface java.beans.PropertyEditor

setColumns

public void setColumns(int columns)

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface java.beans.PropertyEditor
Parameters:
value - the Datum object to be editted.
Throws:
java.lang.IllegalArgumentException - if value is not a Datum

setAsText

public void setAsText(java.lang.String text)
               throws java.lang.IllegalArgumentException
Specified by:
setAsText in interface java.beans.PropertyEditor
Throws:
java.lang.IllegalArgumentException

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface java.beans.PropertyEditor

getDatum

public Datum getDatum()

getAsText

public java.lang.String getAsText()
Specified by:
getAsText in interface java.beans.PropertyEditor

setUnits

public void setUnits(Units units)

getUnits

public Units getUnits()

addActionListener

public void addActionListener(java.awt.event.ActionListener al)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener al)

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)

supportsCustomEditor

public boolean supportsCustomEditor()
Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Returns:
true
See Also:
PropertyEditor.supportsCustomEditor()

getCustomEditor

public java.awt.Component getCustomEditor()
Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Returns:
this
See Also:
PropertyEditor.getCustomEditor()

getJavaInitializationString

public java.lang.String getJavaInitializationString()
This PropertyEditor implementation does not support generating java code.

Specified by:
getJavaInitializationString in interface java.beans.PropertyEditor
Returns:
The string "???"

getTags

public java.lang.String[] getTags()
This PropertyEditor implementation does not support enumerated values.

Specified by:
getTags in interface java.beans.PropertyEditor
Returns:
null

isPaintable

public boolean isPaintable()
Specified by:
isPaintable in interface java.beans.PropertyEditor
Returns:
false
See Also:
PropertyEditor.isPaintable()

paintValue

public void paintValue(java.awt.Graphics g,
                       java.awt.Rectangle r)
Does nothing.

Specified by:
paintValue in interface java.beans.PropertyEditor
Parameters:
g -
r -

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

addCellEditorListener

public void addCellEditorListener(javax.swing.event.CellEditorListener l)
Specified by:
addCellEditorListener in interface javax.swing.CellEditor

removeCellEditorListener

public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Specified by:
removeCellEditorListener in interface javax.swing.CellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Specified by:
isCellEditable in interface javax.swing.CellEditor
Returns:
true
See Also:
CellEditor.isCellEditable(java.util.EventObject)

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject anEvent)
Specified by:
shouldSelectCell in interface javax.swing.CellEditor
Returns:
true
See Also:
CellEditor.shouldSelectCell(java.util.EventObject)

getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the value stored in this editor.

Specified by:
getCellEditorValue in interface javax.swing.CellEditor
Returns:
the current value being edited

stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface javax.swing.CellEditor

cancelCellEditing

public void cancelCellEditing()
Specified by:
cancelCellEditing in interface javax.swing.CellEditor