Package org.projectforge.gantt

Examples of org.projectforge.gantt.GanttChart


    refresh();
  }

  void export(final String exportFormat)
  {
    final GanttChart ganttChart = createGanttChart();
    if (ganttChart == null) {
      return;
    }
    ImageFormat imageFormat = null;
    final String suffix;
    if (GanttChartEditForm.EXPORT_JPG.equals(exportFormat) == true) {
      suffix = ".jpg";
      imageFormat = ImageFormat.JPEG;
    } else if (GanttChartEditForm.EXPORT_MS_PROJECT_MPX.equals(exportFormat) == true) {
      suffix = ".mpx";
    } else if (GanttChartEditForm.EXPORT_MS_PROJECT_XML.equals(exportFormat) == true) {
      suffix = ".xml";
    } else if (GanttChartEditForm.EXPORT_PDF.equals(exportFormat) == true) {
      suffix = ".pdf";
      imageFormat = ImageFormat.PDF;
    } else if (GanttChartEditForm.EXPORT_PNG.equals(exportFormat) == true) {
      suffix = ".png";
      imageFormat = ImageFormat.PNG;
    } else if (GanttChartEditForm.EXPORT_PROJECTFORGE.equals(exportFormat) == true) {
      suffix = ".xml";
    } else if (GanttChartEditForm.EXPORT_SVG.equals(exportFormat) == true) {
      suffix = ".svg";
      imageFormat = ImageFormat.SVG;
    } else {
      log.error("Oups, exportFormat '" + exportFormat + "' not supported. Assuming png format.");
      suffix = ".png";
      imageFormat = ImageFormat.PNG;
    }
    final String filename = FileHelper.createSafeFilename(getData().getName(), suffix, 50, true);
    final byte[] content;
    if (imageFormat != null) {
      final Document document = ganttChart.create();
      content = BatikImageRenderer.getByteArray(document, ganttChart.getWidth(), imageFormat);
      DownloadUtils.setDownloadTarget(content, filename);
    } else {
      final MimeType type;
      if (GanttChartEditForm.EXPORT_MS_PROJECT_MPX.equals(exportFormat) == true) {
        content = ExportMSProject.exportMpx(ganttChart);
View Full Code Here


  {
    if (ganttChartData == null) {
      return null;
    }
    ganttChartData.getRootObject().sortChildren();
    final GanttChart ganttChart = new GanttChart(ganttChartData.getRootObject(), getGanttChartStyle(), getSettings(), getData().getName());
    // chart.getRootObject().recalculate();
    return ganttChart;
  }
View Full Code Here

    return ganttChart;
  }

  protected void redraw()
  {
    final GanttChart ganttChart = createGanttChart();
    final Component oldGanttImage = ganttImage;
    if (ganttChart != null) {
      final Document document = ganttChart.create();
      if (document != null) {
        ganttImage = new ImagePanel(form.imagePanel.newChildId(), new BatikImage(ImagePanel.IMAGE_ID, document, getGanttChartStyle()
            .getWidth()));
      } else {
        ganttImage = null;
View Full Code Here

TOP

Related Classes of org.projectforge.gantt.GanttChart

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.