Line

Inheritance: java.lang.Object

public class Line

Encapsulates the object that represents the line format.

Example

         Workbook workbook = new Workbook();
         	Worksheet sheet = workbook.getWorksheets().get(0);
 
         	Cells cells = sheet.getCells();
         	cells.get(0,1).putValue("Income");
         	cells.get(1,0).putValue("Company A");
         	cells.get(2,0).putValue("Company B");
         	cells.get(3,0).putValue("Company C");
         	cells.get(1,1).putValue(10000);
         	cells.get(2,1).putValue(20000);
         	cells.get(3,1).putValue(30000);
 
         	int chartIndex = sheet.getCharts().add(ChartType.LINE, 9, 9, 21, 15);
         Chart chart = sheet.getCharts().get(chartIndex);
         //Add series
         chart.getNSeries().add("A2:B4", true);
         //Set category data
         chart.getNSeries().setCategoryData("=Sheet1!$A$2:$A$4");
         //Applying a dotted line style on the lines of an NSeries
         chart.getNSeries().get(0).getBorder().setStyle(LineType.DOT);
         chart.getNSeries().get(0).getBorder().setColor(Color.getRed());
         //Applying a triangular marker style on the data markers of an NSeries
         chart.getNSeries().get(0).getMarker().setMarkerStyle(ChartMarkerType.TRIANGLE);
         //Setting the weight of all lines in an NSeries to medium
         chart.getNSeries().get(0).getBorder().setWeight(WeightType.MEDIUM_LINE);

Methods

MethodDescription
equals(Object arg0)
getBeginArrowLength()Specifies the length of the arrowhead for the begin of a line.
getBeginArrowWidth()Specifies the width of the arrowhead for the begin of a line.
getBeginType()Specifies an arrowhead for the begin of a line.
getCapType()Specifies the ending caps.
getClass()
getColor()Represents the Color of the line.
getCompoundType()Specifies the compound line type
getDashType()Specifies the dash line type
getEndArrowLength()Specifies the length of the arrowhead for the end of a line.
getEndArrowWidth()Specifies the width of the arrowhead for the end of a line.
getEndType()Specifies an arrowhead for the end of a line.
getFormattingType()Gets format type.
getGradientFill()Represents gradient fill.
getJoinType()Specifies the joining caps.
getStyle()Represents the style of the line.
getThemeColor()Gets the theme color.
getTransparency()Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
getWeight()Gets the WeightType of the line.
getWeightPt()Gets the weight of the line in unit of points.
getWeightPx()Gets the weight of the line in unit of pixels.
hashCode()
isAuto()Indicates whether this line style is auto assigned.
isAutomaticColor()Indicates whether the color of line is automatic assigned.
isVisible()Represents whether the line is visible.
notify()
notifyAll()
setAuto(boolean value)Indicates whether this line style is auto assigned.
setBeginArrowLength(int value)Specifies the length of the arrowhead for the begin of a line.
setBeginArrowWidth(int value)Specifies the width of the arrowhead for the begin of a line.
setBeginType(int value)Specifies an arrowhead for the begin of a line.
setCapType(int value)Specifies the ending caps.
setColor(Color value)Represents the Color of the line.
setCompoundType(int value)Specifies the compound line type
setDashType(int value)Specifies the dash line type
setEndArrowLength(int value)Specifies the length of the arrowhead for the end of a line.
setEndArrowWidth(int value)Specifies the width of the arrowhead for the end of a line.
setEndType(int value)Specifies an arrowhead for the end of a line.
setFormattingType(int value)Sets format type.
setJoinType(int value)Specifies the joining caps.
setStyle(int value)Represents the style of the line.
setThemeColor(ThemeColor value)Sets the theme color.
setTransparency(double value)Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
setVisible(boolean value)Represents whether the line is visible.
setWeight(int value)Sets the WeightType of the line.
setWeightPt(double value)Sets the weight of the line in unit of points.
setWeightPx(double value)Sets the weight of the line in unit of pixels.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getBeginArrowLength()

public int getBeginArrowLength()

Specifies the length of the arrowhead for the begin of a line.

See MsoArrowheadLength.

Returns: int

getBeginArrowWidth()

public int getBeginArrowWidth()

Specifies the width of the arrowhead for the begin of a line.

See MsoArrowheadWidth.

Returns: int

getBeginType()

public int getBeginType()

Specifies an arrowhead for the begin of a line.

See MsoArrowheadStyle.

Returns: int

getCapType()

public int getCapType()

Specifies the ending caps.

See LineCapType.

Returns: int

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor()

public Color getColor()

Represents the Color of the line.

Returns: Color

getCompoundType()

public int getCompoundType()

Specifies the compound line type

See MsoLineStyle.

Returns: int

getDashType()

public int getDashType()

Specifies the dash line type

See MsoLineDashStyle.

Returns: int

getEndArrowLength()

public int getEndArrowLength()

Specifies the length of the arrowhead for the end of a line.

See MsoArrowheadLength.

Returns: int

getEndArrowWidth()

public int getEndArrowWidth()

Specifies the width of the arrowhead for the end of a line.

See MsoArrowheadWidth.

Returns: int

getEndType()

public int getEndType()

Specifies an arrowhead for the end of a line.

See MsoArrowheadStyle.

Returns: int

getFormattingType()

public int getFormattingType()

Gets format type.

See ChartLineFormattingType.

Returns: int

getGradientFill()

public GradientFill getGradientFill()

Represents gradient fill.

Returns: GradientFill

getJoinType()

public int getJoinType()

Specifies the joining caps.

See LineJoinType.

Returns: int

getStyle()

public int getStyle()

Represents the style of the line.

See LineType.

Returns: int

getThemeColor()

public ThemeColor getThemeColor()

Gets the theme color.

Remarks

If the foreground color is not a theme color, NULL will be returned.

Returns: ThemeColor

getTransparency()

public double getTransparency()

Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).

Returns: double

getWeight()

public int getWeight()

Gets the WeightType of the line.

See WeightType.

Returns: int

getWeightPt()

public double getWeightPt()

Gets the weight of the line in unit of points.

Returns: double

getWeightPx()

public double getWeightPx()

Gets the weight of the line in unit of pixels.

Returns: double

hashCode()

public native int hashCode()

Returns: int

isAuto()

public boolean isAuto()

Indicates whether this line style is auto assigned.

Returns: boolean

isAutomaticColor()

public boolean isAutomaticColor()

Indicates whether the color of line is automatic assigned.

Returns: boolean

isVisible()

public boolean isVisible()

Represents whether the line is visible.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAuto(boolean value)

public void setAuto(boolean value)

Indicates whether this line style is auto assigned.

Parameters:

ParameterTypeDescription
valueboolean

setBeginArrowLength(int value)

public void setBeginArrowLength(int value)

Specifies the length of the arrowhead for the begin of a line.

See MsoArrowheadLength.

Parameters:

ParameterTypeDescription
valueint

setBeginArrowWidth(int value)

public void setBeginArrowWidth(int value)

Specifies the width of the arrowhead for the begin of a line.

See MsoArrowheadWidth.

Parameters:

ParameterTypeDescription
valueint

setBeginType(int value)

public void setBeginType(int value)

Specifies an arrowhead for the begin of a line.

See MsoArrowheadStyle.

Parameters:

ParameterTypeDescription
valueint

setCapType(int value)

public void setCapType(int value)

Specifies the ending caps.

See LineCapType.

Parameters:

ParameterTypeDescription
valueint

setColor(Color value)

public void setColor(Color value)

Represents the Color of the line.

Parameters:

ParameterTypeDescription
valueColor

setCompoundType(int value)

public void setCompoundType(int value)

Specifies the compound line type

See MsoLineStyle.

Parameters:

ParameterTypeDescription
valueint

setDashType(int value)

public void setDashType(int value)

Specifies the dash line type

See MsoLineDashStyle.

Parameters:

ParameterTypeDescription
valueint

setEndArrowLength(int value)

public void setEndArrowLength(int value)

Specifies the length of the arrowhead for the end of a line.

See MsoArrowheadLength.

Parameters:

ParameterTypeDescription
valueint

setEndArrowWidth(int value)

public void setEndArrowWidth(int value)

Specifies the width of the arrowhead for the end of a line.

See MsoArrowheadWidth.

Parameters:

ParameterTypeDescription
valueint

setEndType(int value)

public void setEndType(int value)

Specifies an arrowhead for the end of a line.

See MsoArrowheadStyle.

Parameters:

ParameterTypeDescription
valueint

setFormattingType(int value)

public void setFormattingType(int value)

Sets format type.

See ChartLineFormattingType.

Parameters:

ParameterTypeDescription
valueint

setJoinType(int value)

public void setJoinType(int value)

Specifies the joining caps.

See LineJoinType.

Parameters:

ParameterTypeDescription
valueint

setStyle(int value)

public void setStyle(int value)

Represents the style of the line.

See LineType.

Parameters:

ParameterTypeDescription
valueint

setThemeColor(ThemeColor value)

public void setThemeColor(ThemeColor value)

Sets the theme color.

Remarks

If the foreground color is not a theme color, NULL will be returned.

Parameters:

ParameterTypeDescription
valueThemeColor

setTransparency(double value)

public void setTransparency(double value)

Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).

Parameters:

ParameterTypeDescription
valuedouble

setVisible(boolean value)

public void setVisible(boolean value)

Represents whether the line is visible.

Parameters:

ParameterTypeDescription
valueboolean

setWeight(int value)

public void setWeight(int value)

Sets the WeightType of the line.

See WeightType.

Parameters:

ParameterTypeDescription
valueint

setWeightPt(double value)

public void setWeightPt(double value)

Sets the weight of the line in unit of points.

Parameters:

ParameterTypeDescription
valuedouble

setWeightPx(double value)

public void setWeightPx(double value)

Sets the weight of the line in unit of pixels.

Parameters:

ParameterTypeDescription
valuedouble

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int