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 AttributeListattributesprotected java.util.HashMap<java.lang.Integer,java.util.ArrayList<LayoutItem>>item_mapprotected intpage_countFields 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 voidappendPage()Appends a single page to this document.java.lang.StringgetName()Gets the name for this object.intgetPageCount()Returns the number of printable pages in this document.java.awt.print.PageFormatgetPageFormat()Returns this document's page format (size and orientation)protected voidinit()Initializes this document's attributes.voidsetName(java.lang.String name)Sets the name for this object.voidsetPageCount(int page_count)Sets the number of printable pages in this document.voidsetPageFormat(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, updateTreeNodesMethods 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:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Overrides:
getNamein classAbstractInterfaceObject- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject- Overrides:
setNamein 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.
-