Package adams.gui.goe

Class WekaGenericArrayEditorPanel

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

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

      • m_Default

        protected Object m_Default
        the default value.
      • m_Current

        protected Object m_Current
        the current value.
      • m_MaxDisplayItems

        protected int m_MaxDisplayItems
        the maximum number of array items to display via toString().
    • Constructor Detail

      • WekaGenericArrayEditorPanel

        public WekaGenericArrayEditorPanel​(Object defValue)
        Initializes the panel with the given class and default value. Cannot change the class.
        Parameters:
        defValue - the default value
    • Method Detail

      • initialize

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

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI 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
      • hasValue

        public boolean hasValue()
        Checks whether the value of text field is different from the default value, i.e., a proper value.
        Overrides:
        hasValue in class adams.gui.chooser.AbstractChooserPanel
        Returns:
        true if a proper value is available
      • updateDisplay

        protected void updateDisplay()
        Updates the display.
      • 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 (in that case, m_Default is used)
        Returns:
        true if successfully set
      • getCurrent

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

        protected Object fromString​(String value)
        Not used.
        Specified by:
        fromString in class adams.gui.chooser.AbstractChooserPanel
        Parameters:
        value - the string value to convert
        Returns:
        always null
      • toString

        protected String toString​(Object value)
        Not used.
        Specified by:
        toString in class adams.gui.chooser.AbstractChooserPanel
        Parameters:
        value - the value to convert
        Returns:
        always null
      • 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
      • setMaxDisplayItems

        public void setMaxDisplayItems​(int value)
        Sets the maximum number of array items to display via toString().
        Parameters:
        value - the maximum number
      • getMaxDisplayItems

        public int getMaxDisplayItems()
        Returns the maximum number of array items to disaply via toString().
        Returns:
        the maximum number