EOS 2  1.1.0
Einfache Objektbasierte Sprache
DirectionValue.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.gui.objectchart;
2 
3 import de.lathanda.eos.base.util.Direction;
4 import de.lathanda.eos.gui.diagram.Drawing;
5 import de.lathanda.eos.gui.diagram.Unit;
6 
13 public class DirectionValue extends Unit {
14  private Direction direction;
15 
16  public DirectionValue(Direction direction) {
17  super();
18  this.direction = direction;
19  }
20 
21  @Override
22  public void drawUnit(Drawing d) {
23  switch (direction) {
24  case NORTH:
25  d.drawArrow(2, 5, 2, 0, 1);
26  break;
27  case SOUTH:
28  d.drawArrow(2, 1, 2, 4, 1);
29  break;
30  case WEST:
31  d.drawArrow(4, 3, 0, 3, 1);
32  break;
33  case EAST:
34  d.drawArrow(0, 3, 4, 3, 1);
35  break;
36  }
37  }
38 
39  @Override
40  public void layoutUnit(Drawing d) {
41  width = 6;
42  height = 5;
43  }
44 
45 }
void drawArrow(float x1, float y1, float x2, float y2, float size)
Definition: Drawing.java:284
Impressum