Package snap.view

Class DocView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class DocView extends ParentView
A view to represent a traditional paper document.
  • Field Details

  • Constructor Details

    • DocView

      public DocView()
      Constructor.
  • Method Details

    • getPageCount

      public int getPageCount()
      Returns the number of pages.
    • getPage

      public PageView getPage(int anIndex)
      Returns the individual page at given index.
    • addPage

      public void addPage(PageView aPage)
      Adds a given page.
    • addPage

      public void addPage(PageView aPage, int anIndex)
      Adds a given page at given index.
    • removePage

      public PageView removePage(int anIndex)
      Removes the page at given index.
    • removePage

      public int removePage(PageView aPage)
      Removes the given page.
    • getPageMargin

      public Insets getPageMargin()
      Returns the page margin.
    • setPageMargin

      public void setPageMargin(Insets aIns)
      Sets the page margin.
    • getSelIndex

      public int getSelIndex()
      Returns the selected page index.
    • setSelIndex

      public void setSelIndex(int anIndex)
      Sets the selected page index.
    • getSelPage

      public PageView getSelPage()
      Returns the currently selected page.
    • setSelPage

      public void setSelPage(PageView aPage)
      Sets the currently selected page.
    • getPage

      public PageView getPage()
      Returns the page node.
    • setPage

      public void setPage(PageView aPage)
      Sets the page node.
    • getPrefWidthImpl

      protected double getPrefWidthImpl(double aH)
      Returns the preferred width.
      Overrides:
      getPrefWidthImpl in class View
    • getPrefHeightImpl

      protected double getPrefHeightImpl(double aW)
      Returns the preferred height.
      Overrides:
      getPrefHeightImpl in class View
    • layoutImpl

      protected void layoutImpl()
      Layout children.
      Overrides:
      layoutImpl in class ParentView
    • toXMLChildren

      public void toXMLChildren(XMLArchiver anArchiver, XMLElement anElement)
      XML archival deep.
      Overrides:
      toXMLChildren in class ParentView
    • fromXMLChildren

      protected void fromXMLChildren(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival for shape children.
      Overrides:
      fromXMLChildren in class ParentView