Search in sources :

Example 1 with AlarmTableModel

use of alma.acsplugins.alarmsystem.gui.table.AlarmTableModel in project ACS by ACS-Community.

the class CernSysPanel method initialize.

/**
	 * Init the GUI
	 *
	 */
private void initialize(UndocAlarmTableModel undocModel) {
    setLayout(new BorderLayout());
    // Build GUI objects
    model = new AlarmTableModel(this, ACTIVATE_RDUCTION_RULES, false, undocModel);
    model.start();
    alarmSound = new AlarmSound(model);
    statusLine = new StatusLine(model, this);
    alarmTable = new AlarmTable(model, this, undocModel, statusLine);
    connectionListener = statusLine;
    model.setConnectionListener(statusLine);
    detailTable = new AlarmDetailTable();
    // The table of alarms
    tableScrollPane.setViewportView(alarmTable);
    Dimension minimumSize = new Dimension(300, 150);
    tableScrollPane.setMinimumSize(minimumSize);
    tableScrollPane.setPreferredSize(minimumSize);
    // The details table
    detailsScrollPane.setViewportView(detailTable);
    // The panel with the details
    JPanel detailsPanel = new JPanel();
    BoxLayout layout = new BoxLayout(detailsPanel, BoxLayout.Y_AXIS);
    detailsPanel.setLayout(new BorderLayout());
    JPanel lblPnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
    lblPnl.add(new JLabel("Alarm details"));
    detailsPanel.add(lblPnl, BorderLayout.PAGE_START);
    detailsPanel.add(detailsScrollPane, BorderLayout.CENTER);
    minimumSize = new Dimension(120, 150);
    detailsPanel.setMinimumSize(minimumSize);
    detailsPanel.setPreferredSize(minimumSize);
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tableScrollPane, detailsPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setResizeWeight(1);
    //splitPane.setDividerLocation(tableScrollPane.getMinimumSize().width);
    add(splitPane, BorderLayout.CENTER);
    // Add the toolbar
    toolbar = new Toolbar(alarmTable, model, alarmSound, ACTIVATE_RDUCTION_RULES, this);
    add(toolbar, BorderLayout.NORTH);
    // Add the status line
    add(statusLine, BorderLayout.SOUTH);
    // Set the initial auto ack level.
    toolbar.setAutoAckLevel(getInitialAutoAckLevel());
}
Also used : JPanel(javax.swing.JPanel) UndocAlarmTableModel(alma.acsplugins.alarmsystem.gui.undocumented.table.UndocAlarmTableModel) AlarmTableModel(alma.acsplugins.alarmsystem.gui.table.AlarmTableModel) FlowLayout(java.awt.FlowLayout) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) StatusLine(alma.acsplugins.alarmsystem.gui.statusline.StatusLine) BorderLayout(java.awt.BorderLayout) AlarmTable(alma.acsplugins.alarmsystem.gui.table.AlarmTable) AlarmDetailTable(alma.acsplugins.alarmsystem.gui.detail.AlarmDetailTable) JSplitPane(javax.swing.JSplitPane) AlarmSound(alma.acsplugins.alarmsystem.gui.sound.AlarmSound) Toolbar(alma.acsplugins.alarmsystem.gui.toolbar.Toolbar)

Aggregations

AlarmDetailTable (alma.acsplugins.alarmsystem.gui.detail.AlarmDetailTable)1 AlarmSound (alma.acsplugins.alarmsystem.gui.sound.AlarmSound)1 StatusLine (alma.acsplugins.alarmsystem.gui.statusline.StatusLine)1 AlarmTable (alma.acsplugins.alarmsystem.gui.table.AlarmTable)1 AlarmTableModel (alma.acsplugins.alarmsystem.gui.table.AlarmTableModel)1 Toolbar (alma.acsplugins.alarmsystem.gui.toolbar.Toolbar)1 UndocAlarmTableModel (alma.acsplugins.alarmsystem.gui.undocumented.table.UndocAlarmTableModel)1 BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 FlowLayout (java.awt.FlowLayout)1 BoxLayout (javax.swing.BoxLayout)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSplitPane (javax.swing.JSplitPane)1