Search in sources :

Example 1 with Dimension

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);
}
Also used : PPGraphics2D(org.apache.poi.hslf.model.PPGraphics2D) ChartRendererJC(org.activityinfo.server.report.renderer.ChartRendererJC) Slide(org.apache.poi.hslf.model.Slide) Rectangle(com.google.code.appengine.awt.Rectangle) Dimension(com.google.code.appengine.awt.Dimension) Point(com.google.code.appengine.awt.Point) ShapeGroup(org.apache.poi.hslf.model.ShapeGroup) PPGraphics2D(org.apache.poi.hslf.model.PPGraphics2D) Graphics2D(com.google.code.appengine.awt.Graphics2D)

Example 2 with Dimension

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);
}
Also used : SlideShow(org.apache.poi.hslf.usermodel.SlideShow) Dimension(com.google.code.appengine.awt.Dimension)

Example 3 with Dimension

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);
            }
        }
    }
}
Also used : MapMarker(org.activityinfo.shared.report.content.MapMarker) IconMapMarker(org.activityinfo.shared.report.content.IconMapMarker) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) Slide(org.apache.poi.hslf.model.Slide) HashMap(java.util.HashMap) IconMapMarker(org.activityinfo.shared.report.content.IconMapMarker) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) Dimension(com.google.code.appengine.awt.Dimension)

Example 4 with Dimension

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);
}
Also used : SlideShow(org.apache.poi.hslf.usermodel.SlideShow) Dimension(com.google.code.appengine.awt.Dimension)

Aggregations

Dimension (com.google.code.appengine.awt.Dimension)4 Slide (org.apache.poi.hslf.model.Slide)2 SlideShow (org.apache.poi.hslf.usermodel.SlideShow)2 Graphics2D (com.google.code.appengine.awt.Graphics2D)1 Point (com.google.code.appengine.awt.Point)1 Rectangle (com.google.code.appengine.awt.Rectangle)1 HashMap (java.util.HashMap)1 ChartRendererJC (org.activityinfo.server.report.renderer.ChartRendererJC)1 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)1 IconMapMarker (org.activityinfo.shared.report.content.IconMapMarker)1 MapMarker (org.activityinfo.shared.report.content.MapMarker)1 PPGraphics2D (org.apache.poi.hslf.model.PPGraphics2D)1 ShapeGroup (org.apache.poi.hslf.model.ShapeGroup)1