EN · DE · RU · FR · ES

#456 : GanttChart.java

projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java Classe Java, projectforge-business/src/main/java/org/projectforge/business/gantt/GanttChart.java 615 lignes · 501 code · 58 commentaires · 56 vides
Objectif : Fichier source : projectforge/business/gantt/GanttChart.java. GanttChart.java fait partie de l'application open-source de gestion de projet ProjectForge.

Source (100 premières lignes)

/////////////////////////////////////////////////////////////////////////////
//
// Projet ProjectForge Community Edition
//         www.projectforge.org
//
// Copyright (C) 2001-2026 Micromata GmbH, Allemagne (www.micromata.com)
//
// ProjectForge est sous double licence.
//
// Cette édition communautaire est un logiciel libre ; vous pouvez la redistribuer et/ou
// la modifier selon les termes de la GNU General Public License telle que publiée
// par la Free Software Foundation ; version 3 de la Licence.
//
// Cette édition communautaire est distribuée dans l'espoir qu'elle sera utile,
// mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de
// COMMERCIALISATION ou D'ADÉQUATION À UN USAGE PARTICULIER. Voir la GNU General
// Public License pour plus de détails.
//
// Vous devriez avoir reçu une copie de la GNU General Public License avec
// ce programme ; sinon, consultez 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;
    }

Historique Git

868d6abb7 2025 -> 2026
63081666f En-têtes des fichiers source : 2024 -> 2025.
5f9bbfbd3 Correction de fautes de frappe dans le répertoire 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 @@
 // Projet ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2025 Micromata GmbH, Allemagne (www.micromata.com)
+// Copyright (C) 2001-2026 Micromata GmbH, Allemagne (www.micromata.com)
 //
 // ProjectForge est sous double licence.
 //

63081666f

En-têtes des fichiers source : 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 @@
 // Projet ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2024 Micromata GmbH, Allemagne (www.micromata.com)
+// Copyright (C) 2001-2025 Micromata GmbH, Allemagne (www.micromata.com)
 //
 // ProjectForge est sous double licence.
 //

5f9bbfbd3

Correction de fautes de frappe dans le répertoire 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, "Ceci est un jalon insensé.", "fill", "gray",
+    // diagram.appendChild(SVGHelper.createText(doc, 110, 15.5 * style.getYScale() + 5, "Ceci est un jalon insensé.", "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 @@
 // Projet ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2023 Micromata GmbH, Allemagne (www.micromata.com)
+// Copyright (C) 2001-2024 Micromata GmbH, Allemagne (www.micromata.com)
 //
 // ProjectForge est sous double licence.
 //

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 @@
 // Projet ProjectForge Community Edition
 //         www.projectforge.org
 //
-// Copyright (C) 2001-2022 Micromata GmbH, Allemagne (www.micromata.com)
+// Copyright (C) 2001-2023 Micromata GmbH, Allemagne (www.micromata.com)
 //
 // ProjectForge est sous double licence.
 //