Commit 9828d619 authored by Nico Mack's avatar Nico Mack

Minor API changes

parent d20721ff
...@@ -47,7 +47,6 @@ import java.awt.Graphics; ...@@ -47,7 +47,6 @@ import java.awt.Graphics;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import java.awt.geom.Area;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
...@@ -109,8 +108,6 @@ public class TangibleInterfaceManager extends Stage { ...@@ -109,8 +108,6 @@ public class TangibleInterfaceManager extends Stage {
/** Index pointer used to switch between different configuration points. */ /** Index pointer used to switch between different configuration points. */
protected int configurationPoint = 0; protected int configurationPoint = 0;
private Area clippingRegion;
private SplashScreen splashScreen; private SplashScreen splashScreen;
private CalibrationScreen calibrationScreen; private CalibrationScreen calibrationScreen;
...@@ -123,10 +120,11 @@ public class TangibleInterfaceManager extends Stage { ...@@ -123,10 +120,11 @@ public class TangibleInterfaceManager extends Stage {
protected static final Logger LOGGER = LoggerFactory.getLogger(TangibleInterfaceManager.class.getSimpleName()); protected static final Logger LOGGER = LoggerFactory.getLogger(TangibleInterfaceManager.class.getSimpleName());
private static final String ABOUT_HTML_TEMPLATE = "/about.html"; private static final String ABOUT_HTML_TEMPLATE = "/about.html"; //$NON-NLS-1$
private static final String PACKAGE_HTML_TEMPLATE = "/tulip_package.html"; private static final String PACKAGE_HTML_TEMPLATE = "/tulip_package.html"; //$NON-NLS-1$
private static final Pattern VARIABLE_PATTERN = Pattern.compile("\\$\\{([a-z0-9\\-_]+)\\}", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$ private static final Pattern VARIABLE_PATTERN = Pattern.compile("\\$\\{([a-z0-9\\-_]+)\\}", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
private static final Pattern URI_PATTERN = Pattern.compile("^file:(.*?)$", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$ // private static final Pattern URI_PATTERN = Pattern.compile("^file:(.*?)$",
// Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// *************************************************************************** // ***************************************************************************
...@@ -150,7 +148,7 @@ public class TangibleInterfaceManager extends Stage { ...@@ -150,7 +148,7 @@ public class TangibleInterfaceManager extends Stage {
this.calibrationShown = false; this.calibrationShown = false;
title = interfaceProperties.getProperty("frameTitle", "TangibleApplication"); //$NON-NLS-1$ //$NON-NLS-2$ title = interfaceProperties.getProperty("frameTitle", "TangibleApplication"); //$NON-NLS-1$ //$NON-NLS-2$
transparent = Boolean.parseBoolean(interfaceProperties.getProperty(Externalization.TRANSPARENT_NODE, "False")); transparent = Boolean.parseBoolean(interfaceProperties.getProperty(Externalization.TRANSPARENT_NODE, "False")); //$NON-NLS-1$
String calibration = interfaceProperties.getProperty("calibrationFileURI"); //$NON-NLS-1$ String calibration = interfaceProperties.getProperty("calibrationFileURI"); //$NON-NLS-1$
if (calibration != null) { if (calibration != null) {
...@@ -304,7 +302,7 @@ public class TangibleInterfaceManager extends Stage { ...@@ -304,7 +302,7 @@ public class TangibleInterfaceManager extends Stage {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
private void handleCalibrationScreen(CalibrationScreen.Action action) { private void handleCalibrationScreen(CalibrationScreen.ExitAction action) {
switch (action) { switch (action) {
case REVERT: case REVERT:
Calibration.loadFromFile(calibrationFileURI); Calibration.loadFromFile(calibrationFileURI);
...@@ -498,9 +496,9 @@ public class TangibleInterfaceManager extends Stage { ...@@ -498,9 +496,9 @@ public class TangibleInterfaceManager extends Stage {
if (calibrationShown) { if (calibrationShown) {
calibrationScreen.repaint(); calibrationScreen.repaint();
CalibrationScreen.Action action = calibrationScreen.getAction(); CalibrationScreen.ExitAction action = calibrationScreen.getExitAction();
if (action != CalibrationScreen.Action.NONE) { if (action != CalibrationScreen.ExitAction.NONE) {
this.handleCalibrationScreen(action); this.handleCalibrationScreen(action);
} }
} }
......
...@@ -42,13 +42,13 @@ public class CalibrationScreen extends JPanel implements KeyListener { ...@@ -42,13 +42,13 @@ public class CalibrationScreen extends JPanel implements KeyListener {
private Corner corner; private Corner corner;
private CoordinateSystem system; private CoordinateSystem system;
private Action action; private ExitAction action;
// *************************************************************************** // ***************************************************************************
// * Constants * // * Constants *
// *************************************************************************** // ***************************************************************************
public enum Action { public enum ExitAction {
NONE, KEEP, REVERT, SAVE NONE, KEEP, REVERT, SAVE
} }
...@@ -103,7 +103,7 @@ public class CalibrationScreen extends JPanel implements KeyListener { ...@@ -103,7 +103,7 @@ public class CalibrationScreen extends JPanel implements KeyListener {
this.addKeyListener(this); this.addKeyListener(this);
this.corner = Corner.NONE; this.corner = Corner.NONE;
this.system = CoordinateSystem.NONE; this.system = CoordinateSystem.NONE;
this.action = Action.NONE; this.action = ExitAction.NONE;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -220,14 +220,14 @@ public class CalibrationScreen extends JPanel implements KeyListener { ...@@ -220,14 +220,14 @@ public class CalibrationScreen extends JPanel implements KeyListener {
@Override @Override
public void setVisible(boolean showIt) { public void setVisible(boolean showIt) {
if (showIt) { if (showIt) {
this.action = Action.NONE; this.action = ExitAction.NONE;
} }
super.setVisible(showIt); super.setVisible(showIt);
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
public Action getAction() { public ExitAction getExitAction() {
return this.action; return this.action;
} }
...@@ -246,14 +246,14 @@ public class CalibrationScreen extends JPanel implements KeyListener { ...@@ -246,14 +246,14 @@ public class CalibrationScreen extends JPanel implements KeyListener {
public void keyPressed(KeyEvent event) { public void keyPressed(KeyEvent event) {
switch (event.getKeyCode()) { switch (event.getKeyCode()) {
case KeyEvent.VK_ESCAPE: case KeyEvent.VK_ESCAPE:
this.action = Action.REVERT; this.action = ExitAction.REVERT;
break; break;
case KeyEvent.VK_ENTER: case KeyEvent.VK_ENTER:
this.action = Action.KEEP; this.action = ExitAction.KEEP;
break; break;
case KeyEvent.VK_W: case KeyEvent.VK_W:
if (event.isControlDown()) { if (event.isControlDown()) {
this.action = Action.SAVE; this.action = ExitAction.SAVE;
} }
break; break;
case KeyEvent.VK_C: // Calibrate Camera case KeyEvent.VK_C: // Calibrate Camera
......
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