Commit 46534b0a authored by angermue's avatar angermue

Provides native look and feel feature which can be disabled by using the -n option.

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@38 0463f305-d864-43cb-8a47-61cf597d4139
parent 8fb893a0
......@@ -41,7 +41,9 @@ public class GradientPanel extends JPanel {
}
public GradientPanel(int orientation) {
vertical = orientation == SwingConstants.VERTICAL;
if (TTT.isEnabledNativeLookAndFeel() == false) {
vertical = orientation == SwingConstants.VERTICAL;
}
}
protected void paintComponent(Graphics g) {
......
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
......@@ -19,19 +22,14 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel1" alignment="1" max="32767" attributes="0"/>
<Component id="jPanel2" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel4" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel1" alignment="1" max="32767" attributes="0"/>
<Component id="jPanel2" alignment="1" max="32767" attributes="0"/>
<Component id="jPanel4" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="doneButton" min="-2" pref="67" max="-2" attributes="0"/>
......@@ -48,12 +46,12 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" pref="99" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="doneButton" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
......@@ -272,7 +270,7 @@
<Component id="mp4StatusField" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="camStatusField" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="370" max="32767" attributes="0"/>
<EmptySpace pref="435" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="createHelpButton" linkSize="4" min="-2" max="-2" attributes="1"/>
<Component id="createButton" linkSize="4" alignment="1" min="-2" max="-2" attributes="1"/>
......@@ -332,7 +330,7 @@
<Component id="camCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="camStatusField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="22" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
......@@ -354,6 +352,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="htmlCheckBox">
......@@ -365,6 +364,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="pdfCheckBox">
......@@ -376,6 +376,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="ocrCheckBox">
......@@ -387,6 +388,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="flashCheckBox">
......@@ -398,6 +400,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="createButton">
......@@ -456,6 +459,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="mp3StatusField">
......@@ -472,6 +476,7 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="mp4StatusField">
......@@ -488,10 +493,14 @@
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="camStatusField">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="c8" green="d0" red="64" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="not found"/>
</Properties>
</Component>
......@@ -523,7 +532,7 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="openSearchbaseFileDialogButton" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="85" max="32767" attributes="0"/>
<EmptySpace pref="117" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="importSearchbaseButton" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="searchHelpButton" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
......@@ -554,7 +563,7 @@
<Component id="importSearchbaseButton" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="6" max="32767" attributes="0"/>
<EmptySpace pref="26" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
......@@ -659,12 +668,12 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="userField" linkSize="6" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="257" max="32767" attributes="0"/>
<EmptySpace pref="295" max="32767" attributes="0"/>
<Component id="publishHelpButton" linkSize="7" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="pathField" linkSize="6" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="257" max="32767" attributes="0"/>
<EmptySpace pref="295" max="32767" attributes="0"/>
<Component id="publishButton" linkSize="7" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="serverField" linkSize="6" alignment="0" min="-2" pref="238" max="-2" attributes="0"/>
......
This diff is collapsed.
......@@ -26,6 +26,7 @@
package ttt;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
......@@ -108,13 +109,28 @@ public class TTT extends JFrame {
private JDesktopPane desktop;
private static boolean enabledNativeLookAndFeel = true;
private TTT() {
super("TeleTeachingTool - Version " + version);
// TODO: handle CTRL-C
// NOTE: Recorder uses its own handler
// Runtime.getRuntime().addShutdownHook(new ShutDownHook(this));
if (enabledNativeLookAndFeel) {
//try to enable native look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
enabledNativeLookAndFeel = false;
System.out.println("Error setting native look and feel: " + e);
}
}
fileChooser = new JFileChooser();
if (verbose)
System.out.println(ABOUT);
......@@ -1023,8 +1039,9 @@ public class TTT extends JFrame {
setSize(width, height);
setExtendedState(MAXIMIZED_BOTH);
setVisible(true);
getContentPane().setBackground(Color.WHITE);
showMemoryMonitor(false);
}
}
......@@ -1050,7 +1067,7 @@ public class TTT extends JFrame {
memoryMonitorCheckbox.setSelected(visible);
}
static private final JFileChooser fileChooser = new JFileChooser();
static private JFileChooser fileChooser;// = new JFileChooser();
public static TTT getInstance() {
if (ttt == null) {
......@@ -1313,16 +1330,26 @@ public class TTT extends JFrame {
}
public static void main(String[] args) throws NumberFormatException, IOException {
if (args.length >= 1) {
for (int i = 0; i < args.length; i++) {
// new Recording(args[i]).store();
createFilePlayer(new File(args[0]));
}
return;
} else {
getInstance().showTTT();
// showWizard(true);
}
//parse command line options
for (int i = 0; i < args.length; ++i) {
if (args[i].length() == 2 && args[i].charAt(0) == '-') {
switch (args[i].charAt(1)) {
case 'n':
enabledNativeLookAndFeel = false;
break;
default:
System.out.println("Usage: ttt [options] [recording]\n" +
(char)9 + "-n" + (char)9 + "Disable native look and feel\n" +
(char)9 + "-h" + (char)9 + "Show this message");
System.exit(0);
}
} else {
createFilePlayer(new File(args[i]));
break;
}
}
getInstance().showTTT();
}
// MOD TD
......@@ -1376,4 +1403,8 @@ public class TTT extends JFrame {
}
}
}
public static boolean isEnabledNativeLookAndFeel() {
return enabledNativeLookAndFeel;
}
}
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