MoppyDesk: strip unneeded stuff and import Apache commons cli

* themidibus.jar is never used
* MoppyUI is modified to work with standard Java

* MoppyMainWindow.form is deleted because it is without use in
* non-netbeans environments anyway

* apache commons cli will be used for a command line interface
This commit is contained in:
Alexander Weinhold 2013-12-18 00:07:53 +01:00
parent 2514a62bc8
commit 0e795a21e9
7 changed files with 12 additions and 370 deletions

3
.gitignore vendored
View File

@ -1,5 +1,8 @@
/Java/MoppyDesk/nbproject/private/
/Java/MoppyDesk/build/
/Java/MoppyDesk/dist/
.classpath
.project
*bin/
midicomp
*.o

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,363 +0,0 @@
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" value="MoppyDesk"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[480, 410]"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="windowClosing"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jTabbedPane1" alignment="0" max="32767" attributes="0"/>
<Component id="statusLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jSeparator1" alignment="1" pref="461" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="comSelectionMenu" min="-2" pref="79" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="comSelectionMenu" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="jTabbedPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="8" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="statusLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="comSelectionMenu">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="name" type="java.lang.String" value="comSelectionMenu" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comPortSelected"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="statusLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Loading application..."/>
<Property name="name" type="java.lang.String" value="statusLabel" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
<Properties>
<Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/>
</Properties>
</Component>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Properties>
<Property name="name" type="java.lang.String" value="bridgePanel" noResource="true"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Bridge" noResource="true"/>
</AccessibilityProperties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="name" type="java.lang.String" value="sequencerPanel" noResource="true"/>
</Properties>
<Events>
<EventHandler event="componentHidden" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="seqTabHidden"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Sequencer">
<Property name="tabTitle" type="java.lang.String" value="Sequencer"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="sequencerControlsPanel" pref="436" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Component id="jSeparator2" alignment="1" pref="456" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="connectSeqButton" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="373" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="connectSeqButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jSeparator2" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="sequencerControlsPanel" min="-2" pref="187" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="sequencerControlsPanel">
<Properties>
<Property name="name" type="java.lang.String" value="sequencerControlsPanel" noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 200]"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sequenceNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="220" max="32767" attributes="0"/>
<Component id="loadButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jSlider1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="66" max="32767" attributes="0"/>
<Component id="startButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="stopButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="136" max="-2" attributes="0"/>
<Component id="bpmLabel" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="sequenceNameLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="loadButton" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="100" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="stopButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="startButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jSlider1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="bpmLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="54" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Current Sequence:"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="sequenceNameLabel">
<Properties>
<Property name="text" type="java.lang.String" value="&lt;None loaded&gt;"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="sequenceNameLabel" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="startButton">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="startButton" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="startButtonClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="stopButton">
<Properties>
<Property name="text" type="java.lang.String" value="Stop/Reset"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="stopButton" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="stopResetClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="loadButton">
<Properties>
<Property name="text" type="java.lang.String" value="Load Sequence"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="loadButton" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loadSequence"/>
</Events>
</Component>
<Component class="javax.swing.JSlider" name="jSlider1">
<Properties>
<Property name="majorTickSpacing" type="int" value="10"/>
<Property name="maximum" type="int" value="210"/>
<Property name="minimum" type="int" value="20"/>
<Property name="paintTicks" type="boolean" value="true"/>
<Property name="value" type="int" value="120"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="jSlider1" noResource="true"/>
</Properties>
<Events>
<EventHandler event="mouseDragged" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="tempoSliderChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="bpmLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="jSlider1.getValue() + &quot; bpm&quot;" type="code"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="bpmLabel" noResource="true"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="jSlider1.getValue() + &quot; bpm&quot;" type="code"/>
</Property>
</AccessibilityProperties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JSeparator" name="jSeparator2">
<Properties>
<Property name="name" type="java.lang.String" value="jSeparator2" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="connectSeqButton">
<Properties>
<Property name="text" type="java.lang.String" value="Connect"/>
<Property name="toolTipText" type="java.lang.String" value="Attempts to open selected COM port."/>
<Property name="name" type="java.lang.String" value="connectSequencerButton" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="connectSequencerPressed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="name" type="java.lang.String" value="jPanel2" noResource="true"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Bridge">
<Property name="tabTitle" type="java.lang.String" value="Bridge"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="333" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="229" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Coming soon... (sorry!)"/>
<Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Arduino Port:"/>
<Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@ -4,27 +4,29 @@
*/
package moppydesk;
import org.jdesktop.application.SingleFrameApplication;
/**
*
* @author Sam
*/
public class MoppyUI extends SingleFrameApplication{
public class MoppyUI {
MoppySequencer ms = null;
@Override
protected void startup() {
MoppyMainWindow mainWindow = new MoppyMainWindow(this);
show(mainWindow);
MoppyUI instance = null;
public MoppyUI() {
MoppyMainWindow mainWindow = new MoppyMainWindow(this);
mainWindow.setVisible(true);
}
/**
* Main method launching the application.
*/
public static void main(String[] args) {
launch(MoppyUI.class, args);
new MoppyUI();
}
}