Skip to content

Commit

Permalink
Update version label
Browse files Browse the repository at this point in the history
  • Loading branch information
Retera committed Jul 18, 2022
1 parent 8fe48dd commit 348c2d9
Showing 1 changed file with 88 additions and 49 deletions.
137 changes: 88 additions & 49 deletions matrixeater/src/com/matrixeater/src/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,36 @@ 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")
|| args[0].endsWith(".dds") || args[0].endsWith(".obj")) {
for (final String arg : args) {
startupModelPaths.add(arg);
}
}
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 Down Expand Up @@ -134,7 +137,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 @@ -147,7 +151,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 @@ -156,29 +161,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 @@ -199,16 +213,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 @@ -218,16 +237,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 @@ -238,16 +262,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 @@ -257,16 +286,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 @@ -278,7 +312,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 @@ -297,7 +331,8 @@ public void run() {
JOptionPane.PLAIN_MESSAGE) != JOptionPane.OK_OPTION) {
return;
}
} finally {
}
finally {
jFrame.setVisible(false);
}
SaveProfile.get().setDataSources(dataSourceChooserPanel.getDataSourceDescriptors());
Expand All @@ -313,14 +348,15 @@ public void run() {
}

JPopupMenu.setDefaultLightWeightPopupEnabled(false);
frame = new MainFrame("Demon Retera Model Studio v0.04.3");
frame = new MainFrame("Demon Retera Model Studio v0.04.4");
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 @@ -330,7 +366,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 @@ -339,7 +376,8 @@ public void run() {
}
}
});
} catch (final Throwable th) {
}
catch (final Throwable th) {
th.printStackTrace();
SwingUtilities.invokeLater(new Runnable() {
@Override
Expand All @@ -349,7 +387,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 348c2d9

Please sign in to comment.