ItEr37S16RFMaquetacionDesenhoAplicacionItEr36S18: Graphical support for project deadline representaton in order scheduling view
* Pending interface implementation of calls to markDeadlineDay() * Representation of current day and deadline on the same watermark column depends on CSS3 multiple background images support.
This commit is contained in:
parent
41f5bd56be
commit
70b3e4f5ca
4 changed files with 77 additions and 20 deletions
|
|
@ -39,14 +39,12 @@ public final class DetailItem {
|
|||
private boolean currentPeriod;
|
||||
private int currentDayOffset;
|
||||
|
||||
private boolean deadlinePeriod;
|
||||
private int deadlineOffset;
|
||||
|
||||
private DateTime startDate;
|
||||
|
||||
private DateTime endDate;
|
||||
|
||||
public DetailItem(int size, String name) {
|
||||
this(size, name, false);
|
||||
}
|
||||
|
||||
public DetailItem(int size, String name, DateTime startDate,
|
||||
DateTime endDate) {
|
||||
this(size, name, false);
|
||||
|
|
@ -55,16 +53,8 @@ public final class DetailItem {
|
|||
this.markCurrentDay();
|
||||
}
|
||||
|
||||
public void markCurrentDay() {
|
||||
if (this.startDate.isBeforeNow() && this.endDate.isAfterNow()) {
|
||||
int offsetInPx = Math
|
||||
.round((((float) Days.daysBetween(this.startDate,
|
||||
new DateTime()).getDays()) / ((float) Days
|
||||
.daysBetween(this.startDate, this.endDate)
|
||||
.getDays()))
|
||||
* this.size);
|
||||
this.markCurrentDay(offsetInPx);
|
||||
}
|
||||
public DetailItem(int size, String name) {
|
||||
this(size, name, false);
|
||||
}
|
||||
|
||||
public DetailItem(int size, String name, boolean even) {
|
||||
|
|
@ -84,6 +74,33 @@ public final class DetailItem {
|
|||
this.currentDayOffset = currentdayoffset;
|
||||
}
|
||||
|
||||
public DetailItem(int size, String name, int currentdayoffset,
|
||||
int deadlineoffset) {
|
||||
this(size, name, currentdayoffset);
|
||||
this.deadlinePeriod = true;
|
||||
this.deadlineOffset = deadlineoffset;
|
||||
}
|
||||
|
||||
public void markCurrentDay() {
|
||||
if (this.startDate.isBeforeNow() && this.endDate.isAfterNow()) {
|
||||
int offsetInPx = Math.round((((float) Days.daysBetween(
|
||||
this.startDate, new DateTime()).getDays()) / ((float) Days
|
||||
.daysBetween(this.startDate, this.endDate).getDays()))
|
||||
* this.size);
|
||||
this.markCurrentDay(offsetInPx);
|
||||
}
|
||||
}
|
||||
|
||||
public void markDeadlineDay(DateTime deadline) {
|
||||
if (this.startDate.isBefore(deadline) && this.endDate.isAfter(deadline)) {
|
||||
int offsetInPx = Math.round((((float) Days.daysBetween(
|
||||
this.startDate, deadline).getDays()) / ((float) Days
|
||||
.daysBetween(this.startDate, this.endDate).getDays()))
|
||||
* this.size);
|
||||
this.markDeadlineDay(offsetInPx);
|
||||
}
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
|
@ -109,6 +126,11 @@ public final class DetailItem {
|
|||
this.currentDayOffset = offset;
|
||||
}
|
||||
|
||||
public void markDeadlineDay(int offset) {
|
||||
this.deadlinePeriod = true;
|
||||
this.deadlineOffset = offset;
|
||||
}
|
||||
|
||||
public boolean isEven() {
|
||||
return even;
|
||||
}
|
||||
|
|
@ -129,4 +151,27 @@ public final class DetailItem {
|
|||
return currentDayOffset;
|
||||
}
|
||||
|
||||
public boolean isDeadlinePeriod() {
|
||||
return deadlinePeriod;
|
||||
}
|
||||
|
||||
public int getDeadlineOffset() {
|
||||
return deadlineOffset;
|
||||
}
|
||||
|
||||
public String getBackgroundOffset() {
|
||||
String offset = "0px";
|
||||
if (getCurrentDayOffset() != 0) {
|
||||
if (getDeadlineOffset() != 0) {
|
||||
offset = getCurrentDayOffset() + "px," + getDeadlineOffset()
|
||||
+ "px";
|
||||
} else {
|
||||
offset = getCurrentDayOffset() + "px";
|
||||
}
|
||||
} else if (getDeadlineOffset() != 0) {
|
||||
offset = getDeadlineOffset() + "px";
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
ganttzk/src/main/resources/web/ganttz/img/watermark_deadline.png
Normal file
BIN
ganttzk/src/main/resources/web/ganttz/img/watermark_deadline.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 B |
|
|
@ -31,10 +31,10 @@
|
|||
<n:tr id="watermark" style="height:100px">
|
||||
<n:td class="timetracker_column${((each.even and (top.zoomLevel != 'DETAIL_FOUR'))?'_even':'')}
|
||||
${(each.bankHoliday?'bankHoliday':'')}
|
||||
${(each.currentPeriod?'timetracker_column_today':'')}"
|
||||
${(each.currentPeriod?'timetracker_column_today':' ')}
|
||||
${(each.deadlinePeriod?'timetracker_column_deadline':'')}"
|
||||
forEach="${top.detailsSecondLevel}"
|
||||
style="background-position: ${each.currentDayOffset}px">
|
||||
|
||||
style="background-position: ${each.backgroundOffset}">
|
||||
<n:table class="week_element" width="100%" height="100%" if="${top.zoomLevel == 'DETAIL_FOUR'}">
|
||||
<n:tr>
|
||||
<n:td/><n:td/><n:td/><n:td/><n:td/>
|
||||
|
|
|
|||
|
|
@ -274,14 +274,26 @@ min-width:200px;
|
|||
background-color: #EEEEEE;
|
||||
}
|
||||
|
||||
#watermark .timetracker_column_today.timetracker_column_deadline,
|
||||
#watermark .timetracker_column_deadline.timetracker_column_today {
|
||||
background-image:url(/navalplanner-webapp/zkau/web/ganttz/img/watermark_today.png),
|
||||
url("/navalplanner-webapp/zkau/web/ganttz/img/watermark_deadline.png");
|
||||
}
|
||||
|
||||
/* Background image for current day vertical line */
|
||||
#watermark .timetracker_column_today {
|
||||
background-image:
|
||||
url("/navalplanner-webapp/zkau/web/ganttz/img/watermark_today.png")
|
||||
;
|
||||
url("/navalplanner-webapp/zkau/web/ganttz/img/watermark_today.png");
|
||||
background-repeat: repeat-y;
|
||||
}
|
||||
|
||||
#watermark .timetracker_column_deadline {
|
||||
background-image:
|
||||
url("/navalplanner-webapp/zkau/web/ganttz/img/watermark_deadline.png");
|
||||
background-repeat: repeat-y;
|
||||
}
|
||||
|
||||
|
||||
#watermark .bankHoliday {
|
||||
background-color: #FFEEEE !important;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue