mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 02:49:06 +00:00
fix: improve minor issues in Gantt
This commit is contained in:
parent
55598085f5
commit
870d09d272
@ -662,7 +662,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
|
||||
return colorSet;
|
||||
}
|
||||
|
||||
public void setStartingDate(Day start) {
|
||||
public void setProjectStartingDate(Day start) {
|
||||
openClose.setStartingDay(start);
|
||||
this.min = start;
|
||||
}
|
||||
|
@ -50,11 +50,11 @@ public class SentenceTaskEndsAbsolute extends SentenceSimple {
|
||||
public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) {
|
||||
final Task task = (Task) subject;
|
||||
final Day end = (Day) complement;
|
||||
// final Day startingDate = project.getStartingDate();
|
||||
// if (startingDate == null) {
|
||||
// return CommandExecutionResult.error("No starting date for the project");
|
||||
// }
|
||||
final Day startingDate = project.getStartingDate();
|
||||
if (startingDate.getAbsoluteDayNum() == 0)
|
||||
return CommandExecutionResult.error("No starting date for the project");
|
||||
task.setEnd(end);
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,10 @@ public class SentenceTaskStarts extends SentenceSimple {
|
||||
HColor color = null;
|
||||
when = (TaskInstant) complement;
|
||||
task.setStart(when.getInstantPrecise());
|
||||
if (when.isTask()) {
|
||||
if (when.isTask())
|
||||
project.addContraint(new GanttConstraint(project.getIHtmlColorSet(), project.getCurrentStyleBuilder(), when,
|
||||
new TaskInstant(task, TaskAttribute.START), color));
|
||||
}
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
|
||||
};
|
||||
|
@ -50,10 +50,10 @@ public class SentenceTaskStartsAbsolute extends SentenceSimple {
|
||||
public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) {
|
||||
final Task task = (Task) subject;
|
||||
final Day start = (Day) complement;
|
||||
// final Day startingDate = project.getStartingDate();
|
||||
// if (startingDate == null) {
|
||||
// return CommandExecutionResult.error("No starting date for the project");
|
||||
// }
|
||||
final Day startingDate = project.getStartingDate();
|
||||
if (startingDate.getAbsoluteDayNum() == 0)
|
||||
project.setProjectStartingDate(start);
|
||||
|
||||
task.setStart(start);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class SubjectProject implements Subject {
|
||||
public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) {
|
||||
final Day start = (Day) complement;
|
||||
assert project == subject;
|
||||
project.setStartingDate(start);
|
||||
project.setProjectStartingDate(start);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user