Package mgui.interfaces.layouts
Class LayoutDocument
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.layouts.LayoutDocument
- All Implemented Interfaces:
InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
public class LayoutDocument extends AbstractInterfaceObject
Implements the top-level container for a 2D layout, containing renderable items within a fixed
coordinate system (document coordinates/units).
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected AttributeList
attributes
protected java.util.HashMap<java.lang.Integer,java.util.ArrayList<LayoutItem>>
item_map
protected int
page_count
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description LayoutDocument()
Constructs a new document with a default name and format.LayoutDocument(java.lang.String name, java.awt.print.PageFormat page_format)
Constructs a new document with the specified name and format. -
Method Summary
Modifier and Type Method Description void
appendPage()
Appends a single page to this document.java.lang.String
getName()
Gets the name for this object.int
getPageCount()
Returns the number of printable pages in this document.java.awt.print.PageFormat
getPageFormat()
Returns this document's page format (size and orientation)protected void
init()
Initializes this document's attributes.void
setName(java.lang.String name)
Sets the name for this object.void
setPageCount(int page_count)
Sets the number of printable pages in this document.void
setPageFormat(java.awt.print.PageFormat page_format)
Sets this document's page format (size and orientation)Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getTreeLabel, isDestroyed, issueTreeNode, setTreeNode, updateTreeNodes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
attributes
-
item_map
-
page_count
protected int page_count
-
-
Constructor Details
-
LayoutDocument
public LayoutDocument()Constructs a new document with a default name and format. -
LayoutDocument
public LayoutDocument(java.lang.String name, java.awt.print.PageFormat page_format)Constructs a new document with the specified name and format.- Parameters:
name
-page_format
-
-
-
Method Details
-
init
protected void init()Initializes this document's attributes. -
getName
public java.lang.String getName()Description copied from interface:NamedObject
Gets the name for this object.- Specified by:
getName
in interfaceNamedObject
- Overrides:
getName
in classAbstractInterfaceObject
- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObject
Sets the name for this object.- Specified by:
setName
in interfaceNamedObject
- Overrides:
setName
in classAbstractInterfaceObject
-
setPageFormat
public void setPageFormat(java.awt.print.PageFormat page_format)Sets this document's page format (size and orientation)- Parameters:
page_format
-- See Also:
PageFormat
-
getPageFormat
public java.awt.print.PageFormat getPageFormat()Returns this document's page format (size and orientation)- Returns:
- This document's page format
- See Also:
PageFormat
-
getPageCount
public int getPageCount()Returns the number of printable pages in this document.- Returns:
- This document's page count
-
setPageCount
public void setPageCount(int page_count)Sets the number of printable pages in this document. Note that this method will remove any existing pages which are beyond this values, along with their associated items. -
appendPage
public void appendPage()Appends a single page to this document.
-