Class AbstractWebLayoutComponentDepictor<C extends LayoutComponent>

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
  • Field Details

    • ROW_REGION_CLASSES

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

      protected static final String[] COLUMN_REGION_CLASSES
      The style classes for each region in a column.
  • Constructor Details

    • AbstractWebLayoutComponentDepictor

      public AbstractWebLayoutComponentDepictor()
      Default constructor with no element representation.
    • AbstractWebLayoutComponentDepictor

      public AbstractWebLayoutComponentDepictor(URI namespaceURI, 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(URI namespaceURI, 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 Details

    • depictChildren

      protected void depictChildren() throws IOException
      Depicts any child components.

      This method does appropriate layout based upon the container's layout definition.

      Overrides:
      depictChildren in class AbstractComponentDepictor<C extends LayoutComponent>
      Throws:
      IOException - if there is an error updating the child depictions.
      See Also:
    • beginRegion

      protected void beginRegion(RegionLayout regionLayout, RegionConstraints regionConstraints, Orientation orientation) throws 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:
      IOException - if there is an error writing the attribute.
    • beginRegion

      protected void beginRegion(RegionLayout regionLayout, RegionConstraints regionConstraints, Orientation orientation, boolean includeSize, boolean includeStyles) throws 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:
      IOException - if there is an error writing the attribute.
    • getAlign

      protected 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 CSS.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:
      • HTML.TD_ALIGN_LEFT
      • HTML.TD_ALIGN_CENTER
      • HTML.TD_ALIGN_RIGHT
      • HTML.TD_VALIGN_TOP
      • HTML.TD_VALIGN_MIDDLE
      • HTML.TD_VALIGN_BOTTOM
    • updateFlowChildView

      protected void updateFlowChildView(Component childComponent, Axis axis) throws 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:
      IOException - if there is an error updating child views.