Class ActiveEnvironmentGroup

  • All Implemented Interfaces:
    Streamable

    public final class ActiveEnvironmentGroup
    extends AbstractEnvironmentGroup
    An Active Environment Group (AEG) is associated with each page, and is contained in the page's begin-end envelope in the data stream. The active environment group contains layout and formatting information that defines the measurement units and size of the page, and may contain resource information. Any objects that are required for page presentation and that are to be treated as resource objects must be mapped with a map structured field in the AEG. The scope of an active environment group is the scope of its containing page or overlay.
    • Field Detail

      • mapCodedFonts

        private final java.util.List<AbstractStructuredObject> mapCodedFonts
        The collection of MapCodedFont objects
      • mapPageSegments

        private java.util.List mapPageSegments
        the collection of MapPageSegments objects
      • objectAreaDescriptor

        private ObjectAreaDescriptor objectAreaDescriptor
        the Object Area Descriptor for the active environment group
      • objectAreaPosition

        private ObjectAreaPosition objectAreaPosition
        the Object Area Position for the active environment group
      • presentationTextDataDescriptor

        private PresentationTextDescriptor presentationTextDataDescriptor
        the PresentationTextDescriptor for the active environment group
      • pageDescriptor

        private PageDescriptor pageDescriptor
        the PageDescriptor for the active environment group
      • factory

        private final Factory factory
        the resource manager
    • Constructor Detail

      • ActiveEnvironmentGroup

        public ActiveEnvironmentGroup​(Factory factory,
                                      java.lang.String name,
                                      int width,
                                      int height,
                                      int widthRes,
                                      int heightRes)
        Constructor for the ActiveEnvironmentGroup, this takes a name parameter which must be 8 characters long.
        Parameters:
        factory - the object factory
        name - the active environment group name
        width - the page width
        height - the page height
        widthRes - the page width resolution
        heightRes - the page height resolution
    • Method Detail

      • setObjectAreaPosition

        public void setObjectAreaPosition​(int x,
                                          int y,
                                          int rotation)
        Set the position of the object area
        Parameters:
        x - the x offset
        y - the y offset
        rotation - the rotation
      • getPageDescriptor

        public PageDescriptor getPageDescriptor()
        Accessor method to obtain the PageDescriptor object of the active environment group.
        Returns:
        the page descriptor object
      • getPresentationTextDataDescriptor

        public PresentationTextDescriptor getPresentationTextDataDescriptor()
        Accessor method to obtain the PresentationTextDataDescriptor object of the active environment group.
        Returns:
        the presentation text descriptor
      • writeContent

        public void writeContent​(java.io.OutputStream os)
                          throws java.io.IOException
        Helper method to write the contents of the Object.
        Overrides:
        writeContent in class AbstractEnvironmentGroup
        Parameters:
        os - The stream to write to
        Throws:
        java.io.IOException - throws an I/O exception if one occurred
      • writeStart

        protected void writeStart​(java.io.OutputStream os)
                           throws java.io.IOException
        Helper method to write the start of the Object.
        Overrides:
        writeStart in class AbstractStructuredObject
        Parameters:
        os - The stream to write to
        Throws:
        java.io.IOException - throws an I/O exception if one occurred
      • writeEnd

        protected void writeEnd​(java.io.OutputStream os)
                         throws java.io.IOException
        Helper method to write the end of the Object.
        Overrides:
        writeEnd in class AbstractStructuredObject
        Parameters:
        os - The stream to write to
        Throws:
        java.io.IOException - an I/O exception if one occurred
      • createFont

        public void createFont​(int fontRef,
                               AFPFont font,
                               int size,
                               int orientation)
        Method to create a map coded font object
        Parameters:
        fontRef - the font number used as the resource identifier
        font - the font
        size - the point size of the font
        orientation - the orientation of the font (e.g. 0, 90, 180, 270)
      • getCurrentMapCodedFont

        private MapCodedFont getCurrentMapCodedFont()
        Getter method for the most recent MapCodedFont added to the Active Environment Group (returns null if no MapCodedFonts exist)
        Returns:
        the most recent Map Coded Font.
      • addMapPageSegment

        public void addMapPageSegment​(java.lang.String name)
        Add map page segment.
        Parameters:
        name - of segment to add
      • getCurrentMapPageSegment

        private MapPageSegment getCurrentMapPageSegment()