EN · DE · RU · FR · ES

#456: GanttChart.java

projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java Java-Klasse, projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java 615 Zeilen · 501 Code · 58 Kommentare · 56 leer
Zweck: Quelldatei: projectforge/business/gantt/GanttChart.java. GanttChart.java ist Teil der Open-Source-Projektmanagement-Anwendung ProjectForge.

Quellcode (erste 100 Zeilen)

/////////////////////////////////////////////////////////////////////////////
//
// Project ProjectForge Community Edition
//         www.projectforge.org
//
// Copyright (C) 2001-2026 Micromata GmbH, Deutschland (www.micromata.com)
//
// ProjectForge ist dual-lizenziert.
//
// Diese Community-Edition ist freie Software; Sie können es weiterverteilen und/oder
// modifizieren unter den Bedingungen der GNU General Public License, wie veröffentlicht
// von der Free Software Foundation; Version 3 der Lizenz.
//
// Diese Community-Edition wird in der Hoffnung verteilt, dass sie nützlich sein wird,
// aber OHNE JEGLICHE GEWÄHRLEISTUNG; ohne die stillschweigende Garantie der
// MARKTGÄNGIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. Siehe die GNU General
// Public License für weitere Details.
//
// Sie sollten eine Kopie der GNU General Public License zusammen mit
// diesem Programm erhalten haben; falls nicht, siehe http://www.gnu.org/licenses/.
//
/////////////////////////////////////////////////////////////////////////////

package org.projectforge.business.gantt;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.projectforge.export.SVGColor;
import org.projectforge.export.SVGHelper;
import org.projectforge.export.SVGHelper.ArrowDirection;
import org.projectforge.framework.time.PFDay;
import org.projectforge.framework.time.PFDayUtils;
import org.projectforge.framework.xmlstream.XmlObject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

@XmlObject(alias = "ganttChart")
public class GanttChart {
  private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(GanttChart.class);

  @SuppressWarnings("unused")
  private String name;

  private GanttChartStyle style;

  private GanttChartSettings settings;

  private LocalDate fromDate;

  private LocalDate toDate;

  private transient LocalDate calculatedStartDate;

  private transient LocalDate calculatedEndDate;

  private transient int fromToDays = -1;

  private transient double height;

  private GanttTask rootNode;

  private transient String fontFamily = "Helvetica";

  private transient Map<GanttTask, ObjectInfo> objectMap = new HashMap<>();

  private class ObjectInfo {
    final LocalDate fromDate;

    final LocalDate toDate;

    final double x1;

    final double x2;

    final int row;

    final double y;

    ObjectInfo(final GanttTask node, final int row) {
      this.fromDate = GanttUtils.getCalculatedStartDate(node);
      this.toDate = GanttUtils.getCalculatedEndDate(node);
      if (fromDate != null) {
        this.x1 = getXValue(fromDate);
      } else {
        x1 = 0;
      }
      if (toDate != null) {
        this.x2 = getXValue(toDate);
      } else {
        x2 = 0;
      }
      this.row = row;
      this.y = style.getYScale() * row;
    }

Git-Verlauf

868d6abb7 2025 -> 2026
63081666f Kopfzeilen der Quelldateien: 2024 -> 2025.
5f9bbfbd3 Korrigiere Tippfehler im Verzeichnis projectforge-business
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.

868d6abb7

2025 -> 2026
868d6abb75cd191a892911ac8e45058932cf9074
diff --git a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
index 40a3f4b75..f607e2cb3 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2025 Micromata GmbH, Deutschland (www.micromata.com)
+// Copyright (C) 2001-2026 Micromata GmbH, Deutschland (www.micromata.com)
 //
 // ProjectForge ist dual-lizenziert.
 //

63081666f

Kopfzeilen der Quelldateien: 2024 -> 2025.
63081666f620fb87315f01b817e560e0b2f6a33a
diff --git a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
index 5a8f837ad..40a3f4b75 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2024 Micromata GmbH, Deutschland (www.micromata.com)
+// Copyright (C) 2001-2025 Micromata GmbH, Deutschland (www.micromata.com)
 //
 // ProjectForge ist dual-lizenziert.
 //

5f9bbfbd3

Korrigiere Tippfehler im Verzeichnis projectforge-business
5f9bbfbd372a85f39c89de392a8565c5370a95cb
diff --git a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
index 5cc0ed701..5a8f837ad 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
@@ -282,7 +282,7 @@ public class GanttChart {
     g2.appendChild(g3);
     // diagram.appendChild(SVGHelper.createUse(doc, "#diamond", 100, 15.5 * style.getYScale()));
     // diagram.appendChild(SVGHelper.createRect(doc, 110, 15 * style.getYScale() + 2, 140, 16, "white"));
-    // diagram.appendChild(SVGHelper.createText(doc, 110, 15.5 * style.getYScale() + 5, "This is a nonsens milestone.", "fill", "gray",
+    // diagram.appendChild(SVGHelper.createText(doc, 110, 15.5 * style.getYScale() + 5, "This is a nonsense milestone.", "fill", "gray",
     // "font-size", "8pt"));
 
     g1 = SVGHelper.createElement(doc, "g", "transform", "translate(265,65)");

b6092df09

Copyright 2023 -> 2024
b6092df0927c4a3b161e888445f31dcab57493f2
diff --git a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
index dcf52a28d..5cc0ed701 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2023 Micromata GmbH, Deutschland (www.micromata.com)
+// Copyright (C) 2001-2024 Micromata GmbH, Deutschland (www.micromata.com)
 //
 // ProjectForge ist dual-lizenziert.
 //

ab45d51fa

Copyright 2001-2022 -> 2001-2023.
ab45d51fa419ede6174b31d69987f96d4b841ff9
diff --git a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
index 972cf0852..dcf52a28d 100644
--- a/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
+++ b/projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java
@@ -3,7 +3,7 @@
 // Project ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2022 Micromata GmbH, Deutschland (www.micromata.com)
+// Copyright (C) 2001-2023 Micromata GmbH, Deutschland (www.micromata.com)
 //
 // ProjectForge ist dual-lizenziert.
 //