[Patchanim-commit] SF.net SVN: patchanim: [229] trunk/patchanim/src/com/mebigfatguy/patchanim/ gui/
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-02-24 03:07:04
|
Revision: 229
http://patchanim.svn.sourceforge.net/patchanim/?rev=229&view=rev
Author: dbrosius
Date: 2008-02-23 19:07:09 -0800 (Sat, 23 Feb 2008)
Log Message:
-----------
show new dialog on start
Modified Paths:
--------------
trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java
Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 02:52:12 UTC (rev 228)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 03:07:09 UTC (rev 229)
@@ -185,21 +185,7 @@
}
}
- NewDocumentDialog newDialog = new NewDocumentDialog();
- newDialog.setModal(true);
- newDialog.setLocationRelativeTo(JPatchAnimFrame.this);
- newDialog.setVisible(true);
-
- int order = newDialog.getOrder();
- boolean useAlpha = newDialog.useAlpha();
-
- document = new PatchAnimDocument(order, useAlpha);
- documentLocation = null;
- saveItem.setEnabled(false);
- PatchPanelMediator mediator = PatchPanelMediator.getMediator();
- mediator.setDocument(document);
- String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), rb.getString(PatchAnimBundle.UNTITLED));
- setTitle(title);
+ newDocument();
} catch (IOException ioe) {
JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED));
}
@@ -328,6 +314,31 @@
});
}
+ @Override
+ public void setVisible(boolean show) {
+ newDocument();
+ super.setVisible(show);
+ }
+
+ private void newDocument() {
+ ResourceBundle rb = PatchAnimBundle.getBundle();
+ NewDocumentDialog newDialog = new NewDocumentDialog();
+ newDialog.setModal(true);
+ newDialog.setLocationRelativeTo(JPatchAnimFrame.this);
+ newDialog.setVisible(true);
+
+ int order = newDialog.getOrder();
+ boolean useAlpha = newDialog.useAlpha();
+
+ document = new PatchAnimDocument(order, useAlpha);
+ documentLocation = null;
+ saveItem.setEnabled(false);
+ PatchPanelMediator mediator = PatchPanelMediator.getMediator();
+ mediator.setDocument(document);
+ String title = MessageFormat.format(rb.getString(PatchAnimBundle.NAMEDTITLE), rb.getString(PatchAnimBundle.UNTITLED));
+ setTitle(title);
+ }
+
private void load() {
try {
JFileChooser chooser = new JFileChooser();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|