src/org/gel/mauve/MyConsole.java

Go to the documentation of this file.
00001 package org.gel.mauve;
00002 
00003 import gr.zeus.ui.JConsole;
00004 
00005 
00006 import java.awt.Dimension;
00007 import java.awt.Toolkit;
00008 import java.io.PrintStream;
00009 
00010 public class MyConsole {
00011         private static boolean useSwing = false;
00012 
00013         private static JConsole console;
00014 
00015         public static void setUseSwing (boolean b) {
00016                 if (b && !useSwing) {
00017                         console = JConsole.getConsole ();
00018                         console.setTitle ("Mauve Console");
00019                         console.setSize (400, 400);
00020                         Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
00021                         console.setLocation(dim.width-400, 0);
00022                         console.startConsole ();
00023                 } else if (!b && useSwing) {
00024                         console.stopConsole ();
00025                         console = null;
00026                 }
00027 
00028                 useSwing = b;
00029         }
00030 
00031         public static void showConsole () {
00032                 if (useSwing) {
00033                         console.showConsole ();
00034                 }
00035         }
00036 
00037         public static PrintStream err () {
00038                 if (useSwing) {
00039                         console.showConsole ();
00040                 }
00041                 return System.err;
00042         }
00043 
00044         public static PrintStream out () {
00045                 return System.out;
00046         }
00047 }

Generated on Mon Aug 19 06:03:43 2013 for Mauve by doxygen 1.3.6