Class GroupNode

java.lang.Object
com.codename1.art.ArtNode
com.codename1.art.GroupNode

public class GroupNode extends ArtNode

A node that holds other nodes, painted first to last.

An artboard (a Sketch artboard, a Figma frame, a PSD document) is a group with a frame: setFrame gives it a rectangle it can fill with a background and clip its children to.

  • Constructor Details

    • GroupNode

      public GroupNode()
  • Method Details

    • getChildren

      public List<ArtNode> getChildren()
      The children, painted first to last. The list is live.
    • add

      public GroupNode add(ArtNode child)

      Adds a child on top.

      Parameters
      • child: the node
    • isPassThrough

      public boolean isPassThrough()
      True (the default) lets children blend with what is below the group, as PSD's pass through mode does; false composites the group as one layer first. A group with opacity, effects, a mask or a blend mode other than normal is always isolated.
    • setPassThrough

      public void setPassThrough(boolean passThrough)

      Sets pass-through.

      Parameters
      • passThrough: false to isolate the group
    • getFrame

      public double[] getFrame()
      The frame as x, y, w, h, or null for a plain group.
    • setFrame

      public void setFrame(double x, double y, double w, double h, boolean clip)

      Makes this group an artboard.

      Parameters
      • x: left
      • y: top
      • w: width
      • h: height
      • clip: true to clip children to the frame
    • clearFrame

      public void clearFrame()
      Removes the frame.
    • isClipToFrame

      public boolean isClipToFrame()
      True when children are clipped to the frame.
    • getBackground

      public ArtPaint getBackground()
      The frame's background, or null.
    • setBackground

      public void setBackground(ArtPaint background)

      Sets the frame's background.

      Parameters
      • background: the paint; null for none
    • getSymbolId

      public String getSymbolId()
      The symbol or component this group was expanded from, or null.
    • setSymbolId

      public void setSymbolId(String symbolId)

      Records the symbol this group was expanded from.

      Parameters
      • symbolId: the source symbol's id
    • getLocalBounds

      public double[] getLocalBounds()
      Description copied from class: ArtNode
      The bounds of this node's own content in its own space as x, y, w, h, without effects; null when it has none.
      Specified by:
      getLocalBounds in class ArtNode
    • copy

      public ArtNode copy()
      Description copied from class: ArtNode
      A deep copy.
      Specified by:
      copy in class ArtNode
    • copyGroup

      protected void copyGroup(GroupNode g)
      Copies the group's own state into g.