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
getAttribute
public String getAttribute(String key)A source attribute the reader kept, or null.
Readers keep facts the rendering model has no field for, so that tools reading
the document as a design can still see them: Figma’s auto-layout
(layoutMode, itemSpacing, paddingLeft…), resizing constraints
(constraints.horizontal), component instances (componentId), and the
source’s own node type (sourceType). Rendering never reads them.
Parameters
keyString- the attribute name
setAttribute
public void setAttribute(String key, String value)Parameters
keyString- the attribute name
valueString- the value, or null
getAttributes
public Map<String, String> getAttributes()getId
public String getId()setId
public void setId(String id)Parameters
idString- the id
getName
public String getName()setName
public void setName(String name)Parameters
nameString- the name
isVisible
public boolean isVisible()setVisible
public void setVisible(boolean visible)Parameters
visibleboolean- true to show it
isLocked
public boolean isLocked()setLocked
public void setLocked(boolean locked)Parameters
lockedboolean- true to lock
getOpacity
public float getOpacity()setOpacity
public void setOpacity(float opacity)Parameters
opacityfloat- 0 to 1
getBlendMode
public BlendMode getBlendMode()setBlendMode
public void setBlendMode(BlendMode blendMode)Parameters
blendModeBlendMode- the mode
getTransform
public Matrix getTransform()setTransform
public void setTransform(Matrix transform)Parameters
transformMatrix- the new transform
getClipPath
public GeneralPath getClipPath()setClipPath
public void setClipPath(GeneralPath clipPath)Parameters
clipPathGeneralPath- the clip; null for none
getMask
public ArtNode getMask()setMask
public void setMask(ArtNode mask, boolean luminance)Parameters
maskArtNode- the mask node; null for none
luminanceboolean- true to mask by luminance (SVG), false by alpha
isKnockout
public boolean isKnockout()setKnockout
public void setKnockout(boolean knockout)Parameters
knockoutboolean- true to knock out the layers below in the group
isLuminanceMask
public boolean isLuminanceMask()getEffects
public List<Effect> getEffects()getLocalBounds
public abstract double[] getLocalBounds()x, y, w, h, without
effects; null when it has none.copy
public abstract ArtNode copy()copyBase
protected ArtNode copyBase(ArtNode n)n and returns it.getBounds
public double[] getBounds()x, y, w, h; null when empty.