EOS 2  1.1.0
Einfache Objektbasierte Sprache
LineStyleValue.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.gui.objectchart;
2 
3 import de.lathanda.eos.base.LineStyle;
4 import de.lathanda.eos.gui.diagram.Unit;
5 import de.lathanda.eos.gui.diagram.Drawing;
6 
13 public class LineStyleValue extends Unit {
14  private LineStyle lineStyle;
15 
16  public LineStyleValue(LineStyle lineStyle) {
17  super();
18  this.lineStyle = lineStyle;
19  }
20 
21  @Override
22  public void drawUnit(Drawing d) {
23  switch (lineStyle) {
24  case SOLID:
25  d.fillRect(0, 3.75f, 8f, 0.5f);
26  break;
27  case INVISIBLE:
28  // nothing
29  break;
30  case DOTTED:
31  for (int i = 0; i < 8; i += 2) {
32  d.fillRect(i, 3.75f, 0.5f, 0.5f);
33  }
34  break;
35  case DASHED_DOTTED:
36  for (int i = 0; i < 8; i += 4) {
37  d.fillRect(i, 3.75f, 0.5f, 0.5f);
38  d.fillRect(i + 1f, 3.75f, 2.5f, 0.5f);
39  }
40  break;
41  case DASHED:
42  for (int i = 0; i < 8; i += 3) {
43  d.fillRect(i, 3.75f, 0.5f, 0.5f);
44  d.fillRect(i, 3.75f, 2f, 0.5f);
45  }
46  break;
47  }
48 
49  }
50 
51  @Override
52  public void layoutUnit(Drawing d) {
53  width = 8;
54  height = 8;
55  }
56 
57 }
void fillRect(float x, float y, float width, float height)
Definition: Drawing.java:236
Impressum