public class LengthRecord extends VectorPathRecord
Subpath Length Record Class
An example of changing path operations when working with shapes. The program reads a predefined vector path records (LengthRecord) and changes their path operations then saves a modified copy of the document as a new PSD file.
String inPsdFilePath = "PathOperationsShape.psd"; String outPsdFilePath = "out_" + inPsdFilePath; // Load a PSD file containing a predefined vsms resource PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath); try { // Find first VsmsResource in resources of the predefined layer VsmsResource resource = null; for (LayerResource layerResource : psdImage.getLayers()[1].getResources()) { if (layerResource instanceof VsmsResource) { resource = (VsmsResource)layerResource; break; } } LengthRecord lengthRecord0 = (LengthRecord)resource.getPaths()[2]; LengthRecord lengthRecord1 = (LengthRecord)resource.getPaths()[7]; LengthRecord lengthRecord2 = (LengthRecord)resource.getPaths()[11]; // Change the way in which shapes are combined lengthRecord0.setPathOperations(PathOperations.ExcludeOverlappingShapes); lengthRecord1.setPathOperations(PathOperations.IntersectShapeAreas); lengthRecord2.setPathOperations(PathOperations.SubtractFrontShape); // Save a modified copy of loaded PSD file on the path psdImage.save(outPsdFilePath); } finally { psdImage.dispose(); }
Constructor and Description |
---|
LengthRecord()
Initializes a new instance of the
LengthRecord class. |
LengthRecord(byte[] data)
Initializes a new instance of the
LengthRecord class. |
Modifier and Type | Method and Description |
---|---|
int |
getBezierKnotRecordsCount()
Gets or sets the bezier knot records count.
|
int |
getPathOperations()
Gets or sets the path operations.
|
int |
getRecordCount()
Gets or sets the record count.
|
int |
getShapeIndex()
Gets or sets the index of current path shape in layer.
|
short |
getType()
Gets the type.
|
boolean |
isClosed()
Gets or sets a value indicating whether this instance is closed.
|
boolean |
isOpen()
Gets or sets a value indicating whether this instance is open.
|
void |
setBezierKnotRecordsCount(int value)
Gets or sets the bezier knot records count.
|
void |
setClosed(boolean value)
Gets or sets a value indicating whether this instance is closed.
|
void |
setOpen(boolean value)
Gets or sets a value indicating whether this instance is open.
|
void |
setPathOperations(int value)
Gets or sets the path operations.
|
void |
setRecordCount(int value)
Gets or sets the record count.
|
void |
setShapeIndex(int value)
Gets or sets the index of current path shape in layer.
|
public LengthRecord(byte[] data)
Initializes a new instance of the LengthRecord
class.
data
- The record data.PsdImageArgumentException
- Incorrect data for LengthRecord creationpublic LengthRecord()
Initializes a new instance of the LengthRecord
class.
public final boolean isClosed()
Gets or sets a value indicating whether this instance is closed.
Value:true
if this instance is closed; otherwise, false
.public final void setClosed(boolean value)
Gets or sets a value indicating whether this instance is closed.
Value:true
if this instance is closed; otherwise, false
.public final boolean isOpen()
Gets or sets a value indicating whether this instance is open.
Value:true
if this instance is open; otherwise, false
.public final void setOpen(boolean value)
Gets or sets a value indicating whether this instance is open.
Value:true
if this instance is open; otherwise, false
.public final int getRecordCount()
Gets or sets the record count.
Value: The record count.public final void setRecordCount(int value)
Gets or sets the record count.
Value: The record count.public short getType()
Gets the type.
Value: The type.getType
in class VectorPathRecord
public final int getBezierKnotRecordsCount()
Gets or sets the bezier knot records count.
public final void setBezierKnotRecordsCount(int value)
Gets or sets the bezier knot records count.
public final int getPathOperations()
Gets or sets the path operations.
public final void setPathOperations(int value)
Gets or sets the path operations.
public final int getShapeIndex()
Gets or sets the index of current path shape in layer.
public final void setShapeIndex(int value)
Gets or sets the index of current path shape in layer.