19 package org.turro.zkoss.svg;
21 import org.turro.string.Strings;
22 import org.turro.i18n.I_;
30 static private final int
38 private int taskPanelWidth = 300, hoursPanelWidth;
49 public void rule(
int units) {
50 String nunit =
I_.
byKey(measure.toString());
53 line(taskPanelWidth, 15, taskPanelWidth + (units * RULE_SPAN), 15,
"#000",
"1px");
54 for(
int i = 0; i <= units; i++) {
55 line(taskPanelWidth + (i * RULE_SPAN), 15, taskPanelWidth + (i * RULE_SPAN), 20,
"#000",
"1px");
57 text(
"" + i, taskPanelWidth + (i * RULE_SPAN) - 5, RULE_HEIGHT);
62 public void startComposing(String onUserEvent, String width, String height,
double scale) {
66 hoursPanelWidth = maxUnits * RULE_SPAN;
69 width =
"" + ((taskPanelWidth + (maxUnits * RULE_SPAN) + 20) * scale);
72 height =
"" + (((data.size() * ITEM_SPAN) + RULE_HEIGHT + 20 + 28) * scale);
74 super.startComposing(onUserEvent, width, height, scale);
77 "style='stroke:none'",
79 "font-style='normal'",
80 "font-family='Ubuntu'"
90 gi.setPosition(count);
91 int x1 = (int) taskPanelWidth;
92 int dx2a = (int) (RULE_SPAN * measure.
convert(gi.getExpected()));
93 int dx2b = (int) (RULE_SPAN * measure.
convert(gi.getVariable()));
94 int y1 = (ITEM_SPAN * (gi.getPosition() - 1)) + ITEM_INIT + (typeChange * 14);
95 int dy2 = ITEM_HEIGHT;
96 if(!Strings.isBlank(gi.getUniqueId())) {
97 if(lastType != -1 && lastType != gi.getType()) {
99 line(5, y1, 5 + taskPanelWidth + hoursPanelWidth, y1,
"#dde",
"3px");
100 y1 += (typeChange * 14);
102 lastType = gi.getType();
static String byKey(String key)
double getMaxHoursLenght()
static final int MAX_NAME_LENGTH
GanttResourceData getData()
void setData(GanttResourceData data)
void startComposing(String onUserEvent, String width, String height, double scale)
void shadowedRoundRectangle(int x, int y, int width, int height, String fill, double opacity, String tooltip)
void setForceStyle(String forceStyle)
HTMLGenerator startTag(String tag, String[] attributes)
void setClickElementData(String clickElementData)
void line(int x1, int y1, int x2, int y2, String stroke, String strokeWidth)
void text(String text, int x, int y)
static GanttMeasure chooseMeasure(double hours)
double convert(double hours)