Normand Briere
2019-04-22 a9e12f6c508810604c8c91ee15451776b08ce1a1
timeflow/vis/timeline/AxisRenderer.java
....@@ -20,7 +20,7 @@
2020
2121 public void render(Graphics2D g, Collection<Mouseover> objectLocations)
2222 {
23
- TFModel model = visuals.getModel();
23
+ TimeflowModel model = visuals.getModel();
2424 g.setColor(model.getDisplay().getColor("chart.background"));
2525 Rectangle bounds = visuals.getBounds();
2626
....@@ -41,12 +41,11 @@
4141
4242 void render(AxisTicMarks t, Graphics2D g, int x, int y, int h, int top, boolean full, Collection<Mouseover> objectLocations)
4343 {
44
- TFModel model = visuals.getModel();
44
+ TimeflowModel model = visuals.getModel();
4545
4646 int n = t.tics.size();
4747 for (int i = 0; i < n - 1; i++)
4848 {
49
-
5049 long start = t.tics.get(i);
5150 long end = t.tics.get(i + 1);
5251
....@@ -58,19 +57,23 @@
5857 g.setColor(t.unit.isDayOrLess() && (dayOfWeek == 1 || dayOfWeek == 7)
5958 ? new Color(245, 245, 245) : new Color(240, 240, 240));
6059
61
- g.fillRect(x0, y, x1 - x0 - 1, h);
60
+ g.fillRect(x0, y, x1 - x0, h);
6261 g.setColor(Color.white);
63
- g.drawLine(x1 - 1, y, x1 - 1, y + h);
62
+ g.drawLine(x1, y, x1, y + h);
6463 g.drawLine(x0, y + h, x1, y + h);
65
- objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0 - 1, h));
64
+ objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0, h));
6665
6766 g.setFont(model.getDisplay().timeLabel());
6867 String label = full ? t.unit.formatFull(start) : t.unit.format(new Date(start));
69
- int tx = x0 + 3;
70
- int ty = y + h - 5;
68
+
69
+ if (!full)
70
+ full = false;
71
+
72
+ int tx = x0;
73
+ int ty = y + h;
7174 g.setColor(full ? Color.darkGray : Color.gray);
7275 int sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label);
73
- if (sw < x1 - tx - 3)
76
+ if (true) // sw < x1 - tx)
7477 {
7578 g.drawString(label, tx, ty);
7679 } else
....@@ -80,7 +83,7 @@
8083 {
8184 label = label.substring(0, c);
8285 sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label);
83
- if (sw < x1 - tx - 3)
86
+ //if (sw < x1 - tx)
8487 {
8588 g.drawString(label, tx, ty);
8689 }