Class WebImageDepictor<C extends ImageComponent>
- java.lang.Object
-
- io.guise.framework.platform.AbstractDepictor<C>
-
- io.guise.framework.platform.AbstractComponentDepictor<C>
-
- io.guise.framework.platform.web.AbstractWebComponentDepictor<C>
-
- io.guise.framework.platform.web.AbstractSimpleWebComponentDepictor<C>
-
- io.guise.framework.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. TheLabelModel.getLabel()
orInfoModel.getDescription()
will be used as the "alt" attribute if available.This depictor supports
PendingImageComponent
.- Author:
- Garret Wilson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
-
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
-
-
Field Summary
-
Fields inherited from class io.guise.framework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
-
Fields inherited from class io.guise.framework.platform.AbstractComponentDepictor
childPropertyChangeListener
-
Fields inherited from interface io.guise.framework.platform.Depictor
GENERAL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description WebImageDepictor()
Default constructor using the XHTML<label>
element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
depictBody()
Depicts 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 io.guise.framework.platform.web.AbstractSimpleWebComponentDepictor
depictBegin, getOuterStyles
-
Methods inherited from class io.guise.framework.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 io.guise.framework.platform.AbstractComponentDepictor
depictChild, depictChildren, getDepictedCompositeComponentListener, getErrorMessage, processEvent
-
Methods inherited from class io.guise.framework.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 io.guise.framework.platform.Depictor
getDepictedObject, getSession, isDepicted, processEvent, setDepicted
-
-
-
-
Method Detail
-
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 interfaceDepictor<C extends ImageComponent>
- Overrides:
installed
in classAbstractComponentDepictor<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 interfaceDepictor<C extends ImageComponent>
- Overrides:
uninstalled
in classAbstractComponentDepictor<C extends ImageComponent>
- Parameters:
component
- The depicted object from which this depictor is being uninstalled.- 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 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 classAbstractComponentDepictor<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 version returns the style for background color.
This adds layout fixes for images within tables.
- Overrides:
getBodyStyles
in classAbstractWebComponentDepictor<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 aPendingImageComponent
with a pending image, this version return thePendingImageComponent.getPendingImageURI()
value. Otherwise, this version returns the delegate image'sImageModel.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
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 classAbstractWebComponentDepictor<C extends ImageComponent>
- Throws:
java.io.IOException
- if there is an error updating the depiction.- See Also:
AbstractComponentDepictor.depictChildren()
-
-