[]
This interface provides access to line appearance settings such as solid or patterned color, fill type, dash style, cap style, join style, transparency, visibility, weight, and arrowhead settings at both the beginning and end of a line. It is typically obtained from APIs such as IShape.getLine().
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
ILineFormat line = shape.getLine();
line.getColor().setRGB(Color.GetRed());
line.setWeight(2.0);
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
getColor()IColorFormat object that represents the specified solid color.doubledoubleintbooleanIColorFormat object that represents the specified color of patterns.getStyle()LineStyle object that represents the ILineFormat style.doublegetType()booleandoublevoidoneColorGradient(GradientStyle style,
int variant,
double degree) voidpatterned(PatternType pattern) voidpresetGradient(GradientStyle style,
int variant,
PresetGradientType presetGradientType) voidvoidvoidvoidsetCapStyle(LineCapStyle value) voidsetDashStyle(LineDashStyle value) voidvoidvoidvoidsetGradientAngle(double value) voidsetInsetPen(boolean value) voidsetJoinStyle(LineJoinStyle value) voidLineStyle object that represents the ILineFormat style.voidsetTransparency(double value) voidsetVisible(boolean value) voidsetWeight(double value) voidsolid()voidtwoColorGradient(GradientStyle style,
int variant) IColorFormat object that represents the specified color of patterns.Use this method to access and modify the color applied to a patterned line, typically after calling patterned(PatternType) to set the line to a pattern fill.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.patterned(PatternType.Percent10);
IColorFormat patternColor = line.getPatternColor();
patternColor.setRGB(Color.GetRed());
IColorFormat object that represents the pattern color of the line.IColorFormat object that represents the specified solid color.Use this method to access or modify the solid color settings of the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
IColorFormat color = line.getColor();
color.setRGB(Color.GetRed());
IColorFormat object that represents the solid color of the line.Use this method to determine whether the line is currently configured with a solid, patterned, or gradient fill.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.patterned(PatternType.Percent10);
FillType type = line.getType();
FillType that indicates the current fill type of the line.Use this method to retrieve the current ArrowheadLength setting for the line's beginning arrowhead.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
line.setBeginArrowheadLength(ArrowheadLength.Long);
ArrowheadLength length = line.getBeginArrowheadLength();
ArrowheadLength of the arrowhead at the beginning of the specified line.Use this method to control the size of the arrowhead applied to the start of a shape or connector line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
line.setBeginArrowheadLength(ArrowheadLength.Long);
value - The ArrowheadLength to apply to the arrowhead at the beginning of the line.Use this method to retrieve the current ArrowheadStyle applied to the beginning of a connector or shape line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
ArrowheadStyle style = line.getBeginArrowheadStyle();
ArrowheadStyle of the arrowhead at the beginning of the specified line.Use this method to configure the ArrowheadStyle applied to the beginning of a connector or shape line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
value - The ArrowheadStyle to apply to the arrowhead at the beginning of the specified line.Use this method to retrieve the current ArrowheadWidth setting for the line's beginning arrowhead.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
line.setBeginArrowheadWidth(ArrowheadWidth.Wide);
ArrowheadWidth width = line.getBeginArrowheadWidth();
ArrowheadWidth of the arrowhead at the beginning of the specified line.Use ArrowheadWidth constants to control how narrow or wide the starting arrowhead appears.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setBeginArrowheadStyle(ArrowheadStyle.Triangle);
line.setBeginArrowheadWidth(ArrowheadWidth.Wide);
value - The arrowhead width to apply at the beginning of the line.LineDashStyle constants.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setDashStyle(LineDashStyle.Dash);
LineDashStyle dashStyle = line.getDashStyle();
LineDashStyle constants.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setDashStyle(LineDashStyle.Dash);
value - The dash style to apply to the line.LineCapStyle constants.Use setCapStyle(LineCapStyle) to change the cap style.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setCapStyle(LineCapStyle.Round);
LineCapStyle style = line.getCapStyle();
LineCapStyle constants.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setCapStyle(LineCapStyle.Round);
value - The cap style for the end of the line.LineJoinStyle constants.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setJoinStyle(LineJoinStyle.Round);
LineJoinStyle style = line.getJoinStyle();
LineJoinStyle constants.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setJoinStyle(LineJoinStyle.Round);
value - The join style to apply. Can be one of the LineJoinStyle constants.Use this method to retrieve the current ArrowheadLength setting for the line's ending arrowhead.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
line.setEndArrowheadLength(ArrowheadLength.Long);
ArrowheadLength length = line.getEndArrowheadLength();
ArrowheadLength of the arrowhead at the end of the specified line.Use this method with setEndArrowheadStyle(ArrowheadStyle) to configure the appearance of the arrowhead at the end of a line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
line.setEndArrowheadLength(ArrowheadLength.Long);
value - The arrowhead length to apply to the end of the line.Use this method to retrieve the current ArrowheadStyle applied to the end of a connector or shape line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
ArrowheadStyle style = line.getEndArrowheadStyle();
ArrowheadStyle of the arrowhead at the end of the specified line.Use this method to configure the ArrowheadStyle applied to the end of a connector or shape line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Open);
value - The ArrowheadStyle to apply to the arrowhead at the end of the specified line.Use this method to read the current end arrowhead width configured for the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
line.setEndArrowheadWidth(ArrowheadWidth.Wide);
ArrowheadWidth width = line.getEndArrowheadWidth();
ArrowheadWidth of the arrowhead at the end of the specified line.Use ArrowheadWidth constants to control how narrow or wide the ending arrowhead appears.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setEndArrowheadStyle(ArrowheadStyle.Triangle);
line.setEndArrowheadWidth(ArrowheadWidth.Wide);
value - The arrowhead width to apply at the end of the line.This property indicates whether the line is rendered within the shape outline instead of being centered on the shape boundary.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setInsetPen(true);
boolean insetPen = line.getInsetPen();
true if lines are drawn inside the specified shape's boundaries; otherwise, false.This property indicates whether the line is rendered within the shape outline instead of being centered on the shape boundary.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setInsetPen(true);
value - true if lines are drawn inside the specified shape's boundaries; otherwise, false.Use this method to retrieve the current PatternType applied to the line after the line has been configured with a pattern fill.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.patterned(PatternType.Cross);
PatternType pattern = line.getPattern();
LineStyle object that represents the ILineFormat style.Use this method to retrieve the current compound line style applied to a shape line, such as LineStyle.Single or LineStyle.ThickBetweenThin.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setStyle(LineStyle.Single);
LineStyle style = line.getStyle();
LineStyle object that represents the current ILineFormat style.LineStyle object that represents the ILineFormat style.Use this method to apply a predefined line style, such as LineStyle.Single, LineStyle.ThinThin, or LineStyle.ThickBetweenThin, to a shape line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setStyle(LineStyle.Single);
value - The LineStyle to apply to the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setTransparency(0.25);
double transparency = line.getTransparency();
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setTransparency(0.25);
value - The degree of transparency of the line, from 0.0 for a fully opaque line to 1.0 for a fully clear line.Use this method to check whether the line for the shape is currently displayed.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setVisible(false);
boolean visible = line.getVisible();
true if the object is visible; otherwise, false.Use this method to set whether the line for the shape is currently displayed.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setVisible(false);
value - true if the object is visible; otherwise, false.Use this property to get the current direction of a gradient that has been applied to the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.twoColorGradient(GradientStyle.Horizontal, 1);
line.setGradientAngle(45);
double angle = line.getGradientAngle();
Use this property to set the direction of a gradient that has been applied to the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.twoColorGradient(GradientStyle.Horizontal, 1);
line.setGradientAngle(45);
value - The angle of the gradient line for the specified line format.Use this property to retrieve the shading intensity that was applied by oneColorGradient(GradientStyle,int,double).
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.oneColorGradient(GradientStyle.DiagonalDown, 2, 0.5);
double degree = line.getGradientDegree();
Use the returned IGradientStops collection to access the gradient stops defined for the line after applying a gradient style.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops gradientStops = line.getGradientStops();
IGradientStop firstStop = gradientStops.get(0);
IGradientStops collection for the line gradient.Use this method to determine how the current gradient is applied to the line, such as horizontal, vertical, or diagonal shading.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.oneColorGradient(GradientStyle.Vertical, 1, 0.5);
GradientStyle style = line.getGradientStyle();
This property indicates which gradient variant is applied to the line when a gradient fill is used.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.oneColorGradient(GradientStyle.Horizontal, 2, 0.5);
int variant = line.getGradientVariant();
This value represents the thickness applied to the line formatting of the shape.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setWeight(2.25);
double weight = line.getWeight();
This value represents the thickness applied to the line formatting of the shape.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.setWeight(2.25);
value - The weight of the line.Use degree to control the gradient intensity from dark to light.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.oneColorGradient(GradientStyle.Horizontal, 2, 0.5);
style - Required GradientStyle. Can be one of the following GradientStyle constants: GradientDiagonalDown, GradientDiagonalUp, GradientFromCenter, GradientFromCorner, GradientFromTitle, Horizontal, or Vertical.variant - Required Integer. The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the line Effects dialog box. If GradientStyle is GradientFromCenter, the Variant argument can only be 1 or 2.degree - Required Single. The gradient degree. Can be a value from 0.0(dark) through 1.0 (light).Use the style and variant parameters to choose one of the built-in two-color gradient patterns for the line. The supported styles are GradientStyle.DiagonalDown, GradientStyle.DiagonalUp, GradientStyle.FromCenter, GradientStyle.FromCorner, GradientStyle.FromTitle, GradientStyle.Horizontal, and GradientStyle.Vertical.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.twoColorGradient(GradientStyle.Horizontal, 1);
style - Required GradientStyle. Can be one of the following GradientStyle constants: GradientDiagonalDown, GradientDiagonalUp, GradientFromCenter, GradientFromCorner, GradientFromTitle, Horizontal, or Vertical.variant - Required Integer. The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the line Effects dialog box. If style is GradientStyle.FromCenter, variant can only be 1 or 2.Use this method to apply one of the predefined gradient combinations to the line. The gradient style controls the direction of the gradient, and the variant selects one of the available preset layouts for that style.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.presetGradient(GradientStyle.Vertical, 4, PresetGradientType.CalmWater);
style - The required GradientStyle. Can be GradientStyle.DiagonalDown, GradientStyle.DiagonalUp, GradientStyle.FromCenter, GradientStyle.FromCorner, GradientStyle.FromTitle, GradientStyle.Horizontal, or GradientStyle.Vertical.variant - The required gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the line Effects dialog box. If style is GradientStyle.FromCenter, this argument can only be 1 or 2.presetGradientType - The required PresetGradientType that specifies the predefined gradient to apply.After calling this method, use getColor() to configure the solid color of the line.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.solid();
line.getColor().setRGB(Color.GetRed());
Use this method to apply a patterned fill to the line by specifying a PatternType.
IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 10, 10, 200, 100);
ILineFormat line = connector.getLine();
line.patterned(PatternType.Percent10);
pattern - The pattern type to apply to the line. Must not be null.