001package jmri.jmrit.logixng.tools.swing;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.InstanceManager;
008import jmri.jmrit.logixng.LogixNG_Manager;
009
010/**
011 * Swing action to create and register a TimeDiagram object.
012 *
013 * @author Daniel Bergqvist Copyright (C) 2018
014 */
015public class StartStopAllLogixNGsAction extends AbstractAction {
016
017    private final boolean _start;
018
019    public StartStopAllLogixNGsAction(String s, boolean start) {
020        super(s);
021        _start = start;
022    }
023
024    @Override
025    public void actionPerformed(ActionEvent e) {
026        if (_start) {
027            InstanceManager.getDefault(LogixNG_Manager.class).activateAllLogixNGs();
028        } else {
029            InstanceManager.getDefault(LogixNG_Manager.class).deActivateAllLogixNGs();
030        }
031    }
032
033}