Class ArtDocument

java.lang.Object
com.codename1.art.ArtDocument

public final class ArtDocument extends Object

An artwork: a canvas size and a tree of nodes.

Read one with ArtFormats.read, or build one in code. Render it with ArtRenderer, show it with ArtView, edit it with ArtModel and ArtEditor.

  • Constructor Details

    • ArtDocument

      public ArtDocument(double width, double height)

      Creates an empty document.

      Parameters
      • width: canvas width
      • height: canvas height
  • Method Details

    • getWidth

      public double getWidth()
      Canvas width.
    • getHeight

      public double getHeight()
      Canvas height.
    • setSize

      public void setSize(double width, double height)

      Resizes the canvas.

      Parameters
      • width: new width
      • height: new height
    • getRoot

      public GroupNode getRoot()
      The root group.
    • setRoot

      public void setRoot(GroupNode root)

      Replaces the root.

      Parameters
      • root: the new root
    • getTitle

      public String getTitle()
      The title, or null.
    • setTitle

      public void setTitle(String title)

      Sets the title.

      Parameters
      • title: the title
    • getNotes

      public List<ImportNote> getNotes()
      What the reader that produced this document could not represent exactly.
    • copy

      public ArtDocument copy()
      A deep copy.
    • findById

      public ArtNode findById(String id)

      Finds a node by id anywhere in the tree.

      Parameters
      • id: the id
    • parentOf

      public GroupNode parentOf(ArtNode node)

      The group that holds node, or null when it is the root or not in this document.

      Parameters
      • node: the node
    • toDocument

      public Matrix toDocument(ArtNode node)

      The transform from node's space to document space, or null when it is not here.

      Parameters
      • node: the node