Subversion Repositories svn.mios

Compare Revisions

Ignore whitespace Rev 757 → Rev 762

/trunk/java/MIOSStudio.java
26,22 → 26,13
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.prefs.Preferences;
 
import javax.swing.JApplet;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JMenuItem;
import javax.swing.UIManager;
 
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
import org.midibox.apps.miosstudio.gui.xml.MIOSStudioGUIXML;
import org.midibox.apps.miosstudiosid.gui.MIOSStudioSIDGUI;
import org.midibox.midi.gui.MidiFilterGUI;
import org.midibox.mios.gui.HexFileUploadGUI;
import org.midibox.utils.gui.DialogOwner;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.SplashScreen;
57,8 → 48,12
 
public class MIOSStudio extends JApplet {
 
protected static String configFileName = ".miosstudio";
protected static String oldConfigFileName = ".miosstudio";
 
protected static String configDirectoryName = ".midibox";
 
protected static String configFileName = "miosstudio.xml";
 
protected static String frameTitle = "MIOS Studio";
 
protected static String splashTitle = "MIOS Studio beta 9.2";
74,19 → 69,41
public MIOSStudio() {
 
this.miosStudio = new org.midibox.apps.miosstudio.MIOSStudio();
File configFile = new File(System.getProperty("user.home"),
configFileName);
 
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (configFile.exists()) {
 
MIOSStudioGUIXML miosStudioGUIXML = new MIOSStudioGUIXML(
miosStudio, MIOSStudioGUIXML.TAG_ROOT_ELEMENT, true, true, true, true, true);
miosStudio, MIOSStudioGUIXML.TAG_ROOT_ELEMENT, true, true,
true, true, true);
 
miosStudioGUIXML.loadXML(configFile);
 
this.miosStudioGUI = miosStudioGUIXML.getMiosStudioGUI();
 
} else {
 
// check for old config file
 
configFile = new File(System.getProperty("user.home"),
oldConfigFileName);
 
if (configFile.exists()) {
 
MIOSStudioGUIXML miosStudioGUIXML = new MIOSStudioGUIXML(
miosStudio, MIOSStudioGUIXML.TAG_ROOT_ELEMENT, true,
true, true, true, true);
 
miosStudioGUIXML.loadXML(configFile);
 
this.miosStudioGUI = miosStudioGUIXML.getMiosStudioGUI();
 
configFile.delete();
}
}
 
if (miosStudioGUI == null) {
97,19 → 114,33
setContentPane(miosStudioGUI);
 
setJMenuBar(miosStudioGUI.createMenuBar());
 
miosStudioGUI.setCommentLabel(frameComment);
}
 
public void init() {
 
}
 
public void destroy() {
 
File configFile = new File(System.getProperty("user.home"),
configFileName);
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (!configDirectory.exists()) {
 
try {
 
configDirectory.mkdir();
 
} catch (Exception e) {
 
e.printStackTrace();
}
}
 
if (!configFile.exists()) {
 
try {
152,8 → 183,9
 
frame.setIconImage(ImageLoader.getImageIcon("ucIcon.png").getImage());
 
frame.setBounds(50, 50, (screenSize.width - 100), (screenSize.height - 100));
frame.setBounds(50, 50, (screenSize.width - 100),
(screenSize.height - 100));
 
final MIOSStudio miosStudio = new MIOSStudio();
 
miosStudio.init();
166,7 → 198,7
 
exitMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
 
miosStudio.destroy();
 
System.exit(0);
177,7 → 209,7
 
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
 
miosStudio.destroy();
 
System.exit(0);
/trunk/java/MIOSStudioSID.java
31,7 → 31,6
import javax.swing.JFrame;
import javax.swing.JMenuItem;
 
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
import org.midibox.apps.miosstudiosid.gui.MIOSStudioSIDGUI;
import org.midibox.apps.miosstudiosid.gui.xml.MIOSStudioSIDGUIXML;
import org.midibox.utils.gui.DialogOwner;
49,8 → 48,12
 
public class MIOSStudioSID extends JApplet {
 
protected static String configFileName = ".miosstudiosid";
protected static String oldConfigFileName = ".miosstudiosid";
 
protected static String configDirectoryName = ".midibox";
 
protected static String configFileName = "miosstudiosid.xml";
 
protected static String frameTitle = "MIOS Studio + SID V2 Editor";
 
protected static String splashTitle = "MIOS Studio beta 9.2 + SID V2 Editor";
67,9 → 70,11
 
this.miosStudioSID = new org.midibox.apps.miosstudiosid.MIOSStudioSID();
 
File configFile = new File(System.getProperty("user.home"),
configFileName);
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (configFile.exists()) {
 
MIOSStudioSIDGUIXML miosStudioSIDGUIXML = new MIOSStudioSIDGUIXML(
81,6 → 86,26
this.miosStudioSIDGUI = (MIOSStudioSIDGUI) miosStudioSIDGUIXML
.getMiosStudioGUI();
 
} else {
 
// check for old config file
 
configFile = new File(System.getProperty("user.home"),
oldConfigFileName);
 
if (configFile.exists()) {
 
MIOSStudioSIDGUIXML miosStudioSIDGUIXML = new MIOSStudioSIDGUIXML(
miosStudioSID, MIOSStudioSIDGUIXML.TAG_ROOT_ELEMENT,
true, true, true, true, true);
 
miosStudioSIDGUIXML.loadXML(configFile);
 
this.miosStudioSIDGUI = (MIOSStudioSIDGUI) miosStudioSIDGUIXML
.getMiosStudioGUI();
 
configFile.delete();
}
}
 
if (miosStudioSIDGUI == null) {
101,9 → 126,23
 
public void destroy() {
 
File configFile = new File(System.getProperty("user.home"),
configFileName);
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (!configDirectory.exists()) {
 
try {
 
configDirectory.mkdir();
 
} catch (Exception e) {
 
e.printStackTrace();
}
}
 
if (!configFile.exists()) {
 
try {
/trunk/java/VirtualKeyboard.java
28,24 → 28,24
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.prefs.Preferences;
 
import javax.swing.JApplet;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.UIManager;
 
import org.midibox.apps.virtualkeyboard.gui.VirtualKeyboardGUI;
import org.midibox.apps.virtualkeyboard.gui.xml.VirtualKeyboardGUIXML;
import org.midibox.apps.virtualkeyboard.xml.VirtualKeyboardXML;
import org.midibox.utils.gui.DialogOwner;
import org.midibox.utils.gui.ImageLoader;
 
public class VirtualKeyboard extends JApplet {
 
final static String configFileName = ".virtualkeyboard";
final static String oldConfigFileName = ".virtualkeyboard";
 
final static String configDirectoryName = ".midibox";
 
final static String configFileName = "virtualkeyboard.xml";
 
private org.midibox.apps.virtualkeyboard.VirtualKeyboard virtualKeyboard;
 
private VirtualKeyboardGUI virtualKeyboardGUI;
54,9 → 54,11
 
virtualKeyboard = new org.midibox.apps.virtualkeyboard.VirtualKeyboard();
 
File configFile = new File(System.getProperty("user.home"),
configFileName);
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (configFile.exists()) {
 
VirtualKeyboardGUIXML virtualKeyboardGUIXML = new VirtualKeyboardGUIXML(
63,15 → 65,34
virtualKeyboard, VirtualKeyboardGUIXML.TAG_ROOT_ELEMENT);
 
virtualKeyboardGUIXML.loadXML(configFile);
 
virtualKeyboardGUI = virtualKeyboardGUIXML.getVirtualKeyboardGUI();
 
} else {
 
// check for old config file
 
configFile = new File(System.getProperty("user.home"),
oldConfigFileName);
 
if (configFile.exists()) {
 
VirtualKeyboardGUIXML virtualKeyboardGUIXML = new VirtualKeyboardGUIXML(
virtualKeyboard, VirtualKeyboardGUIXML.TAG_ROOT_ELEMENT);
 
virtualKeyboardGUIXML.loadXML(configFile);
 
virtualKeyboardGUI = virtualKeyboardGUIXML
.getVirtualKeyboardGUI();
 
configFile.delete();
}
}
if (virtualKeyboardGUI == null) {
 
if (virtualKeyboardGUI == null) {
virtualKeyboardGUI = new VirtualKeyboardGUI(virtualKeyboard);
}
 
getContentPane().add(virtualKeyboardGUI);
 
setJMenuBar(virtualKeyboardGUI.createMenuBar());
82,14 → 103,32
}
 
public void destroy() {
File configFile = new File(System.getProperty("user.home"),
configFileName);
 
File configDirectory = new File(System.getProperty("user.home"),
configDirectoryName);
 
File configFile = new File(configDirectory, configFileName);
 
if (!configDirectory.exists()) {
 
try {
 
configDirectory.mkdir();
 
} catch (Exception e) {
 
e.printStackTrace();
}
}
 
if (!configFile.exists()) {
 
try {
 
configFile.createNewFile();
 
} catch (Exception e) {
 
e.printStackTrace();
}
}
107,11 → 146,11
public static void main(String[] args) {
 
final JFrame frame = new JFrame("Virtual Keyboard");
 
DialogOwner.setFrame(frame);
 
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
 
final VirtualKeyboard virtualKeyboardGUI = new VirtualKeyboard();
 
virtualKeyboardGUI.init();
131,7 → 170,7
 
exitMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
 
virtualKeyboardGUI.destroy();
 
System.exit(0);
138,8 → 177,7
}
});
 
virtualKeyboardGUI.virtualKeyboardGUI.getFileMenu().add(
exitMenuItem);
virtualKeyboardGUI.virtualKeyboardGUI.getFileMenu().add(exitMenuItem);
 
virtualKeyboardGUI.virtualKeyboardGUI.getMidiDeviceRoutingGUI()
.addComponentListener(new ComponentAdapter() {
154,7 → 192,7
 
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
 
virtualKeyboardGUI.destroy();
 
System.exit(0);
/trunk/java/org/midibox/utils/gui/SplitButton.java
1,7 → 1,6
package org.midibox.utils.gui;
 
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/trunk/java/org/midibox/midi/gui/MidiFilterGUI.java
58,7 → 58,6
import org.midibox.midi.MidiFilter;
import org.midibox.midi.MidiUtils;
import org.midibox.midi.xml.MidiFilterXML;
import org.midibox.mios.gui.HexFileUploadGUI;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.SimpleFileChooserFilter;
import org.midibox.utils.gui.SplitButton;
/trunk/java/org/midibox/apps/miosstudio/MIOSStudio.java
25,7 → 25,6
import java.util.Observer;
 
import javax.sound.midi.MidiDevice;
import javax.sound.midi.ShortMessage;
 
import org.midibox.midi.MidiDeviceManager;
import org.midibox.midi.MidiDeviceRouting;
/trunk/java/org/midibox/apps/miosstudio/gui/MIOSStudioGUI.java
46,7 → 46,6
import java.util.Vector;
 
import javax.swing.Box;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
64,7 → 63,6
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.JToolBar;
/trunk/java/org/midibox/apps/virtualkeyboard/gui/xml/VirtualKeyboardGUIXML.java
1,12 → 1,10
package org.midibox.apps.virtualkeyboard.gui.xml;
 
import java.awt.Dimension;
import java.awt.Point;
 
import javax.swing.JFrame;
import javax.swing.UIManager;
 
import org.midibox.apps.miosstudio.xml.MIOSStudioXML;
import org.midibox.apps.virtualkeyboard.VirtualKeyboard;
import org.midibox.apps.virtualkeyboard.gui.VirtualKeyboardGUI;
import org.midibox.apps.virtualkeyboard.xml.VirtualKeyboardXML;
/trunk/java/org/midibox/apps/virtualkeyboard/gui/VirtualKeyboardGUI.java
27,7 → 27,6
 
import javax.swing.BorderFactory;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
36,7 → 35,6
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
 
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
import org.midibox.apps.virtualkeyboard.VirtualKeyboard;
import org.midibox.midi.MidiRouterDevice;
import org.midibox.midi.gui.MidiDeviceRoutingGUI;
/trunk/java/org/midibox/mios/gui/HexFileUploadGUI.java
65,7 → 65,6
import javax.swing.text.StyleContext;
import javax.swing.text.StyledDocument;
 
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
import org.midibox.mios.HexFileUpload;
import org.midibox.utils.gui.HexFormatterFactory;
import org.midibox.utils.gui.ImageLoader;