if (calFormat==null) return;
//non working days
Color oldColor=g2.getColor();
Paint oldPaint=g2.getPaint();
CoordinatesConverter coord=((GanttParams)graphInfo).getCoord();
Project project=coord.getProject();
WorkingCalendar wc=(WorkingCalendar)project.getWorkCalendar();
if (coord.getTimescaleManager().isShowWholeDays()){
boolean useScale2=coord.getTimescaleManager().getCurrentScaleIndex()==0; //valid only for current time scales
TimeIterator i=coord.getTimeIterator(bounds.getX(), bounds.getMaxX(),useScale2);
long startNonworking=-1L,endNonWorking=-1L;
Calendar cal=DateTime.calendarInstance();
PredefinedPaint paint=(PredefinedPaint)calFormat.getMiddle().getPaint();//new PredefinedPaint(PredefinedPaint.DOT_LINE,Colors.VERY_LIGHT_GRAY,Color.WHITE);
paint.applyPaint(g2, useTextures());
while (i.hasNext()){
TimeInterval interval=i.next();
long s=interval.getStart();
if (CalendarService.getInstance().getDay(wc, s).isWorking()){
if (startNonworking!=-1L){
drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
startNonworking=endNonWorking=-1L;
}
}else{
if (startNonworking==-1L) startNonworking=s;
endNonWorking=s;
}
}
if (startNonworking!=-1L){
drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
startNonworking=endNonWorking=-1L;
}
}
if (container!=null){
//scale2 separation lines
TimeIterator i=coord.getTimeIterator(bounds.getX(), bounds.getMaxX(),true);
g2.setPaint(new PredefinedPaint(PredefinedPaint.DOT_LINE2,Color.GRAY,g2.getBackground()));
while (i.hasNext()){
TimeInterval interval=i.next();
int startX=(int)Math.round(coord.toX(interval.getStart()));
g2.drawLine(startX,bounds.y,startX,bounds.y+bounds.height);
}
//project start
int projectStartX=(int)Math.round(coord.toX(project.getStart()));
if (projectStartX>=bounds.getX()&&projectStartX<=bounds.getMaxX()){
g2.setPaint(new PredefinedPaint(PredefinedPaint.DASH_LINE,Color.GRAY,g2.getBackground()));
g2.drawLine(projectStartX,bounds.y,projectStartX,bounds.y+bounds.height);
}
//project start
long statusDate = project.getStatusDate();
if (statusDate != 0) {
int statusDateX=(int)Math.round(coord.toX(statusDate));
if (statusDateX>=bounds.getX()&&statusDateX<=bounds.getMaxX()){
g2.setPaint(new PredefinedPaint(PredefinedPaint.DOT_LINE2,Color.GREEN,g2.getBackground()));
g2.drawLine(statusDateX,bounds.y,statusDateX,bounds.y+bounds.height);