aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/sl/draw/DrawBackground.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/poi/sl/draw/DrawBackground.java')
-rw-r--r--src/java/org/apache/poi/sl/draw/DrawBackground.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/java/org/apache/poi/sl/draw/DrawBackground.java b/src/java/org/apache/poi/sl/draw/DrawBackground.java
index 35c844d8d0..4072fe4bcd 100644
--- a/src/java/org/apache/poi/sl/draw/DrawBackground.java
+++ b/src/java/org/apache/poi/sl/draw/DrawBackground.java
@@ -17,24 +17,28 @@
package org.apache.poi.sl.draw;
-import java.awt.*;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Paint;
import java.awt.geom.Rectangle2D;
-import org.apache.poi.sl.usermodel.*;
-import org.apache.poi.sl.usermodel.Shape;
+import org.apache.poi.sl.usermodel.Background;
+import org.apache.poi.sl.usermodel.PlaceableShape;
+import org.apache.poi.sl.usermodel.ShapeContainer;
-public class DrawBackground<T extends Background> extends DrawShape<T> {
- public DrawBackground(T shape) {
+public class DrawBackground extends DrawShape {
+ public DrawBackground(Background<?,?> shape) {
super(shape);
}
+ @SuppressWarnings("rawtypes")
public void draw(Graphics2D graphics) {
Dimension pg = shape.getSheet().getSlideShow().getPageSize();
final Rectangle2D anchor = new Rectangle2D.Double(0, 0, pg.getWidth(), pg.getHeight());
- PlaceableShape ps = new PlaceableShape(){
- public ShapeContainer<? extends Shape> getParent() { return null; }
+ PlaceableShape<?,?> ps = new PlaceableShape(){
+ public ShapeContainer<?,?> getParent() { return null; }
public Rectangle2D getAnchor() { return anchor; }
public void setAnchor(Rectangle2D anchor) {}
public double getRotation() { return 0; }
@@ -47,7 +51,7 @@ public class DrawBackground<T extends Background> extends DrawShape<T> {
DrawFactory drawFact = DrawFactory.getInstance(graphics);
DrawPaint dp = drawFact.getPaint(ps);
- Paint fill = dp.getPaint(graphics, shape.getFillStyle().getPaint());
+ Paint fill = dp.getPaint(graphics, getShape().getFillStyle().getPaint());
Rectangle2D anchor2 = getAnchor(graphics, anchor);
if(fill != null) {
@@ -56,5 +60,7 @@ public class DrawBackground<T extends Background> extends DrawShape<T> {
}
}
-
+ protected Background<?,?> getShape() {
+ return (Background<?,?>)shape;
+ }
}