001package jmri.jmrit.operations.trains.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.jmrit.operations.trains.TrainsTableFrame;
008
009/**
010 * Action to print a summary of each train in operations.
011 * <p>
012 * 
013 * @author Bob Jacobsen Copyright (C) 2003
014 * @author Daniel Boudreau Copyright (C) 2009, 2014, 2023
015 */
016public class PrintTrainsAction extends AbstractAction {
017
018    public PrintTrainsAction(boolean isPreview, TrainsTableFrame trainsTableFrame) {
019        super(isPreview ? Bundle.getMessage("MenuItemPreview") : Bundle.getMessage("MenuItemPrint"));
020        _isPreview = isPreview;
021        _trainsTableFrame = trainsTableFrame;
022    }
023
024    boolean _isPreview;
025    TrainsTableFrame _trainsTableFrame;
026
027    @Override
028    public void actionPerformed(ActionEvent e) {
029        new PrintTrainsFrame(_isPreview, _trainsTableFrame);
030    }
031}