ItEr30S11CUVistaRecursosTempoEmpresaItEr29S13: Added chart legend.

This commit is contained in:
Manuel Rego Casasnovas 2009-10-15 17:36:25 +02:00 committed by Javier Moran Rua
parent 8a21002441
commit 12e234f2d1
4 changed files with 111 additions and 0 deletions

View file

@ -70,6 +70,8 @@ import org.zkoss.ganttz.timetracker.TimeTracker;
import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
import org.zkoss.ganttz.util.Interval;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Div;
/**
* Model for company planning view.
@ -130,6 +132,8 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
configuration.setAddingDependenciesEnabled(false);
configuration.setChartLegend(getChartLegend());
planner.setConfiguration(configuration);
setupChart(chartComponent, planner.getTimeTracker());
@ -458,4 +462,13 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
}
}
private org.zkoss.zk.ui.Component getChartLegend() {
Div div = new Div();
Executions.createComponents("/planner/_legendCompanyPlanner.zul", div,
null);
return div;
}
}

View file

@ -74,6 +74,8 @@ import org.zkoss.ganttz.timetracker.TimeTracker;
import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
import org.zkoss.ganttz.util.Interval;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Div;
/**
* @author Óscar González Fernández <ogonzalez@igalia.com>
@ -150,6 +152,8 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
Timeplot chartComponent = new Timeplot();
configuration.setChartComponent(chartComponent);
configuration.setChartLegend(getChartLegend());
planner.setConfiguration(configuration);
setupChart(orderReloaded, chartComponent, planner.getTimeTracker());
@ -617,4 +621,13 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
}
}
private org.zkoss.zk.ui.Component getChartLegend() {
Div div = new Div();
Executions.createComponents("/planner/_legendOrderPlanner.zul", div,
null);
return div;
}
}

View file

@ -0,0 +1,40 @@
<!--
This file is part of ###PROJECT_NAME###
Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
Desenvolvemento Tecnolóxico de Galicia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n" ?>
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
<vbox>
<label style="font-weight:bold;">${i18n:_('Legend')}</label>
<hbox>
<label>${i18n:_('Capability')}</label>
<n:div style="background-color:#FF0000;height:1px;width:25px;" />
</hbox>
<hbox>
<label>${i18n:_('Load')}</label>
<n:div style="background-color:#0000FF;height:10px;width:25px;" />
</hbox>
</vbox>
</zk>

View file

@ -0,0 +1,45 @@
<!--
This file is part of ###PROJECT_NAME###
Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
Desenvolvemento Tecnolóxico de Galicia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n" ?>
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
<vbox>
<label style="font-weight:bold;">${i18n:_('Legend')}</label>
<hbox>
<label>${i18n:_('Capability')}</label>
<n:div style="background-color:#FF0000;height:1px;width:25px;" />
</hbox>
<hbox>
<label>${i18n:_('Other')}</label>
<n:div style="background-color:#00FF00;height:10px;width:25px;" />
</hbox>
<hbox>
<label>${i18n:_('Load')}</label>
<n:div style="background-color:#0000FF;height:10px;width:25px;" />
</hbox>
</vbox>
</zk>