import java.awt.TextArea;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
/**
* The addOn_systemMessagesFrame class represents the system messages of the communication.
* Here all messages are shown.
*
* @author (c) Copyright 2009 by authors: Sven Weber, Dr. The Anh Vuong
*
*/
public class addOn_systemMessageFrame extends JFrame{
/** The serial version UID. */
private static final long serialVersionUID = -8071159513512191768L;
/** The text field for the system messages. */
static TextArea system;
/** A value for the actual instance. */
static JFrame frame;
/**
* The constructor defines the layout.
*/
public addOn_systemMessageFrame() {
system = new TextArea(30,30);
system.setEditable(false);
add(system);
frame = this;
}
/**
* The init method.
*/
public void init() {
setTitle("Systemmessages");
setBounds((getToolkit().getScreenSize().width)-250,200,250,300);
setVisible(true);
//setAlwaysOnTop(true);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVis(false);
interface_MainFrame.setMenuCheckBox(1,false);
}
}
);
}
/**
* Displays several messages in the system field.
*
* @param msg The message which should be displayed.
*/
public static void saySys(String msg) {
system.append(msg);
}
/**
* Sets the frame to invisible or not.
*
* @param value False for invisible, true for not.
*/
public static void setVis(boolean value) {
frame.setVisible(value);
}
}