public class GlowFormat
extends java.lang.Object
Remarks:
Use the ShapeBase.getGlow() property to access glow properties of an object. You do not create instances of the GlowFormat class directly.
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getColor()
Gets a
Color object that represents the color for a glow effect. |
double |
getRadius()
Gets a double value that represents the length of the radius for a glow effect in points (pt).
|
double |
getTransparency()
Gets the degree of transparency for the glow effect as a value between 0.0 (opaque) and 1.0 (clear).
|
void |
remove()
Removes
GlowFormat from the parent object. |
void |
setColor(java.awt.Color value)
Sets a
Color object that represents the color for a glow effect. |
void |
setRadius(double value)
Sets a double value that represents the length of the radius for a glow effect in points (pt).
|
void |
setTransparency(double value)
Sets the degree of transparency for the glow effect as a value between 0.0 (opaque) and 1.0 (clear).
|
public void remove()
GlowFormat from the parent object.
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
public java.awt.Color getColor()
Color object that represents the color for a glow effect. The default value is java.awt.Color#getBlack().
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
Color object that represents the color for a glow effect.public void setColor(java.awt.Color value)
Color object that represents the color for a glow effect. The default value is java.awt.Color#getBlack().
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
value - A Color object that represents the color for a glow effect.public double getTransparency()
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
public void setTransparency(double value)
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
value - The degree of transparency for the glow effect as a value between 0.0 (opaque) and 1.0 (clear).public double getRadius()
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
public void setRadius(double value)
Examples:
Shows how to interact with glow shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply glow effect to the shape.
shape.getGlow().setColor(new Color(0xFFFA8072));
shape.getGlow().setRadius(30.0);
shape.getGlow().setTransparency(0.15);
doc.save(getArtifactsDir() + "Shape.Glow.docx");
doc = new Document(getArtifactsDir() + "Shape.Glow.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check glow effect attributes.
Assert.assertEquals(new Color((250), (128), (114), (217)).getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(30, shape.getGlow().getRadius());
Assert.assertEquals(0.15d, shape.getGlow().getTransparency(), 0.01d);
// Remove glow effect from the shape.
shape.getGlow().remove();
Assert.assertEquals(Color.BLACK.getRGB(), shape.getGlow().getColor().getRGB());
Assert.assertEquals(0, shape.getGlow().getRadius());
Assert.assertEquals(0, shape.getGlow().getTransparency());
value - A double value that represents the length of the radius for a glow effect in points (pt).