AdjustmentCollection

Inheritance: java.lang.Object

public class AdjustmentCollection

Represents a read-only collection of Adjustment adjust values that are applied to the specified shape.

Examples:

Shows how to work with adjustment raw values.


 Document doc = new Document(getMyDir() + "Rounded rectangle shape.docx");
 Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

 AdjustmentCollection adjustments = shape.getAdjustments();
 Assert.assertEquals(1, adjustments.getCount());

 Adjustment adjustment = adjustments.get(0);
 Assert.assertEquals("adj", adjustment.getName());
 Assert.assertEquals(16667, adjustment.getValue());

 adjustment.setValue(30000);

 doc.save(getArtifactsDir() + "Shape.Adjustments.docx");
 

Methods

MethodDescription
get(int index)Returns an adjustment at the specified index.
getCount()Gets the number of elements contained in the collection.

get(int index)

public Adjustment get(int index)

Returns an adjustment at the specified index.

Examples:

Shows how to work with adjustment raw values.


 Document doc = new Document(getMyDir() + "Rounded rectangle shape.docx");
 Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

 AdjustmentCollection adjustments = shape.getAdjustments();
 Assert.assertEquals(1, adjustments.getCount());

 Adjustment adjustment = adjustments.get(0);
 Assert.assertEquals("adj", adjustment.getName());
 Assert.assertEquals(16667, adjustment.getValue());

 adjustment.setValue(30000);

 doc.save(getArtifactsDir() + "Shape.Adjustments.docx");
 

Parameters:

ParameterTypeDescription
indexintAn index into the collection.

Returns: Adjustment - An adjustment at the specified index.

getCount()

public int getCount()

Gets the number of elements contained in the collection.

Examples:

Shows how to work with adjustment raw values.


 Document doc = new Document(getMyDir() + "Rounded rectangle shape.docx");
 Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

 AdjustmentCollection adjustments = shape.getAdjustments();
 Assert.assertEquals(1, adjustments.getCount());

 Adjustment adjustment = adjustments.get(0);
 Assert.assertEquals("adj", adjustment.getName());
 Assert.assertEquals(16667, adjustment.getValue());

 adjustment.setValue(30000);

 doc.save(getArtifactsDir() + "Shape.Adjustments.docx");
 

Returns: int - The number of elements contained in the collection.