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

public abstract class ArtNode

  1. Object
  2. ArtNode

Known subtypesAdjustmentNode, GroupNode, RasterNode, ShapeNode, TextNode

One element of an artwork: a group, shape, text, image or adjustment layer.

Every node has its own transform (from its space to its parent’s), opacity, blend mode, an optional clip path and mask, and a list of effects applied in order.

Constructors

public ArtNode()

Methods

public String getId()The node’s id, unique within a document when set.
public void setId(String id)Sets the id.
public String getName()The display name, as a layers panel shows it.
public void setName(String name)Sets the name.
public boolean isVisible()False hides the node and everything in it.
public void setVisible(boolean visible)Shows or hides the node.
public boolean isLocked()True keeps the editor from selecting the node.
public void setLocked(boolean locked)Locks or unlocks the node.
public float getOpacity()Opacity, 0 to 1.
public void setOpacity(float opacity)Sets the opacity.
public BlendMode getBlendMode()The blend mode.
public void setBlendMode(BlendMode blendMode)Sets the blend mode.
public Matrix getTransform()The transform from this node’s space to its parent’s.
public void setTransform(Matrix transform)Sets the transform.
public GeneralPath getClipPath()A clip path in this node’s space, or null.
public void setClipPath(GeneralPath clipPath)Sets the clip path.
public ArtNode getMask()A node whose alpha (or luminance) masks this one, in this node’s space; or null.
public void setMask(ArtNode mask, boolean luminance)Sets the mask.
public boolean isKnockout()True when the node knocks out what is below it in its group, Photoshop’s shallow knockout: where the node is opaque, the layers under it in the same group are erased before it is drawn, so the group’s backdrop shows through.
public void setKnockout(boolean knockout)Sets the knockout.
public boolean isLuminanceMask()True when the mask works by luminance.
public List<Effect> getEffects()The effects, applied in order.
public abstract 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 abstract ArtNode copy()A deep copy.
protected ArtNode copyBase(ArtNode n)Copies the shared properties into n and returns it.
public double[] getBounds()Bounds in the parent’s space, as x, y, w, h; null when empty.

Inherited methods

Constructor details

ArtNode

public ArtNode()

Method details

getId

public String getId()
The node’s id, unique within a document when set.

setId

public void setId(String id)
Sets the id.

Parameters

id String
the id

getName

public String getName()
The display name, as a layers panel shows it.

setName

public void setName(String name)
Sets the name.

Parameters

name String
the name

isVisible

public boolean isVisible()
False hides the node and everything in it.

setVisible

public void setVisible(boolean visible)
Shows or hides the node.

Parameters

visible boolean
true to show it

isLocked

public boolean isLocked()
True keeps the editor from selecting the node.

setLocked

public void setLocked(boolean locked)
Locks or unlocks the node.

Parameters

locked boolean
true to lock

getOpacity

public float getOpacity()
Opacity, 0 to 1.

setOpacity

public void setOpacity(float opacity)
Sets the opacity.

Parameters

opacity float
0 to 1

getBlendMode

public BlendMode getBlendMode()
The blend mode.

setBlendMode

public void setBlendMode(BlendMode blendMode)
Sets the blend mode.

Parameters

blendMode BlendMode
the mode

getTransform

public Matrix getTransform()
The transform from this node’s space to its parent’s.

setTransform

public void setTransform(Matrix transform)
Sets the transform.

Parameters

transform Matrix
the new transform

getClipPath

public GeneralPath getClipPath()
A clip path in this node’s space, or null.

setClipPath

public void setClipPath(GeneralPath clipPath)
Sets the clip path.

Parameters

clipPath GeneralPath
the clip; null for none

getMask

public ArtNode getMask()
A node whose alpha (or luminance) masks this one, in this node’s space; or null.

setMask

public void setMask(ArtNode mask, boolean luminance)
Sets the mask.

Parameters

mask ArtNode
the mask node; null for none
luminance boolean
true to mask by luminance (SVG), false by alpha

isKnockout

public boolean isKnockout()
True when the node knocks out what is below it in its group, Photoshop’s shallow knockout: where the node is opaque, the layers under it in the same group are erased before it is drawn, so the group’s backdrop shows through.

setKnockout

public void setKnockout(boolean knockout)
Sets the knockout.

Parameters

knockout boolean
true to knock out the layers below in the group

isLuminanceMask

public boolean isLuminanceMask()
True when the mask works by luminance.

getEffects

public List<Effect> getEffects()
The effects, applied in order. The list is live.

getLocalBounds

public abstract 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 abstract ArtNode copy()
A deep copy.

copyBase

protected ArtNode copyBase(ArtNode n)
Copies the shared properties into n and returns it.

getBounds

public double[] getBounds()
Bounds in the parent’s space, as x, y, w, h; null when empty.