Commit be394379 authored by Valérie Maquil's avatar Valérie Maquil

displaying grid instead of rectangle in calibration mode

parent cf0585dd
......@@ -32,7 +32,6 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
......@@ -40,6 +39,7 @@ import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Line2D;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -303,7 +303,23 @@ public class TangibleInterfaceManager extends JComponent {
canvas2D.setColor(Color.white);
canvas2D.fillRect(0, 0, Calibration.getScreenWidth(), Calibration.getScreenHeight());
canvas2D.setColor(Color.black);
canvas2D.draw(new Rectangle(Calibration.cameraToScreenX(0), Calibration.cameraToScreenY(0), Calibration.cameraToScreenX(1) - Calibration.cameraToScreenX(0), Calibration.cameraToScreenY(1) - Calibration.cameraToScreenY(0)));
// canvas2D.draw(new Rectangle(Calibration.cameraToScreenX(0),
// Calibration.cameraToScreenY(0), Calibration.cameraToScreenX(1) -
// Calibration.cameraToScreenX(0), Calibration.cameraToScreenY(1) -
// Calibration.cameraToScreenY(0)));
// draw vertical lines
for (int i = 0; i < 9; i++) {
canvas2D.draw(new Line2D.Float(Calibration.cameraToScreenX(0) + i * (Calibration.cameraToScreenX(1) - Calibration.cameraToScreenX(0)) / 8, Calibration.cameraToScreenY(0),
Calibration.cameraToScreenX(0) + i * (Calibration.cameraToScreenX(1) - Calibration.cameraToScreenX(0)) / 8, Calibration.cameraToScreenY(1)));
}
// draw horizontal lines
for (int i = 0; i < 6; i++) {
canvas2D.draw(new Line2D.Float(Calibration.cameraToScreenX(0), Calibration.cameraToScreenY(0) + i * (Calibration.cameraToScreenY(1) - Calibration.cameraToScreenY(0)) / 6,
Calibration.cameraToScreenX(1), Calibration.cameraToScreenY(0) + i * (Calibration.cameraToScreenY(1) - Calibration.cameraToScreenY(0)) / 6));
}
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment