Package org.eclipse.birt.chart.model.attribute

Examples of org.eclipse.birt.chart.model.attribute.Bounds


      // fill default backgournd as white.
      gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
      gc.fillRectangle(buffer.getBounds());

      final Bounds bo = BoundsImpl.create(X_OFFSET, Y_OFFSET, adjustedRe.width - 2 * X_OFFSET, adjustedRe.height - 2 * Y_OFFSET);

      IDeviceRenderer deviceRenderer = null;
      try {
        deviceRenderer = PluginSettings.instance().getDevice("dv.SWT"); //$NON-NLS-1$
        deviceRenderer.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, gc);
        bo.scale(72d / deviceRenderer.getDisplayServer().getDpiResolution()); // CONVERT
        // TO
        // POINTS

        // GENERATE AND RENDER THE CHART
        final Generator gr = Generator.instance();
View Full Code Here


    } catch (ChartException pex) {
      pex.printStackTrace();
    }
    
    // define the bounds in points
    Bounds bo = BoundsImpl.create(0, 0, 800, 600); // in points
    // build the rendered chart structure
    Generator gr = Generator.instance();
    GeneratedChartState gcs = null;
    
    try {
        gcs = gr.build(idr.getDisplayServer(), cm, bo, null);
    } catch (ChartException gex) {
      gex.printStackTrace();   
    }
    
    // render the chart to a png file
    java.awt.Image img = new BufferedImage(
            (int) bo.getWidth(), (int) bo.getHeight(), BufferedImage.TYPE_INT_ARGB
    );
    try {
      idr.setProperty(IDeviceRenderer.FILE_IDENTIFIER, file.getRawLocation().toOSString());
      try {
        gr.render(idr, gcs);
View Full Code Here

TOP

Related Classes of org.eclipse.birt.chart.model.attribute.Bounds

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.