function draw(g, state, drawInfo) {
    var x = drawInfo.texArea[0];
    var y = drawInfo.texArea[1];
    var w = drawInfo.texArea[2] - drawInfo.texArea[0];
    var h = drawInfo.texArea[3] - drawInfo.texArea[1];

    var routeInfo = drawInfo.routeInfo;

    g.setColor(Color.WHITE);
    g.fillRect(x, y, w, h);

    if (routeInfo != null && routeInfo != undefined) {
        var routeColor = routeInfo.routeColor;

        g.setColor(routeColor);
        g.fillRect(x + h * 0.1, heightPercent(0.4), w - h * 0.2, h * 0.2);
        g.fillOval(x, heightPercent(0.4), h * 0.2, h * 0.2);
        g.fillOval(widthPercent(1) - h * 0.2, heightPercent(0.4), h * 0.2, h * 0.2);
    }

    function widthPercent(p) {
        return x + w * p;
    }
    function heightPercent(p) {
        return y + h * p;
    }
}
