Class GroupNode
java.lang.Object
com.codename1.art.ArtNode
com.codename1.art.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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a child on top.voidRemoves the frame.copy()A deep copy.protected voidCopies the group's own state intog.The frame's background, or null.The children, painted first to last.double[]getFrame()The frame asx, y, w, h, or null for a plain group.double[]The bounds of this node's own content in its own space asx, y, w, h, without effects; null when it has none.The symbol or component this group was expanded from, or null.booleanTrue when children are clipped to the frame.booleanTrue (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.voidsetBackground(ArtPaint background) Sets the frame's background.voidsetFrame(double x, double y, double w, double h, boolean clip) Makes this group an artboard.voidsetPassThrough(boolean passThrough) Sets pass-through.voidsetSymbolId(String symbolId) Records the symbol this group was expanded from.Methods inherited from class ArtNode
copyBase, getBlendMode, getBounds, getClipPath, getEffects, getId, getMask, getName, getOpacity, getTransform, isKnockout, isLocked, isLuminanceMask, isVisible, setBlendMode, setClipPath, setId, setKnockout, setLocked, setMask, setName, setOpacity, setTransform, setVisible
-
Constructor Details
-
GroupNode
public GroupNode()
-
-
Method Details
-
getChildren
-
add
-
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 asx, 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: lefty: topw: widthh: heightclip: 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
The frame's background, or null. -
setBackground
Sets the frame's background.
Parameters
background: the paint; null for none
-
getSymbolId
The symbol or component this group was expanded from, or null. -
setSymbolId
Records the symbol this group was expanded from.
Parameters
symbolId: the source symbol's id
-
getLocalBounds
public double[] getLocalBounds()Description copied from class:ArtNodeThe bounds of this node's own content in its own space asx, y, w, h, without effects; null when it has none.- Specified by:
getLocalBoundsin classArtNode
-
copy
-
copyGroup
Copies the group's own state intog.
-