Class JPanelEdit

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
JPanelEditAxisOrientation, JPanelEditBoolean, JPanelEditChar, JPanelEditDate, JPanelEditDefault, JPanelEditImageOrientation, JPanelEditModality, JPanelEditOrientation, JPanelEditRace, JPanelEditSetOrParam, JPanelEditSex, JPanelEditTime, JPanelEditValueType, JPanelFileSelection

public abstract class JPanelEdit extends JPanel
An abstract class for editing a single, specfic value. If the panel contains information which must be verified before assembling as a panel value, then the owner must checkFields() before requesting the panel's value.
Version:
1.0
Author:
David Parsons
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • errorComponent

      protected Component errorComponent
      when necessary To CheckFields, and there is a problem with the panel such that a valid panel value cannot be made, the particular component which has a bad value will be pointed to here.
    • errorString

      protected String errorString
      when necessary To CheckFields, and there is a problem with the panel such that a valid panel value cannot be made, the problem will be reported in this String.
    • propertyName

      protected String propertyName
      A changable property name for firing PropertyChangeEvents. A panel has but one unique property associated with it, that is the file it references, but in a situation where more than one such panel may be listened to by a PropertyChangeListener, each of these panels may be given a unique name to help the Listener. Be careful when using this feature, however, because if there is more than one listener which is interested in changes in the PropertyChangeEvent, changing the property name will cause conflicts (and likely ignored events).
  • Constructor Details

    • JPanelEdit

      public JPanelEdit()
      Builds a standard JPanel. It sets the check-fields to false
      See Also:
  • Method Details

    • checkFields

      public abstract boolean checkFields()
      Abstract method notifying the owner if the incorporated fields need to be re-entered. Fields need to be re-entered when the panel cannot make a panelValue. see errorString see errorComponent see getPanelValue
      Returns:
      DOCUMENT ME!
    • getCodedValue

      public abstract Object getCodedValue()
      abstract method returning the panel's value.

      If the information held by the panel is stored as a code (as in 'M' for "male" or 'F' for "female"), then this code will be returned by this method. If there is no code for this value, this method will return a the same value as getPanelValue()

      Returns:
      the coded value. If the panel has no coded value, then the return value will be the String returned by getPanelValue().
    • getPanelValue

      public abstract String getPanelValue()
      abstract method returning the panel's value.
      Returns:
      The value of the Panel in some understandable String format
    • getErrorComponent

      public Component getErrorComponent()
      method returns the Component (visual GUI interface) that has an error making the panel value in an attempt to allow the user the chance to correct the problem. If there is no error, this method returns null
      Returns:
      DOCUMENT ME!
    • getErrorString

      public String getErrorString()
      method returns the String describing an error making the panel value. If there is no error, this method returns null.
      Returns:
      DOCUMENT ME!
    • getPropertyName

      public String getPropertyName()
      Returns the current name used to identify PropertyChangeEvents.
      Returns:
      DOCUMENT ME!
    • setPropertyName

      public void setPropertyName(String newPropertyName) throws IllegalArgumentException
      Sets the propertyName to allow the PropertyChangeEvent to send out a unique name when PropertyChangeEvents are fired. This panel has but one unique property associated with it, that is the file it references, but in a situation where more than one such panel may be listened to by a PropertyChangeListener, each of these panels may be given a unique name to help the Listener. Be careful when using this feature, however, because if there is more than one listener which is interested in changes in the PropertyChangeEvent, changing the property name will cause conflicts (and likely ignored events).
      Parameters:
      newPropertyName - DOCUMENT ME!
      Throws:
      IllegalArgumentException - if the newPropertyName is null or is empty.