com.guiseframework.platform.web
Class AbstractWebLayoutComponentDepictor<C extends LayoutComponent>

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.AbstractWebLayoutComponentDepictor<C>
Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>
Direct Known Subclasses:
AbstractWebMenuDepictor, WebCardPanelDepictor, WebFieldsetDepictor, WebLabelPanelDepictor, WebLayoutComponentDepictor, WebTabbedPanelDepictor

public abstract class AbstractWebLayoutComponentDepictor<C extends LayoutComponent>
extends AbstractWebComponentDepictor<C>

The abstract base class for all application/xhtml+xml composite components that use layouts.

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
protected static java.lang.String[] COLUMN_REGION_CLASSES
          The style classes for each region in a column.
protected static java.lang.String[] ROW_REGION_CLASSES
          The style classes for each region in a row.
 
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
AbstractWebLayoutComponentDepictor()
          Default constructor with no element representation.
AbstractWebLayoutComponentDepictor(java.net.URI namespaceURI, java.lang.String localName)
          Element namespace and local name constructor that doesn't create an empty element, even if there is no content.
AbstractWebLayoutComponentDepictor(java.net.URI namespaceURI, java.lang.String localName, boolean isEmptyElementAllowed)
          Element namespace and local name constructor.
 
Method Summary
protected  void beginRegion(RegionLayout regionLayout, RegionConstraints regionConstraints, Orientation orientation)
          Writes an XHTML style attribute for the given region, if style information is needed for that region.
protected  void beginRegion(RegionLayout regionLayout, RegionConstraints regionConstraints, Orientation orientation, boolean includeSize, boolean includeStyles)
          Writes an XHTML style attribute for the given region, if style information is needed for that region.
protected  void depictChildren()
          Updates the views of any children.
protected  java.lang.String getAlign(double alignment, Axis axis, Flow.Direction direction)
          Determines the alignment string for an alignment on a particular axis.
protected  void updateFlowChildView(Component childComponent, Axis axis)
          Updates a child view in a flow.
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, depictBegin, depictBody, depictEnd, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getOuterStyles, 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, depictedObjectPropertyChange, getDepictedCompositeComponentListener, getErrorMessage, installed, processEvent, uninstalled
 
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, installed, isDepicted, processEvent, setDepicted, uninstalled
 

Field Detail

ROW_REGION_CLASSES

protected static final java.lang.String[] ROW_REGION_CLASSES
The style classes for each region in a row.


COLUMN_REGION_CLASSES

protected static final java.lang.String[] COLUMN_REGION_CLASSES
The style classes for each region in a column.

Constructor Detail

AbstractWebLayoutComponentDepictor

public AbstractWebLayoutComponentDepictor()
Default constructor with no element representation.


AbstractWebLayoutComponentDepictor

public AbstractWebLayoutComponentDepictor(java.net.URI namespaceURI,
                                          java.lang.String localName)
Element namespace and local name constructor that doesn't create an empty element, even if there is no content.

Parameters:
namespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.
localName - The local name of the element with no prefix, or null if this component should not be rendered as an element.

AbstractWebLayoutComponentDepictor

public AbstractWebLayoutComponentDepictor(java.net.URI namespaceURI,
                                          java.lang.String localName,
                                          boolean isEmptyElementAllowed)
Element namespace and local name constructor.

Parameters:
namespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.
localName - The local name of the element with no prefix, or null if this component should not be rendered as an element.
isEmptyElementAllowed - Whether an empty element can be created if there is no content.
Method Detail

depictChildren

protected void depictChildren()
                       throws java.io.IOException
Updates the views of any children. This method does appropriate layout based upon the container's layout definition.

Overrides:
depictChildren in class AbstractComponentDepictor<C extends LayoutComponent>
Throws:
java.io.IOException - if there is an error updating child views.
java.lang.IllegalArgumentException - if the component's layout is not supported.
See Also:
LayoutComponent.getLayout()

beginRegion

protected void beginRegion(RegionLayout regionLayout,
                           RegionConstraints regionConstraints,
                           Orientation orientation)
                    throws java.io.IOException
Writes an XHTML style attribute for the given region, if style information is needed for that region. This version writes alignment and style attributes.

Parameters:
regionLayout - The region layout being rendered.
regionConstraints - The constraints for the region about to be written.
orientation - The orientation of the component for which the region is being rendered.
Throws:
java.io.IOException - if there is an error writing the attribute.

beginRegion

protected void beginRegion(RegionLayout regionLayout,
                           RegionConstraints regionConstraints,
                           Orientation orientation,
                           boolean includeSize,
                           boolean includeStyles)
                    throws java.io.IOException
Writes an XHTML style attribute for the given region, if style information is needed for that region. This version writes alignment and style attributes.

Parameters:
regionLayout - The region layout being rendered.
regionConstraints - The constraints for the region about to be written.
orientation - The orientation of the component for which the region is being rendered.
includeSize - Whether size information should be included.
includeStyles - Whether non-size-related style information should be included.
Throws:
java.io.IOException - if there is an error writing the attribute.

getAlign

protected java.lang.String getAlign(double alignment,
                                    Axis axis,
                                    Flow.Direction direction)
Determines the alignment string for an alignment on a particular axis. This implementation converts the alignment to a value by determining into which third the alignment value falls. Note that these values also work on the Axis.Y axis for the CSS XMLCSS.CSS_PROP_VERTICAL_ALIGN property.

Parameters:
alignment - The alignment value to convert.
axis - The axis of alignment.
direction - The direction of flow along the axis.
Returns:
The string alignment value, appropriate for a table cell align or valign.
See Also:
#TD_ALIGN_LEFT, #TD_ALIGN_CENTER, #TD_ALIGN_RIGHT, #TD_VALIGN_TOP, #TD_VALIGN_MIDDLE, #TD_VALIGN_BOTTOM

updateFlowChildView

protected void updateFlowChildView(Component childComponent,
                                   Axis axis)
                            throws java.io.IOException
Updates a child view in a flow. When this method is called, an enclosing element will have been started for the child.

Parameters:
childComponent - The child component the view of which is to be updated.
axis - The axis along which flow is occurring.
Throws:
java.io.IOException - if there is an error updating child views.


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