Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
1. netbeans default exception log string is null, that means it will never
actually log anything, I changed these cases to print the exception name

2. make the interface resize to accomodate the tabs

3. progress bar wasn't showing when the program starts without config.vl

4. add generics to combo_dirs, to stop the compiler from complaining

5. deleted sources/libs that are no longer used because fmod does the work now
  • Loading branch information
chaosfox committed Nov 18, 2012
1 parent 1aff574 commit f555b4a
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 950 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- java 1.6

- lwjgl 2.8.5 , lwjgl.org ( BSD License)
- jorbis 0.0.17 , www.jcraft.com/jorbis ( GNU LGPL)
- jChardet 1.1, jchardet.sourceforge.net ( MOZILLA PUBLIC LICENSE)
- voile, github.com/chaosfox/voile
- NativeFmodEx, jerome.jouvie.free.fr/nativefmodex (binding LGPL & lib FMOD Non-Commercial License - fmod.com/fmod-sales.html)

Binary file removed lib/jlayer-1.0.1-libgdx.jar
Binary file not shown.
Binary file removed lib/jorbis.jar
Binary file not shown.
4 changes: 0 additions & 4 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ endorsed.classpath=
excludes=
file.reference.chardet.jar=lib/chardet.jar
file.reference.jinput.jar=lib\\jinput.jar
file.reference.jlayer-1.0.1-libgdx.jar=lib/jlayer-1.0.1-libgdx.jar
file.reference.jna-3.4.0.jar=lib/jna-3.4.0.jar
file.reference.jorbis.jar=lib\\jorbis.jar
file.reference.lwjgl.jar=lib\\lwjgl.jar
file.reference.lwjgl_util.jar=lib\\lwjgl_util.jar
file.reference.lzma.jar=lib\\lzma.jar
Expand All @@ -45,7 +43,6 @@ jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.jinput.jar}:\
${file.reference.jorbis.jar}:\
${file.reference.lwjgl.jar}:\
${file.reference.lwjgl_util.jar}:\
${file.reference.lzma.jar}:\
Expand All @@ -54,7 +51,6 @@ javac.classpath=\
${file.reference.vlcj-2.0.0.jar}:\
${file.reference.chardet.jar}:\
${file.reference.voile.jar}:\
${file.reference.jlayer-1.0.1-libgdx.jar}:\
${reference.open2jam-parsers.jar}:\
${file.reference.NativeFmodEx.jar}:\
${file.reference.partytime.jar}
Expand Down
4 changes: 2 additions & 2 deletions parsers/src/org/open2jam/parsers/BMSParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public static EventList parseChart(BMSChart chart)
lines.get(measure).add(line);
}
} catch (IOException ex) {
Logger.global.log(Level.SEVERE, null, ex);
Logger.global.log(Level.SEVERE, "{0}", ex);
}

Iterator<List<String>> it = lines.values().iterator();
Expand Down Expand Up @@ -488,7 +488,7 @@ public static HashMap<Integer, SampleData> getSamples(BMSChart chart)
}
}
} catch (IOException ex) {
Logger.global.log(Level.SEVERE, null, ex);
Logger.global.log(Level.SEVERE, "{0}", ex);
}
}
return samples;
Expand Down
4 changes: 2 additions & 2 deletions parsers/src/org/open2jam/parsers/SMParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static EventList parseChart(SMChart chart)
}
}
} catch (IOException ex) {
Logger.global.log(Level.SEVERE, null, ex);
Logger.global.log(Level.SEVERE, "{0}", ex);
} catch(NoSuchElementException ignored) {}

//add the music
Expand Down Expand Up @@ -341,7 +341,7 @@ public static HashMap<Integer, SampleData> getSamples(SMChart chart)
}
}
} catch (IOException ex) {
Logger.global.log(Level.SEVERE, null, ex);
Logger.global.log(Level.SEVERE, "{0}", ex);
}
}
return samples;
Expand Down
6 changes: 3 additions & 3 deletions parsers/src/org/open2jam/parsers/utils/KrazyRainDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ private void load() {
try {
SAXParserFactory.newInstance().newSAXParser().parse(resources_xml.openStream(), this);
} catch (ParserConfigurationException ex) {
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, "{0}", ex);
}
} catch (SAXException ex) {
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, "{0}", ex);
} catch (IOException ex) {
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(KrazyRainDB.class.getName()).log(Level.SEVERE, "{0}", ex);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/org/open2jam/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ private static GameOptions loadGameOptions() {
Object result = decoder.readObject();
decoder.close();
if (result instanceof GameOptions) return (GameOptions)result;
} catch(FileNotFoundException fnf) {
return null; // thats ok a new file will be created
} catch (IOException ex) {
Logger.getLogger(Config.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(Config.class.getName()).log(Level.SEVERE, "{0}", ex);
}
return null;
}
Expand All @@ -51,7 +53,7 @@ public static void saveGameOptions() {
encoder.writeObject(options);
encoder.close();
} catch (IOException ex) {
Logger.getLogger(GameOptions.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(GameOptions.class.getName()).log(Level.SEVERE, "{0}", ex);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/org/open2jam/gui/Interface.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public Interface() {
Tabs.addTab("Configuration", new Configuration());

this.addWindowListener(this);
pack();
}


Expand Down
3 changes: 3 additions & 0 deletions src/org/open2jam/gui/parts/MusicSelection.form
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="combo_dirsItemStateChanged"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;FileItem&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btn_reload">
<Properties>
Expand Down
10 changes: 5 additions & 5 deletions src/org/open2jam/gui/parts/MusicSelection.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public String toString() {
public MusicSelection() {
initLogic();
initComponents();
load_progress.setVisible(false);

List<File> list = Config.getDirsList();
for(File f : list)combo_dirs.addItem(new FileItem(f));
Expand All @@ -155,7 +156,6 @@ public MusicSelection() {
else
loadDir(cwd);

load_progress.setVisible(false);
table_sorter = new TableRowSorter<ChartListTableModel>(model_songlist);
table_songlist.setRowSorter(table_sorter);
txt_filter.getDocument().addDocumentListener(new DocumentListener() {
Expand Down Expand Up @@ -204,7 +204,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
try {
BMSWriter.export(selected_header, "converted");
} catch (IOException ex) {
java.util.logging.Logger.getLogger(MusicSelection.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(MusicSelection.class.getName()).log(Level.SEVERE, "{0}", ex);
} finally {
System.gc();
}
Expand Down Expand Up @@ -293,7 +293,7 @@ private void initComponents() {
bt_choose_dir = new javax.swing.JButton();
load_progress = new javax.swing.JProgressBar();
jLabel2 = new javax.swing.JLabel();
combo_dirs = new javax.swing.JComboBox();
combo_dirs = new javax.swing.JComboBox<FileItem>();
btn_reload = new javax.swing.JButton();
btn_delete = new javax.swing.JButton();
panel_setting = new javax.swing.JPanel();
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public void autosyncFinished(double audioLatency) {

new RenderThread(this.getTopLevelAncestor(), r).start();
} catch (SoundSystemException ex) {
java.util.logging.Logger.getLogger(MusicSelection.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(MusicSelection.class.getName()).log(Level.SEVERE, "{0}", ex);
}
}//GEN-LAST:event_bt_playActionPerformed

Expand Down Expand Up @@ -1285,7 +1285,7 @@ private void btnCreateServerActionPerformed(java.awt.event.ActionEvent evt) {//G
private javax.swing.JCheckBox cb_autoSyncDisplay;
private javax.swing.JCheckBox cb_startPaused;
private javax.swing.JComboBox combo_channelModifier;
private javax.swing.JComboBox combo_dirs;
private javax.swing.JComboBox<FileItem> combo_dirs;
private javax.swing.JComboBox combo_displays;
private javax.swing.JComboBox combo_speedType;
private javax.swing.JComboBox combo_visibilityModifier;
Expand Down
8 changes: 4 additions & 4 deletions src/org/open2jam/render/Render.java
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public void initialise()
Sprite s = ResourceFactory.get().getSprite(img);
bga_sprites.put(entry.getKey(), s);
} catch (IOException ex) {
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, "{0}", ex);
}
}
}
Expand All @@ -539,12 +539,12 @@ public void initialise()
Sound sound = soundSystem.load(sampleData);
sounds.put(entry.getKey(), sound);
} catch (SoundSystemException ex) {
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, "{0}", ex);
}
try {
entry.getValue().dispose();
} catch (IOException ex) {
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, "{0}", ex);
}
}

Expand Down Expand Up @@ -1088,7 +1088,7 @@ public SoundInstance queueSample(Event.SoundSample soundSample)
return sound.play(soundSample.isBGM() ? SoundChannel.BGM : SoundChannel.KEY,
1.0f, soundSample.pan);
} catch (SoundSystemException ex) {
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, "{0}", ex);
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/open2jam/render/lwjgl/LWJGLGameWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void startRendering()
try {
Display.create();
} catch (LWJGLException ex) {
Logger.global.log(Level.SEVERE, null, ex);
Logger.global.log(Level.SEVERE, "{0}", ex);
callback.windowClosed();
return;
}
Expand Down
154 changes: 0 additions & 154 deletions src/org/open2jam/render/lwjgl/SoundManager.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/org/open2jam/sound/FmodExSoundSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public org.open2jam.sound.Sound load(SampleData data) throws SoundSystemExceptio
try {
data.copyTo(out);
} catch (IOException ex) {
Logger.getLogger(FmodExSoundSystem.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(FmodExSoundSystem.class.getName()).log(Level.SEVERE, "{0}", ex);
return null;
}

Expand Down
Loading

0 comments on commit f555b4a

Please sign in to comment.