BrightSide Workbench Full Report + Source Code
GanttResourceData.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2012 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
package
org.turro.zkoss.svg;
20
21
import
java.util.TreeSet;
22
27
public
class
GanttResourceData
extends
TreeSet<GanttResourceItem> {
28
29
public
static
final
int
30
MAX_NAME_LENGTH
= 60,
31
CHAR_PIXELS = 8;
32
33
public
int
getMaxNameLenght
() {
34
int
maxLenght = 0;
35
for
(
GanttResourceItem
gi :
this
) {
36
maxLenght = Math.max(gi.
getName
().length(), maxLenght);
37
}
38
return
Math.min(maxLenght,
MAX_NAME_LENGTH
);
39
}
40
41
public
double
getMaxHoursLenght
() {
42
double
maxLenght = 0.0;
43
for
(
GanttResourceItem
gi :
this
) {
44
maxLenght = Math.max(gi.
getExpected
() + gi.
getVariable
(), maxLenght);
45
}
46
return
maxLenght;
47
}
48
49
public
GanttResourceItem
getItem
(String index) {
50
for
(
GanttResourceItem
gi :
this
) {
51
if
(gi.
getUniqueId
().equals(index)) {
52
return
gi;
53
}
54
}
55
return
null
;
56
}
57
58
}
org.turro.zkoss.svg.GanttResourceData
Definition:
GanttResourceData.java:27
org.turro.zkoss.svg.GanttResourceData.getMaxNameLenght
int getMaxNameLenght()
Definition:
GanttResourceData.java:33
org.turro.zkoss.svg.GanttResourceData.getItem
GanttResourceItem getItem(String index)
Definition:
GanttResourceData.java:49
org.turro.zkoss.svg.GanttResourceData.getMaxHoursLenght
double getMaxHoursLenght()
Definition:
GanttResourceData.java:41
org.turro.zkoss.svg.GanttResourceData.MAX_NAME_LENGTH
static final int MAX_NAME_LENGTH
Definition:
GanttResourceData.java:30
org.turro.zkoss.svg.GanttResourceItem
Definition:
GanttResourceItem.java:27
org.turro.zkoss.svg.GanttResourceItem.getExpected
double getExpected()
Definition:
GanttResourceItem.java:42
org.turro.zkoss.svg.GanttResourceItem.getVariable
double getVariable()
Definition:
GanttResourceItem.java:50
org.turro.zkoss.svg.GanttResourceItem.getName
String getName()
Definition:
GanttResourceItem.java:58
org.turro.zkoss.svg.GanttResourceItem.getUniqueId
String getUniqueId()
Definition:
GanttResourceItem.java:62
TurroProjects
Public
BrightSide
elephant-zkoss
src
main
java
org
turro
zkoss
svg
GanttResourceData.java
Generated on Tue Mar 12 2024 07:01:19 for BrightSide by
1.9.1