So, here's my ideas, but with most design question, there's rarely ever one "correct" answer.
Like you said, a State is not a Rectangle, and a Transition is not a Line. We can draw a Line and/or a Rectangle, and there may be some advantage to treating them similarly. So I can translate those statements into a simple design:
public interface Drawable
{
public void draw();
public Position getPos();
}
public class Rectangle implements Drawable ...
public class Line implements Drawable ...
Now, State's and Transition's can be represented by these Drawables. Have you ever heard of Single Responsibility Principle? It's basically exactly what it sounds like, an Object should be responsible for doing one "thing". Rectangles and Lines know how to draw themselves. States and Transitions presumably have some other job to do in your system.
public interface Figure
{
public Drawable getDrawable();
}
public class State implements Figure
{
private Rectangle rect;
public Drawable getDrawable() { return rect; }
//... State's real "work" below
}
public class Transition implements Figure
{
private Line line;
// you get the idea
}
On a small/simple system, the advantages of SRP may be lost, but the idea is that we're separating rendering from the other system logic. The more we separate functionality, the less brittle the system will be when the time for changes come.