Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class GroupNode

  1. Object
  2. ArtNode
  3. GroupNode

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.

Constructors

public GroupNode()

Methods

public List<ArtNode> getChildren()The children, painted first to last.
public GroupNode add(ArtNode child)Adds a child on top.
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.
public void setPassThrough(boolean passThrough)Sets pass-through.
public double[] getFrame()The frame as x, y, w, h, or null for a plain group.
public void setFrame(double x, double y, double w, double h, boolean clip)Makes this group an artboard.
public void clearFrame()Removes the frame.
public boolean isClipToFrame()True when children are clipped to the frame.
public ArtPaint getBackground()The frame’s background, or null.
public void setBackground(ArtPaint background)Sets the frame’s background.
public String getSymbolId()The symbol or component this group was expanded from, or null.
public void setSymbolId(String symbolId)Records the symbol this group was expanded from.
public double[] getLocalBounds()The bounds of this node’s own content in its own space as x, y, w, h, without effects; null when it has none.
public ArtNode copy()A deep copy.
protected void copyGroup(GroupNode g)Copies the group’s own state into g.

Inherited methods

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 ArtNode
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 boolean
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 double
left
y double
top
w double
width
h double
height
clip boolean
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 ArtPaint
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 String
the source symbol’s id

getLocalBounds

public double[] getLocalBounds()
The bounds of this node’s own content in its own space as x, y, w, h, without effects; null when it has none.

copy

public ArtNode copy()
A deep copy.

copyGroup

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