ShapeLineStyle

Inheritance: java.lang.Object

public class ShapeLineStyle

Specifies the compound line style of a Shape.

Examples:

Shows how change stroke properties.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 Shape shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 100.0,
         RelativeVerticalPosition.TOP_MARGIN, 100.0, 200.0, 200.0, WrapType.NONE);

 // Basic shapes, such as the rectangle, have two visible parts.
 // 1 -  The fill, which applies to the area within the outline of the shape:
 shape.getFill().setForeColor(Color.WHITE);

 // 2 -  The stroke, which marks the outline of the shape:
 // Modify various properties of this shape's stroke.
 Stroke stroke = shape.getStroke();
 stroke.setOn(true);
 stroke.setWeight(5.0);
 stroke.setColor(Color.RED);
 stroke.setDashStyle(DashStyle.SHORT_DASH_DOT_DOT);
 stroke.setJoinStyle(JoinStyle.MITER);
 stroke.setEndCap(EndCap.SQUARE);
 stroke.setLineStyle(ShapeLineStyle.TRIPLE);
 stroke.getFill().twoColorGradient(Color.RED, Color.BLUE, GradientStyle.VERTICAL, GradientVariant.VARIANT_1);

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

Fields

FieldDescription
DEFAULTDefault value is SINGLE.
DOUBLEDouble lines of equal width.
SINGLESingle line.
THICK_THINDouble lines, one thick, one thin.
THIN_THICKDouble lines, one thin, one thick.
TRIPLEThree lines, thin, thick, thin.
length

Methods

MethodDescription
fromName(String shapeLineStyleName)
getName(int shapeLineStyle)
getValues()
toString(int shapeLineStyle)

DEFAULT

public static int DEFAULT

Default value is SINGLE.

DOUBLE

public static int DOUBLE

Double lines of equal width.

SINGLE

public static int SINGLE

Single line.

THICK_THIN

public static int THICK_THIN

Double lines, one thick, one thin.

THIN_THICK

public static int THIN_THICK

Double lines, one thin, one thick.

TRIPLE

public static int TRIPLE

Three lines, thin, thick, thin.

length

public static int length

fromName(String shapeLineStyleName)

public static int fromName(String shapeLineStyleName)

Parameters:

ParameterTypeDescription
shapeLineStyleNamejava.lang.String

Returns: int

getName(int shapeLineStyle)

public static String getName(int shapeLineStyle)

Parameters:

ParameterTypeDescription
shapeLineStyleint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int shapeLineStyle)

public static String toString(int shapeLineStyle)

Parameters:

ParameterTypeDescription
shapeLineStyleint

Returns: java.lang.String