FillFormat

Inheritance: java.lang.Object

public class FillFormat

Encapsulates the object that represents fill formatting for a shape.

Example

         //Instantiating a Workbook object
         Workbook workbook = new Workbook();
         //Adding a new worksheet to the Excel object
         int sheetIndex = workbook.getWorksheets().add();
         //Obtaining the reference of the newly added worksheet by passing its sheet index
         Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);
         //Adding a sample value to "A1" cell
         worksheet.getCells().get("A1").putValue(50);
         //Adding a sample value to "A2" cell
         worksheet.getCells().get("A2").putValue(100);
         //Adding a sample value to "A3" cell
         worksheet.getCells().get("A3").putValue(150);
         //Adding a sample value to "A4" cell
         worksheet.getCells().get("A4").putValue(200);
         //Adding a sample value to "B1" cell
         worksheet.getCells().get("B1").putValue(60);
         //Adding a sample value to "B2" cell
         worksheet.getCells().get("B2").putValue(32);
         //Adding a sample value to "B3" cell
         worksheet.getCells().get("B3").putValue(50);
         //Adding a sample value to "B4" cell
         worksheet.getCells().get("B4").putValue(40);
         //Adding a sample value to "C1" cell as category data
         worksheet.getCells().get("C1").putValue("Q1");
         //Adding a sample value to "C2" cell as category data
         worksheet.getCells().get("C2").putValue("Q2");
         //Adding a sample value to "C3" cell as category data
         worksheet.getCells().get("C3").putValue("Y1");
         //Adding a sample value to "C4" cell as category data
         worksheet.getCells().get("C4").putValue("Y2");
         //Adding a chart to the worksheet
         int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5);
         //Accessing the instance of the newly added chart
         Chart chart = worksheet.getCharts().get(chartIndex);
         //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
         int seriesIndex = chart.getNSeries().add("A1:B4", true);
         //Setting the data source for the category data of NSeries
         chart.getNSeries().setCategoryData("C1:C4");
         //Filling the area of the 2nd NSeries with a gradient
         chart.getNSeries().get(seriesIndex).getArea().getFillFormat().setOneColorGradient(Color.getLime(), 1, GradientStyleType.HORIZONTAL, 1);

Methods

MethodDescription
equals(Object obj)
getClass()
getFillType()Gets fill type
getGradientColor1()Returns the gradient color 1 for the specified fill.
getGradientColor2()Returns the gradient color 2 for the specified fill.
getGradientColorType()Returns the gradient color type for the specified fill.
getGradientDegree()Returns the gradient degree for the specified fill.
getGradientFill()Gets getGradientFill() object.
getGradientStyle()Returns the gradient style for the specified fill.
getGradientVariant()Returns the gradient variant for the specified fill.
getImageData()Gets the picture image data.
getPattern()Represents an area’s display pattern.
getPatternFill()Gets getPatternFill() object.
getPictureFormatType()Gets the picture format type.
getPresetColor()Returns the gradient preset color for the specified fill.
getScale()Gets the picture format scale.
getSetType()Gets the fill format set type.
getSolidFill()Gets getSolidFill() object.
getTexture()Represents the texture type for the specified fill.
getTextureFill()Gets getTextureFill() object.
getTransparency()Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
getType()Gets the fill type.
hashCode()Gets the hash code.
notify()
notifyAll()
setFillType(int value)Sets fill type
setImageData(byte[] value)Sets the picture image data.
setOneColorGradient(Color color, double degree, int style, int variant)Sets the specified fill to a one-color gradient.
setPattern(int value)Represents an area’s display pattern.
setPictureFormatType(int value)Sets the picture format type.
setPresetColorGradient(int presetColor, int style, int variant)Sets the specified fill to a preset-color gradient.
setScale(double value)Sets the picture format scale.
setSetType(int value)Gets the fill format set type.
setTexture(int value)Represents the texture type for the specified fill.
setTransparency(double value)Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
setTwoColorGradient(Color color1, Color color2, int style, int variant)Sets the specified fill to a two-color gradient.
setTwoColorGradient(Color color1, double transparency1, Color color2, double transparency2, int style, int variant)Sets the specified fill to a two-color gradient.
setType(int value)Sets the fill type.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object obj)

public boolean equals(Object obj)

Parameters:

ParameterTypeDescription
objjava.lang.Object

Returns: boolean -

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getFillType()

public int getFillType()

Gets fill type

See FillType.

Returns: int

getGradientColor1()

public Color getGradientColor1()

Returns the gradient color 1 for the specified fill.

Returns: Color

getGradientColor2()

public Color getGradientColor2()

Returns the gradient color 2 for the specified fill.

Remarks

Only when the gradient color type is GradientColorType.TwoColors, this property is meaningful.

Returns: Color

getGradientColorType()

public int getGradientColorType()

Returns the gradient color type for the specified fill.

See GradientColorType.

Returns: int

getGradientDegree()

public double getGradientDegree()

Returns the gradient degree for the specified fill. Only applies for Excel 2007.

Remarks

Can only be a value from 0.0 (dark) through 1.0 (light).

Returns: double

getGradientFill()

public GradientFill getGradientFill()

Gets getGradientFill() object.

Returns: GradientFill

getGradientStyle()

public int getGradientStyle()

Returns the gradient style for the specified fill.

See GradientStyleType.

Returns: int

getGradientVariant()

public int getGradientVariant()

Returns the gradient variant for the specified fill. Only applies for Excel 2007.

Remarks

Can only be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

Returns: int

getImageData()

public byte[] getImageData()

Gets the picture image data.

Remarks

If the fill format is not custom texture format, returns null.

Returns: byte[]

getPattern()

public int getPattern()

Represents an area’s display pattern.

See FillPattern.

Returns: int

getPatternFill()

public PatternFill getPatternFill()

Gets getPatternFill() object.

Returns: PatternFill

getPictureFormatType()

public int getPictureFormatType()

Gets the picture format type.

See FillPictureType.

Returns: int

getPresetColor()

public int getPresetColor()

Returns the gradient preset color for the specified fill.

See GradientPresetType.

Returns: int

getScale()

public double getScale()

Gets the picture format scale.

Returns: double

getSetType()

public int getSetType()

Gets the fill format set type.

See FormatSetType.

Remarks

NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getSolidFill()

public SolidFill getSolidFill()

Gets getSolidFill() object.

Returns: SolidFill

getTexture()

public int getTexture()

Represents the texture type for the specified fill.

See TextureType.

Returns: int

getTextureFill()

public TextureFill getTextureFill()

Gets getTextureFill() object.

Returns: TextureFill

getTransparency()

public double getTransparency()

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

Returns: double

getType()

public int getType()

Gets the fill type.

See FillType.

Remarks

NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

hashCode()

public int hashCode()

Gets the hash code.

Returns: int -

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setFillType(int value)

public void setFillType(int value)

Sets fill type

See FillType.

Parameters:

ParameterTypeDescription
valueint

setImageData(byte[] value)

public void setImageData(byte[] value)

Sets the picture image data.

Remarks

If the fill format is not custom texture format, returns null.

Parameters:

ParameterTypeDescription
valuebyte[]

setOneColorGradient(Color color, double degree, int style, int variant)

public void setOneColorGradient(Color color, double degree, int style, int variant)

Sets the specified fill to a one-color gradient. Only applies for Excel 2007.

Parameters:

ParameterTypeDescription
colorColorOne gradient color.
degreedoubleThe gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).
styleintGradientStyleType. Gradient shading style.
variantintThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setPattern(int value)

public void setPattern(int value)

Represents an area’s display pattern.

See FillPattern.

Parameters:

ParameterTypeDescription
valueint

setPictureFormatType(int value)

public void setPictureFormatType(int value)

Sets the picture format type.

See FillPictureType.

Parameters:

ParameterTypeDescription
valueint

setPresetColorGradient(int presetColor, int style, int variant)

public void setPresetColorGradient(int presetColor, int style, int variant)

Sets the specified fill to a preset-color gradient. Only applies for Excel 2007.

Parameters:

ParameterTypeDescription
presetColorintGradientPresetType. Preset color type
styleintGradientStyleType. Gradient shading style.
variantintThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setScale(double value)

public void setScale(double value)

Sets the picture format scale.

Parameters:

ParameterTypeDescription
valuedouble

setSetType(int value)

public void setSetType(int value)

Gets the fill format set type.

See FormatSetType.

Remarks

NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setTexture(int value)

public void setTexture(int value)

Represents the texture type for the specified fill.

See TextureType.

Parameters:

ParameterTypeDescription
valueint

setTransparency(double value)

public void setTransparency(double value)

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

Parameters:

ParameterTypeDescription
valuedouble

setTwoColorGradient(Color color1, Color color2, int style, int variant)

public void setTwoColorGradient(Color color1, Color color2, int style, int variant)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

Parameters:

ParameterTypeDescription
color1ColorOne gradient color.
color2ColorTwo gradient color.
styleintGradientStyleType. Gradient shading style.
variantintThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setTwoColorGradient(Color color1, double transparency1, Color color2, double transparency2, int style, int variant)

public void setTwoColorGradient(Color color1, double transparency1, Color color2, double transparency2, int style, int variant)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

Parameters:

ParameterTypeDescription
color1ColorOne gradient color.
transparency1doubleThe degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).
color2ColorTwo gradient color.
transparency2doubleThe degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).
styleintGradientStyleType. Gradient shading style.
variantintThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setType(int value)

public void setType(int value)

Sets the fill type.

See FillType.

Remarks

NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

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