LineFormat — Aspose.Slides FOSS for Java API Reference
The LineFormat class represents the format of a line (shape outline). It implements ILineFormat.
Package: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class LineFormat implements ILineFormatProperties
| Property | Type | Access | Description |
|---|---|---|---|
getFillFormat() | ILineFillFormat | Read | Fill properties of the line. |
getWidth() / setWidth(double) | double | Read/Write | Line width in points. |
getDashStyle() / setDashStyle(LineDashStyle) | LineDashStyle | Read/Write | Dash style (solid, dash, dot, etc.). |
getCapStyle() / setCapStyle(LineCapStyle) | LineCapStyle | Read/Write | Line cap style (flat, round, square). |
getStyle() | LineStyle | Read | Line style (single, double, etc.). |
getCustomDashPattern() / setCustomDashPattern(List<Double>) | List<Double> | Read/Write | Custom dash pattern values. |
isFormatNotDefined() | boolean | Read | Whether no line format is defined. |
Usage Examples
Set a Shape Outline
import org.aspose.slides.foss.*;
import java.awt.Color;
IAutoShape shape = slide.getShapes().addAutoShape(
ShapeType.RECTANGLE, 50, 50, 200, 100);
ILineFormat line = shape.getLineFormat();
line.setWidth(3.0);
line.setDashStyle(LineDashStyle.DASH);
line.getFillFormat().setFillType(FillType.SOLID);
line.getFillFormat().getSolidFillColor().setColor(Color.BLACK);