package jetbrains.mps.ide.dataFlow.presentation;
/*Generated by MPS */
import java.awt.Color;
import java.awt.Graphics;
public class Line implements Comparable<Line> {
protected int myFirst;
protected int mySecond;
protected int myLevel;
protected final LineDirection myDirection;
protected final Color myColor;
public Line(int first, int second, int level, LineDirection direction) {
this(first, second, level, direction, Color.BLACK);
}
public Line(int first, int second, int level, LineDirection direction, Color color) {
this.myFirst = first;
this.mySecond = second;
this.myLevel = level;
this.myDirection = direction;
this.myColor = color;
}
public int getFirst() {
return this.myFirst;
}
public int getSecond() {
return this.mySecond;
}
public int getLevel() {
return this.myLevel;
}
public LineDirection getDirection() {
return this.myDirection;
}
/**
*
* @deprecated
*/
@Deprecated
public void paint(Graphics g, Color backgroundColor) {
paint(g);
}
public void paint(Graphics g) {
g.setColor(myColor);
this.myDirection.paint(this, g, this.myFirst, this.mySecond, this.myLevel);
}
protected void drawLine(Graphics g, int x1, int y1, int x2, int y2) {
g.drawLine(x1, y1, x2, y2);
}
@Override
public int compareTo(Line o) {
return this.myDirection.ordinal() - o.myDirection.ordinal();
}
public void shiftLeft(int indent) {
this.myDirection.shiftLeft(this, indent);
}
}