Class WebImageDepictor<C extends ImageComponent>

Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

public class WebImageDepictor<C extends ImageComponent> extends AbstractSimpleWebComponentDepictor<C>
Strategy for rendering an image component an XHTML <img> element. The LabelModel.getLabel() or InfoModel.getDescription() will be used as the "alt" attribute if available.

This depictor supports PendingImageComponent.

Author:
Garret Wilson
  • Constructor Details

    • WebImageDepictor

      public WebImageDepictor()
      Default constructor using the XHTML <label> element.
  • Method Details

    • installed

      public void installed(C component)
      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.

      If the component is a container, this version listens for container events and marks the view as needing updated.

      This version requests a poll interval if the image is pending.

      Specified by:
      installed in interface Depictor<C extends ImageComponent>
      Overrides:
      installed in class AbstractComponentDepictor<C extends ImageComponent>
      Parameters:
      component - The depictedObject into which this depictor is being installed.
      See Also:
      • AbstractDepictor.depictedPropertyChangeListener
    • uninstalled

      public void uninstalled(C component)
      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.

      If the component is a container, this version stops listening for container events.

      This version requests any poll interval.

      Specified by:
      uninstalled in interface Depictor<C extends ImageComponent>
      Overrides:
      uninstalled in class AbstractComponentDepictor<C extends ImageComponent>
      Parameters:
      component - The depicted object from which this depictor is being uninstalled.
      See Also:
      • AbstractDepictor.depictedPropertyChangeListener
    • depictedObjectPropertyChange

      protected void depictedObjectPropertyChange(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.

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

      This implementation requests or discontinues a poll interval when the pending state changes.

      Overrides:
      depictedObjectPropertyChange in class AbstractComponentDepictor<C extends ImageComponent>
      Parameters:
      propertyChangeEvent - An event object describing the event source and the property that has changed.
      See Also:
    • getBodyStyles

      protected Map<String,Object> getBodyStyles()
      Retrieves the styles for the body element of the component.

      This version returns the style for background color.

      This adds layout fixes for images within tables.

      Overrides:
      getBodyStyles in class AbstractWebComponentDepictor<C extends ImageComponent>
      Returns:
      The styles for the body element of the component, mapped to CSS property names.
    • getImageURI

      protected URI getImageURI()
      Determines the image URI to use for this component. If the delegate image is a PendingImageComponent with a pending image, this version return the PendingImageComponent.getPendingImageURI() value. Otherwise, this version returns the delegate image's ImageModel.getImageURI() value.
      Returns:
      The image to use for the component, or null if there should not be an image.
    • depictBody

      protected void depictBody() throws IOException
      Description copied from class: AbstractWebComponentDepictor
      Depicts the body of the component.

      This version depicts the children of the component.

      This version increases and decreases the indention level before and after depicting the children, respectively.

      Overrides:
      depictBody in class AbstractWebComponentDepictor<C extends ImageComponent>
      Throws:
      IOException - if there is an error updating the depiction.
      See Also: