Search in sources :

Example 1 with LoggingClient

use of com.cosylab.logging.LoggingClient in project ACS by ACS-Community.

the class LogFrame method initialize.

/**
	 * Initialize the content of the frame
	 *
	 * @param discardLevel The discard level
	 * @param unlimited If <code>true</code> the number of logs in memory is unlimited, 
	 *                  otherwise the default is used
	 * @param aInfo The audience
	 */
private void initialize(LogTypeHelper discardLevel, boolean unlimited, AudienceInfo aInfo) {
    setTitle("LoggingClient");
    addWindowListener(this);
    // Set the icon
    ImageIcon image = new ImageIcon(LogFrame.class.getResource("/alma.png"));
    setIconImage(image.getImage());
    // build the LoggingClient
    loggingClient = new LoggingClient(this, LoggingClient.DEFAULT_LOGLEVEL, discardLevel, unlimited, aInfo);
    if (loggingClient == null) {
        throw new NullPointerException("The logging client is null");
    }
    this.setRootPane(loggingClient);
    // Enable the exit menu
    loggingClient.hideExitMenu(false);
    // Move the window to the center of the screen 
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension windowSize = getSize();
    setLocation(Math.max(0, (screenSize.width - windowSize.width) / 2), Math.max(0, (screenSize.height - windowSize.height) / 2));
    pack();
    setVisible(true);
}
Also used : ImageIcon(javax.swing.ImageIcon) LoggingClient(com.cosylab.logging.LoggingClient) Dimension(java.awt.Dimension)

Aggregations

LoggingClient (com.cosylab.logging.LoggingClient)1 Dimension (java.awt.Dimension)1 ImageIcon (javax.swing.ImageIcon)1