Search in sources :

Example 1 with LogToolBar

use of alma.acs.logging.dialogs.main.LogToolBar in project ACS by ACS-Community.

the class LoggingClient method initialize.

/**
	 * Initializes the object.
	 * 
	 * @param logLevel The initial log level to set in the toolbar and in the table
	 * @param discardLevel The initial discard level to set in the toolbar and in the engine
	 * @param unlimited If <code>true</code> the number of logs in memory is unlimited, 
	 *                  otherwise the default is used
	 */
private void initialize(LogTypeHelper logLevel, LogTypeHelper discardLevel, boolean unlimited) {
    try {
        setName("LoggingClientPanel");
        messageTextArea = new ExtendedTextArea();
        // Set the glass pane showing errors and messages to be acknowledged
        glassPane = new TransparentGlassPane(getContentPane());
        setGlassPane(glassPane);
        // We want to be notified when the user presses the Ok button
        // of the MessageWidget
        errorWidget.addAckListener(this);
        // Set the tooltip manager
        ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
        toolTipManager.setDismissDelay(60000);
        Dimension d = new Dimension(750, 550);
        setPreferredSize(d);
        getContentPane().setLayout(new BorderLayout());
        setJMenuBar(menuBar);
        //  Add the GUI in the center position
        getContentPane().add(getJFrameContentPane(), BorderLayout.CENTER);
        // The panel having the toolbars on top and the panel showing errors at the bottom
        JPanel northPanel = new JPanel(new BorderLayout());
        // Add the toolbars to the toolbarsPanel
        JPanel toolbarsPanel = new JPanel();
        BoxLayout toolbarLayout = new BoxLayout(toolbarsPanel, BoxLayout.Y_AXIS);
        toolbarsPanel.setLayout(toolbarLayout);
        toolBar = new LogToolBar(logLevel, discardLevel);
        boolean zoomAvailable = zoom.isAvailable();
        toolBar.setZoomable(zoomAvailable);
        menuBar.getManualZoomMI().setEnabled(zoomAvailable);
        toolbarsPanel.add(toolBar);
        navigationToolbar = new LogNavigationBar(getLogEntryTable());
        toolbarsPanel.add(navigationToolbar);
        northPanel.add(toolbarsPanel, BorderLayout.NORTH);
        northPanel.add(errorWidget, BorderLayout.SOUTH);
        getContentPane().add(northPanel, BorderLayout.NORTH);
        initConnections();
        validate();
        getLogEntryTable().setLogLevel((LogTypeHelper) toolBar.getLogLevelCB().getSelectedItem());
        if (unlimited) {
            userPreferences.setMaxLogs(0);
        }
        getLCModel1().setTimeFrame(userPreferences.getMillisecondsTimeFrame());
        getLCModel1().setMaxLog(userPreferences.getMaxNumOfLogs());
        archive = new ArchiveConnectionManager(this);
        setTableFilterLbl();
        setEngineFilterLbl();
        setNumberOfLogsLbl();
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
    getTableDetailsVrPane().setDividerLocation(getTableDetailsVrPane().getLastDividerLocation());
    //getHeight() - 150);
    getStatusAreaHrPane().setDividerLocation(350);
}
Also used : JPanel(javax.swing.JPanel) LogToolBar(alma.acs.logging.dialogs.main.LogToolBar) ToolTipManager(javax.swing.ToolTipManager) ArchiveConnectionManager(alma.acs.logging.archive.ArchiveConnectionManager) BoxLayout(javax.swing.BoxLayout) LogNavigationBar(alma.acs.logging.dialogs.main.LogNavigationBar) ExtendedTextArea(alma.acs.gui.widgets.ExtendedTextArea) Dimension(java.awt.Dimension) BorderLayout(java.awt.BorderLayout)

Aggregations

ExtendedTextArea (alma.acs.gui.widgets.ExtendedTextArea)1 ArchiveConnectionManager (alma.acs.logging.archive.ArchiveConnectionManager)1 LogNavigationBar (alma.acs.logging.dialogs.main.LogNavigationBar)1 LogToolBar (alma.acs.logging.dialogs.main.LogToolBar)1 BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 BoxLayout (javax.swing.BoxLayout)1 JPanel (javax.swing.JPanel)1 ToolTipManager (javax.swing.ToolTipManager)1