Class AbstractDepictor<O extends DepictedObject>

    • Constructor Detail

      • AbstractDepictor

        public AbstractDepictor()
        Default constructor.
    • Method Detail

      • getIgnoredProperties

        protected java.util.Set<java.lang.String> getIgnoredProperties()
        Returns:
        The depicted object properties that are to be ignored.
      • getModifiedProperties

        protected java.util.Set<java.lang.String> getModifiedProperties()
        Returns:
        The depicted object properties that have been modified.
      • setPropertyModified

        protected void setPropertyModified​(java.lang.String property,
                                           boolean modified)
        Calls when a property has been modified to sets whether a property has been modified. If the property's modified status is set to true, the depictor's isDepicted() status is changed to false. If the property's modified status is set to false and there are no other modified properties, the depictor's isDepicted() status is set to true.
        Parameters:
        property - The property that has been modified.
        modified - Whether the property has been modified.
        See Also:
        setDepicted(boolean)
      • getDepictedObject

        public O getDepictedObject()
        Specified by:
        getDepictedObject in interface Depictor<O extends DepictedObject>
        Returns:
        The object being depicted, or null if this depictor is not installed in a depicted object.
      • isDepicted

        public boolean isDepicted()
        Specified by:
        isDepicted in interface Depictor<O extends DepictedObject>
        Returns:
        Whether this depictor's representation of the depicted object is up to date.
      • setDepicted

        public void setDepicted​(boolean newDepicted)
        Description copied from interface: Depictor
        Changes the depictor's updated status. If the new depicted status is true, all modified properties are removed. If the new depicted status is false, the Depictor.GENERAL_PROPERTY property is set as modified.
        Specified by:
        setDepicted in interface Depictor<O extends DepictedObject>
        Parameters:
        newDepicted - Whether this depictor's representation of the depicted object is up to date.
      • installed

        public void installed​(O depictedObject)
        Called when the depictor is installed in a depicted object.

        This version listens for property changes of a PropertyBindable object.

        This version listens for list changes of a ListListenable object.

        Specified by:
        installed in interface Depictor<O extends DepictedObject>
        Parameters:
        depictedObject - The depictedObject into which this depictor is being installed.
        See Also:
        depictedPropertyChangeListener
      • uninstalled

        public void uninstalled​(O depictedObject)
        Called when the depictor is uninstalled from a depicted object.

        This version stop listening for property changes of a PropertyBindable object.

        This version stops listening for list changes of a ListListenable object.

        Specified by:
        uninstalled in interface Depictor<O extends DepictedObject>
        Parameters:
        depictedObject - The depicted object from which this depictor is being uninstalled.
        See Also:
        depictedPropertyChangeListener
      • depict

        public void depict()
                    throws java.io.IOException
        Updates the depiction of the object. The depiction will be marked as updated.

        This implementation marks the depiction as depicted.

        Specified by:
        depict in interface Depictor<O extends DepictedObject>
        Throws:
        java.io.IOException - if there is an error updating the depiction.
      • depictedObjectPropertyChange

        protected void depictedObjectPropertyChange​(java.beans.PropertyChangeEvent propertyChangeEvent)
        Called when a depicted object bound property is changed.

        This method may also be called for objects related to the depicted object, so if specific properties are checked the event source should be verified to be the depicted object.

        This implementation marks the property as being modified if the property is not an ignored property.

        Parameters:
        propertyChangeEvent - An event object describing the event source and the property that has changed.
        See Also:
        getIgnoredProperties(), setPropertyModified(String, boolean)