graphics.fillRect(0, 0, width, height);
graphics.setColor(Color.BLACK);
graphics.drawRect(0, 0, width - 1, height - 1);
Orientation orientation = ruler.getOrientation();
switch (orientation) {
case HORIZONTAL: {
for (int i = 0, n = width / 5 + 1; i < n; i++) {
int x = i * 5;