Package adams.gui.goe

Class WekaGenericObjectEditorPanel

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, ImageObserver, MenuContainer, Serializable, Accessible

    public class WekaGenericObjectEditorPanel
    extends adams.gui.chooser.AbstractChooserPanel
    A panel that contains text field with the current setup of the object and a button for bringing up the GenericObjectEditor.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Editor

        protected weka.gui.GenericObjectEditor m_Editor
        the generic object editor.
      • m_History

        protected adams.gui.goe.PersistentObjectHistory m_History
        the history of used setups.
      • m_Current

        protected transient Object m_Current
        the current object.
    • Constructor Detail

      • WekaGenericObjectEditorPanel

        public WekaGenericObjectEditorPanel​(Class cls,
                                            Object defValue)
        Initializes the panel with the given class and default value. Cannot change the class.
        Parameters:
        cls - the class to handler
        defValue - the default value
      • WekaGenericObjectEditorPanel

        public WekaGenericObjectEditorPanel​(Class cls,
                                            Object defValue,
                                            boolean canChangeClassInDialog)
        Initializes the panel with the given class and default value. Cannot change the class.
        Parameters:
        cls - the class to handler
        defValue - the default value
        canChangeClassInDialog - whether the user can change the class
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.gui.chooser.AbstractChooserPanel
      • doChoose

        protected Object doChoose()
        Performs the actual choosing of an object.
        Specified by:
        doChoose in class adams.gui.chooser.AbstractChooserPanel
        Returns:
        the chosen object or null if none chosen
      • fromString

        protected Object fromString​(String value)
        Converts the string representation into its object representation.
        Specified by:
        fromString in class adams.gui.chooser.AbstractChooserPanel
        Parameters:
        value - the string value to convert
        Returns:
        the generated object
      • getCurrent

        public Object getCurrent()
        Returns the current value.
        Overrides:
        getCurrent in class adams.gui.chooser.AbstractChooserPanel
        Returns:
        the current value
      • toString

        protected String toString​(Object value)
        Converts the value into its string representation.
        Specified by:
        toString in class adams.gui.chooser.AbstractChooserPanel
        Parameters:
        value - the value to convert
        Returns:
        the generated string
      • setCurrent

        public boolean setCurrent​(Object value)
        Sets the current value.
        Overrides:
        setCurrent in class adams.gui.chooser.AbstractChooserPanel
        Parameters:
        value - the value to use, can be null
        Returns:
        true if successfully set
      • getPopupMenu

        protected adams.gui.core.BasePopupMenu getPopupMenu()
        Generates the right-click popup menu.
        Overrides:
        getPopupMenu in class adams.gui.chooser.AbstractChooserPanel
        Returns:
        the generated menu