Search in sources :

Example 1 with AlarmSelectionListener

use of alma.acsplugins.alarmsystem.gui.viewcoordination.ViewCoordinator.AlarmSelectionListener in project ACS by ACS-Community.

the class AlarmTable method changeSelection.

/**
	 * Override {@link JTable#changeSelection(int, int, boolean, boolean)} to show
	 * the selected alarm in the detail panel.
	 */
@Override
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
    super.changeSelection(rowIndex, columnIndex, toggle, extend);
    int idx = sorter.convertRowIndexToModel(rowIndex);
    AlarmTableEntry alarmEntry = model.getAlarmAt(idx);
    panel.showAlarmDetails(alarmEntry);
    selectedAlarmId = alarmEntry.getAlarmId();
    // to avoid concurrency issues
    AlarmSelectionListener listenerCopy = listener;
    if (listenerCopy != null) {
        Alarm alarm = alarmEntry.getEncapsulatedAlarm();
        if (alarm != null) {
            listenerCopy.notifyAlarmSelected(alarm);
        }
    }
}
Also used : AlarmSelectionListener(alma.acsplugins.alarmsystem.gui.viewcoordination.ViewCoordinator.AlarmSelectionListener) Alarm(cern.laser.client.data.Alarm) Point(java.awt.Point)

Aggregations

AlarmSelectionListener (alma.acsplugins.alarmsystem.gui.viewcoordination.ViewCoordinator.AlarmSelectionListener)1 Alarm (cern.laser.client.data.Alarm)1 Point (java.awt.Point)1