public class ShapeLineStyle
extends java.lang.Object
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");
Stroke.getLineStyle(),
Stroke.setLineStyle(int)| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT
Default value is
SINGLE. |
static int |
DOUBLE
Double lines of equal width.
|
static int |
length |
static int |
SINGLE
Single line.
|
static int |
THICK_THIN
Double lines, one thick, one thin.
|
static int |
THIN_THICK
Double lines, one thin, one thick.
|
static int |
TRIPLE
Three lines, thin, thick, thin.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String shapeLineStyleName) |
static java.lang.String |
getName(int shapeLineStyle) |
static int[] |
getValues() |
static java.lang.String |
toString(int shapeLineStyle) |
public static int SINGLE
public static int DOUBLE
public static int THICK_THIN
public static int THIN_THICK
public static int TRIPLE
public static int DEFAULT
SINGLE.public static int length