Support for Reflection, Shadow, Glow & 3D Effects for Shapes and Built-in Styles for WordArt with Aspose.Cells for Java 16.10.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Cells for JavaWe are pleased to announce the release of Aspose.Cells for Java 16.10.0. This release includes many new features and enhancements along with some critical bug fixes that further improve the overall stability of the API. Please check the detailed release notes in order to get an idea about what is new and what has been fixed with this revision of Aspose.Cells for Java. If you are planning to upgrade the API from any previous version, we strongly suggest you to check the Public API Changes section to know what has been changed since your current revision of the API.

While you are downloading the latest build, here is a look at the biggest features in this release.

Support for Reflection Effects

Aspose.Cells for Java 16.10.0 has added the support for reflection effects for a Shape object as Excel provides it via Effects tab under Format Shape dialog as shown below.

In order to provide the said feature, Aspose.Cells for Java 16.10.0 has exposed the ReflectionEffect class along with Shape.Reflection property which together controls the reflection effects of a Shape object.

Here is a simple usage scenario of newly exposed APIs to apply reflection on an existing shape, whereas a detailed article can be viewed on Working with Reflection Effects for Shapes.

//Load a sample spreadsheet containing a shape
//Alternatively create a new spreadsheet and add a shape
Workbook book = new Workbook("sample.xlsx");

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Access first shape from the collection
Shape shape = sheet.getShapes().get(0);

//Get the instance of ReflectionEffect from the Shape object
ReflectionEffect reflection = shape.getReflection();
//Set its Blur, Size, Transparency and Distance properties
reflection.setBlur(30);
reflection.setSize(90);
reflection.setTransparency(0.5);
reflection.setDistance(80);

//Save the result in XLSX format
book.save("output.xlsx");

Support for Shadow Effects

Aspose.Cells for Java 16.10.0 has added the support for Shadow Effects for a Shape object as Excel provides it via Effects tab under Format Shape dialog as shown below.

Aspose.Cells for Java 16.10.0 has exposed the Shape.ShadowEffect property along with ShadowEffect class which together allows to set the shadow effect on a Shape object.

Here is a simple usage scenario of newly exposed APIs to apply shadow on an existing shape, whereas a detailed article can be viewed on Working with Shadow Effects for Shapes.

//Load a sample spreadsheet containing a shape
//Alternatively create a new spreadsheet and add a shape
Workbook book = new Workbook("sample.xlsx");

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Access first shape from the collection
Shape shape = sheet.getShapes().get(0);

//Get the instance of ShadowEffect from the Shape object
ShadowEffect shadow = shape.getShadowEffect();
//Set its Angle, Blur, Size, Transparency and Distance properties
shadow.setAngle(150);
shadow.setBlur(30);
shadow.setSize(90);
shadow.setTransparency(0.5);
shadow.setDistance(80);

//Save the result in XLSX format
book.save("output.xlsx");

Support for Glow Effects

Aspose.Cells for Java now supports the Glow Effects for a Shape object as Excel provides it via Effects tab under Format Shape dialog as shown below.

Aspose.Cells for Java 16.10.0 has exposed the Shape.Glow property along with GlowEffect class which together allows to set the glow effect on a Shape object.

Here is a simple usage scenario of newly exposed APIs to apply glow effect on an existing shape, whereas a detailed article can be viewed on Working with Glow Effects for Shapes.

//Load a sample spreadsheet containing a shape
//Alternatively create a new spreadsheet and add a shape
Workbook book = new Workbook("sample.xlsx");

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Access first shape from the collection
Shape shape = sheet.getShapes().get(0);

//Get the instance of GlowEffect from the Shape object
GlowEffect glow = shape.getGlow();
//Set its Size & Transparency properties
glow.setSize(90);
glow.setTransparency(0.5);

//Save the result in XLSX format
book.save("output.xlsx");

Support for 3-D Formats

Aspose.Cells for Java supports the 3-D Formats for Shape objects as Excel provides it via Effects tab under Format Shape dialog as shown below.

Aspose.Cells for Java 16.10.0 has exposed the Shape.ThreeDFormat property along with ThreeDFormat class which together allows to set the 3D formatting for a Shape object.

Here is a simple usage scenario of newly exposed APIs to apply 3D formatting on an existing shape, whereas a detailed article can be viewed on Working with 3-D Formats for Shapes.

//Load a sample spreadsheet containing a shape
//Alternatively create a new spreadsheet and add a shape
Workbook book = new Workbook("sample.xlsx");

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Access first shape from the collection
Shape shape = sheet.getShapes().get(0);

//Get the instance of ThreeDFormat from the Shape object
ThreeDFormat threeD = shape.getThreeDFormat();
//Set its ContourWidth & ExtrusionHeight properties
threeD.setContourWidth(15);
threeD.setExtrusionHeight(30);

//Save the result in XLSX format
book.save("output.xlsx");

Support for WordArt Built-in Styles

Aspose.Cells for Java APIs now support to add WordArt objects with built-in styles. In order to provide this feature, the Aspose.Cells for Java APIs have exposed the ShapeCollection.AddWordArt method along with PresetWordArtStyle enumeration which together allows to add preset WordArt objects since Excel 2007.

Here is a simple usage scenario of newly exposed APIs to add WordArt with build-in styles, whereas a detailed article can be viewed on Working with Built-in Styles for WordArt.

//Create an instance of Workbook
Workbook book = new Workbook();

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Access ShapeCollection of first worksheet
ShapeCollection shapes = sheet.getShapes();

//Add WordArt with built-in styles
shapes.addWordArt(PresetWordArtStyle.WORD_ART_STYLE_1, "Aspose File Format APIs", 00, 0, 0, 0, 100, 800);
shapes.addWordArt(PresetWordArtStyle.WORD_ART_STYLE_2, "Aspose File Format APIs", 10, 0, 0, 0, 100, 800);
shapes.addWordArt(PresetWordArtStyle.WORD_ART_STYLE_3, "Aspose File Format APIs", 20, 0, 0, 0, 100, 800);
shapes.addWordArt(PresetWordArtStyle.WORD_ART_STYLE_4, "Aspose File Format APIs", 30, 0, 0, 0, 100, 800);
shapes.addWordArt(PresetWordArtStyle.WORD_ART_STYLE_5, "Aspose File Format APIs", 40, 0, 0, 0, 100, 800);

//Save the result in XLSX format
book.save("output.xlsx");

Automatic Propagation of Formula in ListObject

Microsoft Excel application allows the automatic proprgation of formulas when new rows are inserted to a ListObject/Table. Aspose.Cells now provides the same feature by exposing the ListColumn.Formula property with this release

Here is a simple usage scenario of ListColumn.Formula property, whereas a detailed article can be viewed on Automatically Propagate Formula in ListObject.

//Create an instance of Workbook
Workbook book = new Workbook();

//Access first worksheet from the collection
Worksheet sheet = book.getWorksheets().get(0);

//Add column headings in cell A1 and B1
sheet.getCells().get(0, 0).putValue("Column A");
sheet.getCells().get(0, 1).putValue("Column B");

//Add list object, set its name and style
ListObject listObject = sheet.getListObjects().get(sheet.getListObjects().add(0, 0, 1, sheet.getCells().getMaxColumn(), true));
listObject.setTableStyleType(TableStyleType.TABLE_STYLE_MEDIUM_14);
listObject.setDisplayName("Table");

//Set the formula of second column so that it could automatically propagate to new rows while entering data
listObject.getListColumns().get(1).setFormula("=[Column A] + 1");

//Save the result in XLSX format
book.save("output.xlsx");

Other Enhancements & Fixes

Aspose.Cells for Java 16.10.0 has fixed a few critical bugs as well as enhanced its core for more stability. A few of the worth mentioning enhancements are as follow.

Aspose.Cells for Java Resources

The resources, you may need to accomplish your tasks: