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