Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public abstract class ArtNode
- Object
- 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
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
idString- 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
nameString- 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
visibleboolean- 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
lockedboolean- true to lock
getOpacity
public float getOpacity()Opacity, 0 to 1.
setOpacity
public void setOpacity(float opacity)Sets the opacity.
Parameters
opacityfloat- 0 to 1
getBlendMode
public BlendMode getBlendMode()The blend mode.
setBlendMode
public void setBlendMode(BlendMode blendMode)Sets the blend mode.
Parameters
blendModeBlendMode- 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
transformMatrix- 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
clipPathGeneralPath- 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
maskArtNode- the mask node; null for none
luminanceboolean- 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
knockoutboolean- 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.