Methods Summary |
---|
public void | addRenderingHints(java.util.Map map)
throw new HSLFException("Not implemented");
|
public void | clearRect(int x, int y, int width, int height)
throw new HSLFException("Not implemented");
|
public void | clip(java.awt.Shape shape)
this.clip = transform.createTransformedShape(shape);
//update size of the escher group which holds the drawing
group.setAnchor(clip.getBounds());
|
public void | clipRect(int x, int y, int width, int height)
throw new HSLFException("Not implemented");
|
public void | copyArea(int x, int y, int width, int height, int dx, int dy)
throw new HSLFException("Not implemented");
|
public java.awt.Graphics | create()
throw new HSLFException("Not implemented");
|
public void | dispose()
throw new HSLFException("Not implemented");
|
public void | draw(java.awt.Shape shape)
if(clip != null) {
java.awt.Rectangle bounds = getTransform().createTransformedShape(shape).getBounds();
if (bounds.width == 0) bounds.width = 1;
if (bounds.height == 0) bounds.height = 1;
if (!clip.getBounds().contains(bounds)) {
return;
}
}
PathIterator it = shape.getPathIterator(transform);
double[] prev = null;
double[] coords = new double[6];
double[] first = new double[6];
if(!it.isDone()) it.currentSegment(first); //first point
while(!it.isDone()){
int type = it.currentSegment(coords);
if (prev != null ){
Line line = new Line(group);
if (stroke instanceof BasicStroke){
BasicStroke bs = (BasicStroke)stroke;
line.setLineWidth(bs.getLineWidth());
float[] dash = bs.getDashArray();
if (dash != null) line.setLineDashing(Line.PEN_DASH);
}
if(getColor() != null) line.setLineColor(getColor());
if (type == PathIterator.SEG_LINETO) {
line.setAnchor(new java.awt.Rectangle((int)prev[0], (int)prev[1], (int)(coords[0] - prev[0]), (int)(coords[1] - prev[1])));
} else if (type == PathIterator.SEG_CLOSE){
line.setAnchor(new java.awt.Rectangle((int)coords[0], (int)coords[1], (int)(first[0] - coords[0]), (int)(first[1] - coords[1])));
}
group.addShape(line);
}
prev = new double[]{coords[0], coords[1]};
it.next();
}
|
public void | drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
throw new HSLFException("Not implemented");
|
public void | drawGlyphVector(java.awt.font.GlyphVector g, float x, float y)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
throw new HSLFException("Not implemented");
|
public void | drawImage(java.awt.image.BufferedImage bufferedimage, java.awt.image.BufferedImageOp op, int x, int y)
throw new HSLFException("Not implemented");
|
public boolean | drawImage(java.awt.Image image, java.awt.geom.AffineTransform affinetransform, java.awt.image.ImageObserver imageobserver)
throw new HSLFException("Not implemented");
|
public void | drawLine(int x1, int y1, int x2, int y2)
Line line = new Line();
line.setAnchor(new java.awt.Rectangle(x1, y1, x2-x1, y2-y1));
if (stroke instanceof BasicStroke){
BasicStroke bs = (BasicStroke)stroke;
line.setLineWidth(bs.getLineWidth());
}
if(getColor() != null) line.setLineColor(getColor());
group.addShape(line);
|
public void | drawOval(int x, int y, int width, int height)
AutoShape ellipse = new AutoShape(ShapeTypes.Ellipse);
ellipse.setAnchor(new java.awt.Rectangle(x-width/2, y-height/2, width, height));
if (stroke instanceof BasicStroke){
BasicStroke bs = (BasicStroke)stroke;
ellipse.setLineWidth(bs.getLineWidth());
}
if(getColor() != null) ellipse.setLineColor(getColor());
if (paint instanceof Color){
Color color = (Color)paint;
ellipse.setFillColor(color);
}
group.addShape(ellipse);
|
public void | drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
throw new HSLFException("Not implemented");
|
public void | drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
throw new HSLFException("Not implemented");
|
public void | drawRenderableImage(java.awt.image.renderable.RenderableImage renderableimage, java.awt.geom.AffineTransform affinetransform)
throw new HSLFException("Not implemented");
|
public void | drawRenderedImage(java.awt.image.RenderedImage renderedimage, java.awt.geom.AffineTransform affinetransform)
throw new HSLFException("Not implemented");
|
public void | drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
throw new HSLFException("Not implemented");
|
public void | drawString(java.lang.String string, float x, float y)
TextBox txt = new TextBox(group);
txt.getTextRun().supplySlideShow(group.getSheet().getSlideShow());
txt.getTextRun().setSheet(group.getSheet());
txt.setText(string);
RichTextRun rt = txt.getTextRun().getRichTextRuns()[0];
rt.setFontSize(font.getSize());
rt.setFontName(font.getFamily());
if(getColor() != null) rt.setFontColor(getColor());
if (font.isBold()) rt.setBold(true);
if (font.isItalic()) rt.setItalic(true);
txt.setMarginBottom(0);
txt.setMarginTop(0);
txt.setMarginLeft(0);
txt.setMarginRight(0);
txt.setWordWrap(TextBox.WrapNone);
if (!"".equals(string)) txt.resizeToFitText();
int height = (int)txt.getAnchor().getHeight();
/*
In powerpoint anchor of a shape is its top left corner.
Java graphics sets string coordinates by the baseline of the first character
so we need to shift down by the height of the textbox
*/
txt.moveTo((int)x, (int)(y - height));
if(clip != null) {
if (!clip.getBounds().contains(txt.getAnchor())) {
;//return;
}
}
group.addShape(txt);
|
public void | drawString(java.lang.String str, int x, int y)
throw new HSLFException("Not implemented");
|
public void | drawString(java.text.AttributedCharacterIterator iterator, int x, int y)
throw new HSLFException("Not implemented");
|
public void | drawString(java.text.AttributedCharacterIterator attributedcharacteriterator, float x, float y)
throw new HSLFException("Not implemented");
|
public void | fill(java.awt.Shape shape)
if(clip != null) {
java.awt.Rectangle bounds = getTransform().createTransformedShape(shape).getBounds();
if (bounds.width == 0) bounds.width = 1;
if (bounds.height == 0) bounds.height = 1;
if (!clip.getBounds().contains(bounds)) {
return;
}
}
PathIterator it = shape.getPathIterator(transform);
ArrayList pnt = new ArrayList();
double[] coords = new double[6];
while(!it.isDone()){
int type = it.currentSegment(coords);
if (type != PathIterator.SEG_CLOSE) {
pnt.add(new Point((int)coords[0], (int)coords[1]));
}
it.next();
}
int[] xPoints= new int[pnt.size()];
int[] yPoints= new int[pnt.size()];
for (int i = 0; i < pnt.size(); i++) {
Point p = (Point)pnt.get(i);
xPoints[i] = p.x;
yPoints[i] = p.y;
}
AutoShape r = new AutoShape(ShapeTypes.Rectangle);
if (paint instanceof Color){
Color color = (Color)paint;
r.setFillColor(color);
}
if(getColor() != null) r.setLineColor(getColor());
if (stroke instanceof BasicStroke){
BasicStroke bs = (BasicStroke)stroke;
r.setLineWidth(bs.getLineWidth());
float[] dash = bs.getDashArray();
if (dash != null) r.setLineDashing(Line.PEN_DASH);
}
java.awt.Rectangle bounds = transform.createTransformedShape(shape).getBounds();
r.setAnchor(bounds);
group.addShape(r);
|
public void | fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
throw new HSLFException("Not implemented");
|
public void | fillOval(int x, int y, int width, int height)
throw new HSLFException("Not implemented");
|
public void | fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
throw new HSLFException("Not implemented");
|
public void | fillRect(int x, int y, int width, int height)
throw new HSLFException("Not implemented");
|
public void | fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
throw new HSLFException("Not implemented");
|
public java.awt.Color | getBackground()
throw new HSLFException("Not implemented");
|
public java.awt.Shape | getClip()
return clip;
|
public java.awt.Rectangle | getClipBounds()
throw new HSLFException("Not implemented");
|
public java.awt.Color | getColor()
return foreground;
|
public java.awt.Composite | getComposite()
throw new HSLFException("Not implemented");
|
public java.awt.GraphicsConfiguration | getDeviceConfiguration()
throw new HSLFException("Not implemented");
|
public java.awt.Font | getFont()
return font;
|
public java.awt.FontMetrics | getFontMetrics(java.awt.Font f)
throw new HSLFException("Not implemented");
|
public java.awt.font.FontRenderContext | getFontRenderContext()
return new FontRenderContext(transform, true, true);
|
public java.awt.Paint | getPaint()
return paint;
|
public java.lang.Object | getRenderingHint(java.awt.RenderingHints$Key key)
throw new HSLFException("Not implemented");
|
public java.awt.RenderingHints | getRenderingHints()
throw new HSLFException("Not implemented");
|
public org.apache.poi.hslf.model.ShapeGroup | getShapeGroup()
return group;
|
public java.awt.Stroke | getStroke()
return stroke;
|
public java.awt.geom.AffineTransform | getTransform()
return (AffineTransform)transform.clone();
|
public boolean | hit(java.awt.Rectangle rectangle, java.awt.Shape shape, boolean flag)
throw new HSLFException("Not implemented");
|
public void | rotate(double d)
throw new HSLFException("Not implemented");
|
public void | rotate(double d, double d1, double d2)
throw new HSLFException("Not implemented");
|
public void | scale(double sx, double sy)
AffineTransform at = new AffineTransform();
at.scale(sx, sy);
transform.concatenate(at);
|
public void | setBackground(java.awt.Color c)
throw new HSLFException("Not implemented");
|
public void | setClip(java.awt.Shape clip)
throw new HSLFException("Not implemented");
|
public void | setClip(int x, int y, int width, int height)
throw new HSLFException("Not implemented");
|
public void | setColor(java.awt.Color color)
this.foreground = color;
|
public void | setComposite(java.awt.Composite composite)
throw new HSLFException("Not implemented");
|
public void | setFont(java.awt.Font font)
this.font = font;
|
public void | setPaint(java.awt.Paint paint)
this.paint = paint;
if (paint instanceof Color) setColor((Color)paint);
|
public void | setPaintMode()
throw new HSLFException("Not implemented");
|
public void | setRenderingHint(java.awt.RenderingHints$Key key, java.lang.Object obj)
throw new HSLFException("Not implemented");
|
public void | setRenderingHints(java.util.Map map)
throw new HSLFException("Not implemented");
|
public void | setStroke(java.awt.Stroke s)
this.stroke = s;
|
public void | setTransform(java.awt.geom.AffineTransform trans)
transform = (AffineTransform)trans.clone();
|
public void | setXORMode(java.awt.Color color1)
throw new HSLFException("Not implemented");
|
public void | shear(double d, double d1)
throw new HSLFException("Not implemented");
|
public void | transform(java.awt.geom.AffineTransform affinetransform)
throw new HSLFException("Not implemented");
|
public void | translate(int x, int y)
AffineTransform at = new AffineTransform();
at.translate(x, y);
transform.concatenate(at);
|
public void | translate(double d, double d1)
throw new HSLFException("Not implemented");
|