Commit 73ceaab9 authored by Nico Mack's avatar Nico Mack

Added possibility to make Tulip Frame transparent

parent 0c72a307
......@@ -185,6 +185,7 @@ TEXT_NODE=text
TICKMARK_COLOUR_NODE=tickMarkColour
TITLE_NODE=title
TOUCHABLE_NODE=touchable
TRANSPARENT_NODE=transparent
TRIANGLE_SIZE_NODE=triangleSize
TRIGGER_CONDITION_NODE=triggerCondition
TRIGGER_ELEMENT=trigger
......
......@@ -154,6 +154,7 @@ public class TangibleInterfaceManager extends Stage {
this.splashShown = false;
title = interfaceProperties.getProperty("frameTitle", "TangibleApplication"); //$NON-NLS-1$ //$NON-NLS-2$
transparent = Boolean.parseBoolean(interfaceProperties.getProperty(Externalization.TRANSPARENT_NODE, "False"));
String calibration = interfaceProperties.getProperty("calibrationFileURI"); //$NON-NLS-1$
if (calibration != null) {
......
......@@ -71,6 +71,7 @@ public class Stage extends JComponent {
protected Rectangle bounds;
protected Color backgroundColour;
protected boolean fullScreen;
protected boolean transparent;
protected transient GraphicsDevice device;
protected JFrame window;
......@@ -86,6 +87,8 @@ public class Stage extends JComponent {
/** */
private static final long serialVersionUID = 4419655151177786600L;
private static final Color TRANSPARENT = new Color(0, 0, 0, 0);
protected static final Logger logger = LoggerFactory.getLogger(Stage.class.getSimpleName());
protected static final List<GraphicsDevice> DEVICES = Stage.getAvailableScreens();
......@@ -195,6 +198,7 @@ public class Stage extends JComponent {
this.name = BootstrappingUtils.getContentAsString(stageNode, Externalization.NAME_NODE, BootstrappingUtils.OPTIONAL, Externalization.EMPTY_STRING, context);
this.fullScreen = BootstrappingUtils.getContentAsBoolean(stageNode, Externalization.FULLSCREEN_NODE, BootstrappingUtils.OPTIONAL, Boolean.FALSE, context);
this.transparent = BootstrappingUtils.getContentAsBoolean(stageNode, Externalization.TRANSPARENT_NODE, BootstrappingUtils.OPTIONAL, Boolean.FALSE, context);
this.backgroundColour = BootstrappingUtils.getContentAsColour(stageNode, Externalization.BACKGROUND_COLOUR_NODE, BootstrappingUtils.OPTIONAL, Color.BLACK, context);
this.bounds = buildBoundsFromElement(stageNode.getChild(Externalization.BOUNDS_NODE), context, callback);
......@@ -283,7 +287,7 @@ public class Stage extends JComponent {
public void showWindow() {
window.getContentPane().setBackground(this.backgroundColour);
this.setBounds(0, 0, this.bounds.width, this.bounds.height);
if (fullScreen) {
......@@ -296,6 +300,12 @@ public class Stage extends JComponent {
window.setUndecorated(true);
}
if (transparent) {
window.setBackground(TRANSPARENT);
} else {
window.getContentPane().setBackground(this.backgroundColour);
}
this.setupAnimation();
window.setVisible(true);
......
......@@ -220,6 +220,7 @@ public class Externalization extends NLS {
public static String TICKMARK_COLOUR_NODE;
public static String TITLE_NODE;
public static String TOUCHABLE_NODE;
public static String TRANSPARENT_NODE;
public static String TRIANGLE_SIZE_NODE;
public static String TRIGGER_CONDITION_NODE;
public static String TRIGGER_ELEMENT;
......
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