Package adams.gui.goe

Class GenericObjectEditorPanel

    • Field Detail

      • m_ClassType

        protected Class m_ClassType
        the super class to manage.
      • m_CanChangeClass

        protected boolean m_CanChangeClass
        whether the class can be changed.
      • m_Current

        protected transient Object m_Current
        the current object.
      • m_OkListener

        protected transient ActionListener m_OkListener
        the OK listener.
      • m_CancelListener

        protected transient ActionListener m_CancelListener
        the Cancel listener.
    • Constructor Detail

      • GenericObjectEditorPanel

        public GenericObjectEditorPanel​(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
      • GenericObjectEditorPanel

        public GenericObjectEditorPanel​(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

      • getEditor

        protected GenericObjectEditor getEditor()
        Initializes the editor if necessary and returns it.
      • invalidatedEditor

        protected void invalidatedEditor()
        Invalidates the GOE editor.
      • setClassType

        public void setClassType​(Class type)
        Sets the class of values that can be edited.
        Parameters:
        type - a value of type 'Class'
      • getClassType

        public Class getClassType()
        Returns the currently set class.
        Returns:
        the current class
      • setCanChangeClassInDialog

        public void setCanChangeClassInDialog​(boolean value)
        Sets whether the user can change the class.
        Parameters:
        value - if true then the user can change the class
      • getCanChangeClass

        public boolean getCanChangeClass()
        Returns whether the user can change the class.
        Returns:
        true if the user can change the class
      • doChoose

        protected Object doChoose()
        Performs the actual choosing of an object.
        Specified by:
        doChoose in class 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 AbstractChooserPanel
        Parameters:
        value - the string value to convert
        Returns:
        the generated object
      • toString

        protected String toString​(Object value)
        Converts the value into its string representation.
        Specified by:
        toString in class 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 AbstractChooserPanel
        Parameters:
        value - the value to use, can be null
        Returns:
        true if successfully set
      • setPostProcessObjectHandler

        public void setPostProcessObjectHandler​(GenericObjectEditor.PostProcessObjectHandler value)
        Sets the handler for post-processing objects after they have been selected but before updating the UI.
        Parameters:
        value - the handler, null to remove
      • getPostProcessObjectHandler

        public GenericObjectEditor.PostProcessObjectHandler getPostProcessObjectHandler()
        Returns the handler for post-processing objects after they have been selected but before updating the UI.
        Returns:
        the handler, null if none set
      • propertyChange

        public void propertyChange​(PropertyChangeEvent evt)
        This method gets called when a bound property is changed.
        Specified by:
        propertyChange in interface PropertyChangeListener
        Parameters:
        evt - A PropertyChangeEvent object describing the event source and the property that has changed.