Interface Depictor<O extends DepictedObject>

    • Field Detail

      • GENERAL_PROPERTY

        static final java.lang.String GENERAL_PROPERTY
        The property indicating general depicted object changes.
        See Also:
        Constant Field Values
    • Method Detail

      • getSession

        GuiseSession getSession()
        Returns:
        The Guise session that owns this object.
      • getPlatform

        Platform getPlatform()
        Returns:
        The platform on which this depictor is depicting objects.
      • getDepictContext

        DepictContext getDepictContext()
        Retrieves information and functionality related to the current depiction on the platform. This method delegates to Platform.getDepictContext().
        Returns:
        A context for the current depiction.
        Throws:
        java.lang.IllegalStateException - if no depict context can be returned in the current depiction state.
      • getDepictedObject

        O getDepictedObject()
        Returns:
        The object being depicted, or null if this depictor is not installed in a depicted object.
      • isDepicted

        boolean isDepicted()
        Returns:
        Whether this depictor's representation of the depicted object is up to date.
      • setDepicted

        void setDepicted​(boolean newDepicted)
        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 GENERAL_PROPERTY property is set as modified.
        Parameters:
        newDepicted - Whether this depictor's representation of the depicted object is up to date.
      • installed

        void installed​(O depictedObject)
        Called when the depictor is installed in a depicted object.
        Parameters:
        depictedObject - The depictedObject into which this depictor is being installed.
        Throws:
        java.lang.NullPointerException - if the given depicted object is null.
        java.lang.IllegalStateException - if this depictor is already installed in a depicted object.
      • uninstalled

        void uninstalled​(O depictedObject)
        Called when the depictor is uninstalled from a depicted object.
        Parameters:
        depictedObject - The depicted object from which this depictor is being uninstalled.
        Throws:
        java.lang.NullPointerException - if the given depicted object is null.
        java.lang.IllegalStateException - if this depictor is not installed in a depicted object.
      • processEvent

        void processEvent​(PlatformEvent event)
        Processes an event from the platform.
        Parameters:
        event - The event to be processed.
        Throws:
        java.lang.IllegalArgumentException - if the given event is a relevant DepictEvent with a source of a different depicted object.
      • depict

        void depict()
             throws java.io.IOException
        Updates the depiction of the object. The depiction will be marked as updated.
        Throws:
        java.io.IOException - if there is an error updating the depiction.