de.vc.jfo.flow

## Class ExternalGraphic

- java.lang.Object
- - de.vc.xml.AbstractNode
  - - de.vc.xml.AbstractNodeWithAttributes
    - - de.vc.jfo.FormattingObject
      - - de.vc.jfo.flow.FlowObject
        - - de.vc.jfo.flow.ExternalGraphic

- All Implemented Interfaces:
    InlineElement, Node, NodeElement, java.io.Serializable, java.lang.Cloneable

      public class ExternalGraphic
      extends FlowObject
      implements InlineElement

  The fo:external-graphic flow object is used for a graphic where the graphics data resides outside of the fo:element tree.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class de.vc.jfo.FormattingObject

      `EMPTY_ARRAY`

    - ### Fields inherited from class de.vc.xml.AbstractNodeWithAttributes

      `MAP_TYPE_FLYWEIGHT, MAP_TYPE_HASH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExternalGraphic()`
    `ExternalGraphic(java.lang.String src)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addUnsafe(java.lang.Object child)` Adds a NodeElement to this FormattingObject.
    `Accessibility` | `getAccessibility()` Gets the accessibilty of this fo.
    `Background` | `getBackground()` Gets the background of this fo.
    `Border` | `getBorder()` Gets the border of this fo.
    `Measure` | `getContentHeight()` Gets the height of graphic content, is NULL, if not defined.
    `Measure` | `getContentWidth()` Gets the width of graphic content, is NULL, if not defined.
    `Values.DisplayAlignment` | `getDisplayAlign()` Gets the display-alignment.
    `java.util.List` | `getElements()` Gets childreen of this node.
    `Measure` | `getHeight()` Gets the height of this graphic container, is NULL, if not defined.
    `Margin` | `getMargin()` Gets the margin of this fo.
    `Padding` | `getPadding()` Gets the padding of this fo.
    `RelativePosition` | `getRelativePosition()` Gets the relative position of this fo.
    `Values.Scaling` | `getScaling()` Gets the scaling typ of this graphic.
    `java.lang.String` | `getSource()` Gets the source URL of this external graphic.
    `Values.Alignment` | `getTextAlignment()` Gets the alignment of text.
    `Measure` | `getWidth()` Gets the width of this graphic container, is NULL, if not defined.
    `boolean` | `hasBorder()` Returns true if at least one border attribute is set.
    `void` | `setAccessibility(Accessibility access)` Sets the accessibility of this fo.
    `void` | `setBackground(Background bg)` Sets the background of this fo.
    `void` | `setBorder(Border border)` Sets the border of this fo.
    `void` | `setContentHeight(Measure height)` Sets the height of graphic content.
    `void` | `setContentSize(Measure width, Measure height)` Sets width and height of graphic content.
    `void` | `setContentWidth(Measure width)` Sets the width of graphic content.
    `void` | `setDisplayAlign(Values.DisplayAlignment align)` Sets the display-alignment.
    `void` | `setHeight(Measure height)` Sets the height of this graphic container.
    `void` | `setMargin(Margin margin)` Sets the margin of this fo.
    `void` | `setPadding(Padding padding)` Sets the padding of this fo.
    `void` | `setRelativePosition(RelativePosition pos)` Sets the relative position of this fo.
    `void` | `setScaling(Values.Scaling scaling)` Sets the scaling type of this graphic.
    `void` | `setSize(Measure width, Measure height)` Sets width and height of this graphic container.
    `void` | `setSource(java.lang.String source)` Sets the source of this external graphic.
    `void` | `setSourceAsBase64Data(byte[] image, java.lang.String mediaType)` Sets the source as instream data using the URL-data scheme (RFC 2397).
    `void` | `setSourceAsUrl(java.lang.String url)` Set the source URL of this graphic.
    `void` | `setTextAlignment(Values.Alignment alignment)` Sets the alignment of text.
    `void` | `setWidth(Measure width)` Sets the width of this graphic container.

    - ### Methods inherited from class de.vc.jfo.FormattingObject

      `addElement, addElement, addUnsafe, clone, cloned, clonedList, createUniqueID, doGetAttribute, doSetAttribute, elementCount, get, getAbsolutePosition, getAttributeMap, getDefinedAttributes, getDocument, getFont, getID, getLanguage, getLogger, getMeasureValue, getObjectValue, getObjectValue, getObjectValue, getObjectValue, getOrphans, getParentFO, getWidows, hasID, hasPadding, isEmpty, isHyphenation, removeElement, removeElement, replaceElement, setAbsolutePosition, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setElement, setFont, setHyphenation, setID, setLanguage, setLanguage, setOrphans, setWidows`

    - ### Methods inherited from class de.vc.xml.AbstractNodeWithAttributes

      `getDefaultMapType, setDefaultMapType`

    - ### Methods inherited from class de.vc.xml.AbstractNode

      `addAttributeChangeListener, addElements, addElements, clearEqualAttributes, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, contains, copyAttributes, createID, findFirstNodeWithText, findNode, findNodesWithText, fire, fireSaxEvents, firstElement, getAttrAsBoolean, getAttrAsInteger, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getContentText, getDefinedAttributes, getElements, getElements, getElements, getFirstElement, getIndex, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getParent, getParent, getParent, getParentOrThis, getQName, getRoot, hasEqualAttrs, indexOf, lastElement, liftInheritedAttribute, removeAttributeChangeListener, setAttribute, setAttributes, setAttrIfNotNull, setEnableAttributeChangeEvent, setNamespace, setParent, setQName, setUndefinedAttributes, writeTo, writeTo, writeTo, writeTo`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.vc.xml.Node

      `addAttributeChangeListener, addElement, addElement, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, fireSaxEvents, firstElement, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getDefinedAttributes, getElements, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getQName, getRoot, indexOf, isEmpty, lastElement, removeAttributeChangeListener, removeElement, removeElement, replaceElement, setAttribute, setAttributes, setElement, setNamespace`

    - ### Methods inherited from interface de.vc.xml.NodeElement

      `clone, getParent, setParent, writeTo`

- - ### Constructor Detail

    - #### ExternalGraphic

          public ExternalGraphic()

    - #### ExternalGraphic

          public ExternalGraphic(java.lang.String src)

  - ### Method Detail

    - #### getElements

          public java.util.List getElements()

      Description copied from class: `AbstractNode`
      Gets childreen of this node. A child is typical an instance of `NodeElement` or `String`.
      Specified by:
        `getElements` in interface `Node`
      Specified by:
        `getElements` in class `AbstractNode`
      Returns:
        Childreen.

    - #### getMargin

          public Margin getMargin()

      Gets the margin of this fo. Is never null.
      Overrides:
        `getMargin` in class `FormattingObject`
      Returns:
        Margin.

    - #### setMargin

          public void setMargin(Margin margin)

      Sets the margin of this fo.
      Overrides:
        `setMargin` in class `FormattingObject`
      Parameters:
        `margin` - Margin.

    - #### getPadding

          public Padding getPadding()

      Gets the padding of this fo. Is never null.
      Overrides:
        `getPadding` in class `FormattingObject`
      Returns:
        Padding.

    - #### setPadding

          public void setPadding(Padding padding)

      Sets the padding of this fo.
      Overrides:
        `setPadding` in class `FormattingObject`
      Parameters:
        `padding` - Padding.

    - #### hasBorder

          public boolean hasBorder()

      Returns true if at least one border attribute is set.
      Overrides:
        `hasBorder` in class `FormattingObject`
      Returns:
        True if at least one border attribute is set.

    - #### getBorder

          public Border getBorder()

      Gets the border of this fo. Is never null.
      Overrides:
        `getBorder` in class `FormattingObject`
      Returns:
        Border.

    - #### setBorder

          public void setBorder(Border border)

      Sets the border of this fo. If border is NULL, an empty border is created.
      Overrides:
        `setBorder` in class `FormattingObject`
      Parameters:
        `border` - Border.

    - #### getBackground

          public Background getBackground()

      Gets the background of this fo. Is never null.
      Overrides:
        `getBackground` in class `FormattingObject`
      Returns:
        Background.

    - #### setBackground

          public void setBackground(Background bg)

      Sets the background of this fo.
      Overrides:
        `setBackground` in class `FormattingObject`
      Parameters:
        `bg` - Background.

    - #### getAccessibility

          public Accessibility getAccessibility()

      Gets the accessibilty of this fo. Is never null.
      Overrides:
        `getAccessibility` in class `FormattingObject`
      Returns:
        Accessibility.

    - #### setAccessibility

          public void setAccessibility(Accessibility access)

      Sets the accessibility of this fo.
      Overrides:
        `setAccessibility` in class `FormattingObject`
      Parameters:
        `access` - Accessibility.

    - #### getRelativePosition

          public RelativePosition getRelativePosition()

      Gets the relative position of this fo. Is never null.
      Overrides:
        `getRelativePosition` in class `FormattingObject`
      Returns:
        RelativePosition.

    - #### setRelativePosition

          public void setRelativePosition(RelativePosition pos)

      Sets the relative position of this fo.
      Overrides:
        `setRelativePosition` in class `FormattingObject`
      Parameters:
        `pos` - RelativePosition.

    - #### setTextAlignment

          public void setTextAlignment(Values.Alignment alignment)

      Sets the alignment of text.
      Parameters:
        `alignment` - Alignment of text.

    - #### getTextAlignment

          public Values.Alignment getTextAlignment()

      Gets the alignment of text. By default ALIGNMENT_LEFT is returned.
      Returns:
        Alignment of text.

    - #### getSource

          public java.lang.String getSource()

      Gets the source URL of this external graphic.
      Returns:
        Source URL.

    - #### setSource

          public void setSource(java.lang.String source)

      Sets the source of this external graphic.
      Parameters:
        `source` - Source of graphic.

    - #### setSourceAsUrl

          public void setSourceAsUrl(java.lang.String url)

      Set the source URL of this graphic. The `url` is wrapped in URL-function: url(`url`).
      Parameters:
        `url` - URL of graphic.

    - #### setSourceAsBase64Data

          public void setSourceAsBase64Data(byte[] image,
                                   java.lang.String mediaType)

      Sets the source as instream data using the URL-data scheme (RFC 2397). The image is encoded into BASE64 format. Note, to avoid memory problems you should store large images to hard disc.
      Parameters:
        `image` - byte[] Image data
        `mediaType` - Optionally media type of image (e.g. image/gif) or null if unknown.

    - #### setDisplayAlign

          public void setDisplayAlign(Values.DisplayAlignment align)

      Sets the display-alignment.
      Parameters:
        `align` - Alignment.

    - #### getDisplayAlign

          public Values.DisplayAlignment getDisplayAlign()

      Gets the display-alignment. By default DISPLAY_ALIGN_BEFORE is returned.
      Returns:
        Alignment.

    - #### getHeight

          public Measure getHeight()

      Gets the height of this graphic container, is NULL, if not defined.
      Returns:
        Height of this graphic.

    - #### getContentHeight

          public Measure getContentHeight()

      Gets the height of graphic content, is NULL, if not defined.
      Returns:
        Height of this graphic.

    - #### getWidth

          public Measure getWidth()

      Gets the width of this graphic container, is NULL, if not defined.
      Returns:
        Width of this graphic.

    - #### setWidth

          public void setWidth(Measure width)

      Sets the width of this graphic container.
      Parameters:
        `width` - Width.

    - #### setHeight

          public void setHeight(Measure height)

      Sets the height of this graphic container.
      Parameters:
        `height` - Height.

    - #### setSize

          public void setSize(Measure width,
                     Measure height)

      Sets width and height of this graphic container.
      Parameters:
        `width` - Width.
        `height` - Height.

    - #### setContentHeight

          public void setContentHeight(Measure height)

      Sets the height of graphic content.
      Parameters:
        `height` - Height.

    - #### getContentWidth

          public Measure getContentWidth()

      Gets the width of graphic content, is NULL, if not defined.
      Returns:
        Width of this graphic.

    - #### setContentWidth

          public void setContentWidth(Measure width)

      Sets the width of graphic content.
      Parameters:
        `width` - Width.

    - #### setContentSize

          public void setContentSize(Measure width,
                            Measure height)

      Sets width and height of graphic content.
      Parameters:
        `width` - Width.
        `height` - Height.

    - #### setScaling

          public void setScaling(Values.Scaling scaling)

      Sets the scaling type of this graphic.
      Parameters:
        `scaling` - Scaling type.

    - #### getScaling

          public Values.Scaling getScaling()

      Gets the scaling typ of this graphic.
      Returns:
        Scaling of NULL if not defined.

    - #### addUnsafe

          public boolean addUnsafe(java.lang.Object child)

      Description copied from class: `FormattingObject`
      Adds a NodeElement to this FormattingObject. You must ensure, that this FormattingObject can contain given element.
      Overrides:
        `addUnsafe` in class `FormattingObject`
      Parameters:
        `child` - Element.
      Returns:
        `false` if this FO is unable to add object.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.