use of com.google.code.appengine.awt.Dimension in project activityinfo by bedatadriven.
the class PPTChartRenderer method render.
public void render(PivotChartReportElement element, SlideShow ppt) throws IOException {
// add first slide
Slide slide = ppt.createSlide();
// define position of the drawing in the slide
Dimension pageSize = ppt.getPageSize();
Dimension chartSize = new Dimension((int) (pageSize.getWidth() - 72), (int) (pageSize.getHeight() - 183));
Rectangle bounds = new com.google.code.appengine.awt.Rectangle(new Point(36, 126), chartSize);
ShapeGroup group = new ShapeGroup();
group.setAnchor(bounds);
slide.addShape(group);
Graphics2D graphics = new PPGraphics2D(group);
ChartRendererJC jc = new ChartRendererJC();
jc.render(element, false, graphics, (int) chartSize.getWidth(), (int) chartSize.getHeight(), 72);
}
use of com.google.code.appengine.awt.Dimension in project activityinfo by bedatadriven.
the class PPTMapRenderer method render.
@Override
public void render(MapReportElement element, OutputStream stream) throws IOException {
// create a new empty slide show
SlideShow ppt = new SlideShow();
Dimension pageSize = computePageSize(element);
ppt.setPageSize(pageSize);
render(element, ppt);
// write to stream
ppt.write(stream);
}
use of com.google.code.appengine.awt.Dimension in project activityinfo by bedatadriven.
the class PPTMapRenderer method render.
public void render(MapReportElement element, SlideShow ppt) throws IOException {
// add first slide
Slide slide = ppt.createSlide();
// calculate map offset
Dimension pageSize = ppt.getPageSize();
int offsetX = ((int) pageSize.getWidth() - element.getWidth()) / 2;
int offsetY = ((int) pageSize.getHeight() - element.getHeight()) / 2;
// add the map background image
drawBasemap(element, new PPTTileHandler(ppt, slide));
// keep a list of map icons
Map<String, Integer> iconPictureIndex = new HashMap<String, Integer>();
// Add the indicator markers to the slide as shapes
for (MapMarker marker : element.getContent().getMarkers()) {
if (inView(element, marker)) {
if (marker instanceof IconMapMarker) {
addIconMarker(ppt, slide, offsetX, offsetY, iconPictureIndex, (IconMapMarker) marker);
} else if (marker instanceof BubbleMapMarker) {
addBubble(slide, offsetX, offsetY, (BubbleMapMarker) marker);
}
}
}
}
use of com.google.code.appengine.awt.Dimension in project activityinfo by bedatadriven.
the class PPTChartRenderer method render.
public void render(PivotChartReportElement element, OutputStream stream) throws IOException {
// create a new empty slide show
SlideShow ppt = new SlideShow();
// Onscreen Show (4:5)
Dimension pageSize = new Dimension(720, 540);
ppt.setPageSize(pageSize);
render(element, ppt);
// write to stream
ppt.write(stream);
}
Aggregations