com.guiseframework.platform.web
Class WebImageDepictor<C extends ImageComponent>

java.lang.Object
  extended by com.guiseframework.platform.AbstractDepictor<C>
      extended by com.guiseframework.platform.AbstractComponentDepictor<C>
          extended by com.guiseframework.platform.web.AbstractWebComponentDepictor<C>
              extended by com.guiseframework.platform.web.AbstractSimpleWebComponentDepictor<C>
                  extended by com.guiseframework.platform.web.WebImageDepictor<C>
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. This depictor supports PendingImageComponent.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
 
Field Summary
 
Fields inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
 
Fields inherited from class com.guiseframework.platform.AbstractComponentDepictor
childPropertyChangeListener
 
Fields inherited from interface com.guiseframework.platform.Depictor
GENERAL_PROPERTY
 
Constructor Summary
WebImageDepictor()
          Default constructor using the XHTML <label> element.
 
Method Summary
protected  void depictBody()
          Renders the body of the component.
protected  void depictedObjectPropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
          Called when a depicted object bound property is changed.
protected  java.util.Map<java.lang.String,java.lang.Object> getBodyStyles()
          Retrieves the styles for the body element of the component.
protected  java.net.URI getImageURI()
          Determines the image URI to use for this component.
 void installed(C component)
          Called when the depictor is installed in a depicted object.
 void uninstalled(C component)
          Called when the depictor is uninstalled from a depicted object.
 
Methods inherited from class com.guiseframework.platform.web.AbstractSimpleWebComponentDepictor
depictBegin, getOuterStyles
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, depictEnd, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getPlatform, hasLabelContent, hasLabelContent, hasLabelContent, hasLabelContent, isEmptyElementAllowed, isMouseListener, writeBodyIDClassAttributes, writeClassAttribute, writeDirectionAttribute, writeDirectionAttribute, writeErrorMessage, writeFloatClear, writeIDAttribute, writeIDClassAttributes, writeLabel, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeParameterInputs, writeStyleAttribute, writeText
 
Methods inherited from class com.guiseframework.platform.AbstractComponentDepictor
depictChild, depictChildren, getDepictedCompositeComponentListener, getErrorMessage, processEvent
 
Methods inherited from class com.guiseframework.platform.AbstractDepictor
getDepictedObject, getDepictedPropertyChangeListener, getIgnoredProperties, getModifiedProperties, getSession, isDepicted, setDepicted, setPropertyModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.platform.Depictor
getDepictedObject, getSession, isDepicted, processEvent, setDepicted
 

Constructor Detail

WebImageDepictor

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

Method Detail

installed

public void installed(C component)
Called when the depictor is installed in a depicted object. 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 component 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.
See Also:
AbstractDepictor.depictedPropertyChangeListener

uninstalled

public void uninstalled(C component)
Called when the depictor is uninstalled from a depicted object. 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 component 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.
See Also:
AbstractDepictor.depictedPropertyChangeListener

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 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:
PendingImageModel.isImagePending()

getBodyStyles

protected java.util.Map<java.lang.String,java.lang.Object> getBodyStyles()
Retrieves the styles for the body element of the component. 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 java.net.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 java.io.IOException
Renders the body of the component.

Overrides:
depictBody in class AbstractWebComponentDepictor<C extends ImageComponent>
Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
AbstractComponentDepictor.depictChildren()


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.