Skip to content

Commit

Permalink
Update version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Retera committed Dec 6, 2022
1 parent 30aa0ee commit 53da991
Showing 1 changed file with 86 additions and 45 deletions.
131 changes: 86 additions & 45 deletions matrixeater/src/com/matrixeater/src/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,33 @@ public static void main(final String[] args) {
final boolean hasArgs = args.length >= 1;
final List<String> startupModelPaths = new ArrayList<>();
if (hasArgs) {
if (args.length > 1 && args[0].equals("-convert")) {
if ((args.length > 1) && args[0].equals("-convert")) {
final String path = args[1];
final EditableModel model = EditableModel.read(new File(path));
if (path.toLowerCase().endsWith(".mdx")) {
model.printTo(new File(path.substring(0, path.lastIndexOf('.')) + ".mdl"));
} else if (path.toLowerCase().endsWith(".mdl")) {
}
else if (path.toLowerCase().endsWith(".mdl")) {
model.printTo(new File(path.substring(0, path.lastIndexOf('.')) + ".mdx"));
} else {
}
else {
// Unfortunately obj convert does popups right now
final Build builder = new Build();
try {
final Parse obj = new Parse(builder, path);
final EditableModel mdl = builder.createMDL();
} catch (final FileNotFoundException e) {
}
catch (final FileNotFoundException e) {
ExceptionPopup.display(e);
e.printStackTrace();
} catch (final IOException e) {
}
catch (final IOException e) {
ExceptionPopup.display(e);
e.printStackTrace();
}
}
} else if (args[0].endsWith(".mdx") || args[0].endsWith(".mdl") || args[0].endsWith(".blp")
}
else if (args[0].endsWith(".mdx") || args[0].endsWith(".mdl") || args[0].endsWith(".blp")
|| args[0].endsWith(".dds") || args[0].endsWith(".obj")) {
for (final String arg : args) {
startupModelPaths.add(arg);
Expand All @@ -90,7 +95,7 @@ public static void main(final String[] args) {
final boolean dataPromptForced = hasArgs && args[0].equals("-forcedataprompt");
try {
final ProgramPreferences preferences = SaveProfile.get().getPreferences();
if (preferences.getDisableDirectXToSolveVisualArtifacts() != null
if ((preferences.getDisableDirectXToSolveVisualArtifacts() != null)
&& preferences.getDisableDirectXToSolveVisualArtifacts()) {
System.setProperty("sun.java2d.opengl", "True");
}
Expand Down Expand Up @@ -136,7 +141,8 @@ public static void main(final String[] args) {
theme.setDesktopColor(new Color(60, 82, 44));

UIManager.setLookAndFeel(new InfoNodeLookAndFeel(theme));
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
break;
Expand All @@ -149,7 +155,8 @@ public static void main(final String[] args) {
theme.setDesktopColor(new Color(82, 60, 44));

UIManager.setLookAndFeel(new InfoNodeLookAndFeel(theme));
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
break;
Expand All @@ -158,29 +165,38 @@ public static void main(final String[] args) {
UIManager.put("desktop", new ColorUIResource(Color.WHITE));
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
System.out.println(UIManager.getLookAndFeel());
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
// handle exception
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
// handle exception
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
// handle exception
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
// handle exception
}
break;
case WINDOWS_CLASSIC:
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
} catch (final Exception exc) {
}
catch (final Exception exc) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
Expand All @@ -201,16 +217,21 @@ public static void main(final String[] args) {
try {
final InfoNodeLookAndFeelTheme softGrayTheme = InfoNodeLookAndFeelThemes.getSoftGrayTheme();
UIManager.setLookAndFeel(new InfoNodeLookAndFeel(softGrayTheme));
} catch (final Exception exc) {
}
catch (final Exception exc) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
Expand All @@ -220,16 +241,21 @@ public static void main(final String[] args) {
try {
final InfoNodeLookAndFeelTheme blueIceTheme = InfoNodeLookAndFeelThemes.getBlueIceTheme();
UIManager.setLookAndFeel(new InfoNodeLookAndFeel(blueIceTheme));
} catch (final Exception exc) {
}
catch (final Exception exc) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
Expand All @@ -240,16 +266,21 @@ public static void main(final String[] args) {
final InfoNodeLookAndFeelTheme darkBlueGreenTheme = InfoNodeLookAndFeelThemes
.getDarkBlueGreenTheme();
UIManager.setLookAndFeel(new InfoNodeLookAndFeel(darkBlueGreenTheme));
} catch (final Exception exc) {
}
catch (final Exception exc) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
Expand All @@ -259,16 +290,21 @@ public static void main(final String[] args) {
try {
final InfoNodeLookAndFeelTheme grayTheme = InfoNodeLookAndFeelThemes.getGrayTheme();
UIManager.setLookAndFeel(new InfoNodeLookAndFeel(grayTheme));
} catch (final Exception exc) {
}
catch (final Exception exc) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final ClassNotFoundException e) {
}
catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
}
catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
}
catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final UnsupportedLookAndFeelException e) {
}
catch (final UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
Expand All @@ -280,7 +316,7 @@ public static void main(final String[] args) {
public void run() {
try {
final List<DataSourceDescriptor> dataSources = SaveProfile.get().getDataSources();
if (dataSources == null || dataPromptForced) {
if ((dataSources == null) || dataPromptForced) {
final DataSourceChooserPanel dataSourceChooserPanel = new DataSourceChooserPanel(
dataSources);
// JF
Expand All @@ -299,7 +335,8 @@ public void run() {
JOptionPane.PLAIN_MESSAGE) != JOptionPane.OK_OPTION) {
return;
}
} finally {
}
finally {
jFrame.setVisible(false);
}
SaveProfile.get().setDataSources(dataSourceChooserPanel.getDataSourceDescriptors());
Expand All @@ -315,14 +352,15 @@ public void run() {
}

JPopupMenu.setDefaultLightWeightPopupEnabled(false);
frame = new MainFrame("Retera Model Studio v0.04.4d");
frame = new MainFrame("Retera Model Studio v0.04.4e");
panel.init();
if (!startupModelPaths.isEmpty()) {
for (final String path : startupModelPaths) {
panel.openFile(new File(path));
}
}
} catch (final Throwable th) {
}
catch (final Throwable th) {
th.printStackTrace();
ExceptionPopup.display(th);
if (!dataPromptForced) {
Expand All @@ -332,7 +370,8 @@ public void run() {
main(new String[] { "-forcedataprompt" });
}
}).start();
} else {
}
else {
JOptionPane.showMessageDialog(null,
"Retera Model Studio startup sequence has failed for two attempts. The program will now exit.",
"Error", JOptionPane.ERROR_MESSAGE);
Expand All @@ -341,7 +380,8 @@ public void run() {
}
}
});
} catch (final Throwable th) {
}
catch (final Throwable th) {
th.printStackTrace();
SwingUtilities.invokeLater(new Runnable() {
@Override
Expand All @@ -351,7 +391,8 @@ public void run() {
});
if (!dataPromptForced) {
main(new String[] { "-forcedataprompt" });
} else {
}
else {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 53da991

Please sign in to comment.