Skip to content
Snippets Groups Projects
Commit c3e7f207 authored by tjc's avatar tjc
Browse files

allow hide on closing rather than dispose

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@5878 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent fa4754eb
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/FileViewer.java,v 1.12 2007-04-10 12:19:27 tjc Exp $ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/FileViewer.java,v 1.13 2007-04-10 13:39:38 tjc Exp $
*/ */
package uk.ac.sanger.artemis.components; package uk.ac.sanger.artemis.components;
...@@ -59,7 +59,7 @@ import uk.ac.sanger.artemis.Options; ...@@ -59,7 +59,7 @@ import uk.ac.sanger.artemis.Options;
* be viewed. * be viewed.
* *
* @author Kim Rutherford * @author Kim Rutherford
* @version $Id: FileViewer.java,v 1.12 2007-04-10 12:19:27 tjc Exp $ * @version $Id: FileViewer.java,v 1.13 2007-04-10 13:39:38 tjc Exp $
* *
**/ **/
...@@ -90,6 +90,8 @@ public class FileViewer extends JFrame ...@@ -90,6 +90,8 @@ public class FileViewer extends JFrame
**/ **/
private static Point saved_position = null; private static Point saved_position = null;
private boolean isHideOnClose = false;
/** /**
* Create a new FileViewer component and make it visible. * Create a new FileViewer component and make it visible.
* @param label The name to attach to the new JFrame. * @param label The name to attach to the new JFrame.
...@@ -152,9 +154,10 @@ public class FileViewer extends JFrame ...@@ -152,9 +154,10 @@ public class FileViewer extends JFrame
{ {
public void actionPerformed(ActionEvent e) public void actionPerformed(ActionEvent e)
{ {
saved_size = getSize(); if(isHideOnClose())
saved_position = getLocation(); setVisible(false);
dispose(); else
dispose();
} }
}); });
button_panel.add(close_button); button_panel.add(close_button);
...@@ -163,9 +166,10 @@ public class FileViewer extends JFrame ...@@ -163,9 +166,10 @@ public class FileViewer extends JFrame
{ {
public void windowClosing(WindowEvent event) public void windowClosing(WindowEvent event)
{ {
saved_size = getSize(); if(isHideOnClose())
saved_position = getLocation(); setVisible(false);
dispose(); else
dispose();
} }
}); });
...@@ -377,4 +381,14 @@ public class FileViewer extends JFrame ...@@ -377,4 +381,14 @@ public class FileViewer extends JFrame
{ {
return textPane; return textPane;
} }
public boolean isHideOnClose()
{
return isHideOnClose;
}
public void setHideOnClose(boolean isHideOnClose)
{
this.isHideOnClose = isHideOnClose;
}
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/Splash.java,v 1.26 2007-03-22 14:18:09 tjc Exp $ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/Splash.java,v 1.27 2007-04-10 13:39:38 tjc Exp $
*/ */
package uk.ac.sanger.artemis.components; package uk.ac.sanger.artemis.components;
...@@ -48,7 +48,7 @@ import java.util.Properties; ...@@ -48,7 +48,7 @@ import java.util.Properties;
* Base class that creates a generic "Splash Screen" * Base class that creates a generic "Splash Screen"
* *
* @author Kim Rutherford <kmr@sanger.ac.uk> * @author Kim Rutherford <kmr@sanger.ac.uk>
* @version $Id: Splash.java,v 1.26 2007-03-22 14:18:09 tjc Exp $ * @version $Id: Splash.java,v 1.27 2007-04-10 13:39:38 tjc Exp $
**/ **/
abstract public class Splash extends JFrame abstract public class Splash extends JFrame
...@@ -220,6 +220,8 @@ abstract public class Splash extends JFrame ...@@ -220,6 +220,8 @@ abstract public class Splash extends JFrame
public static void initLogger() public static void initLogger()
{ {
logger.log("");
logger.getFileViewer().setHideOnClose(true);
final InputStream options_input_stream = final InputStream options_input_stream =
Splash.class.getResourceAsStream("/etc/log4j.properties"); Splash.class.getResourceAsStream("/etc/log4j.properties");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment