001package jmri.jmrit.operations.locations.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007/**
008 * Swing action to preview or print trains serving a location.
009 *
010 * @author Daniel Boudreau Copyright (C) 2024
011 */
012public class PrintTrainsServingLocationAction extends AbstractAction {
013
014    public PrintTrainsServingLocationAction(ShowTrainsServingLocationFrame stslf, boolean isPreview) {
015        super(isPreview? Bundle.getMessage("MenuItemPreview") : Bundle.getMessage("MenuItemPrint"));
016        this.stslf = stslf;
017        this.isPreview = isPreview;
018    }
019
020    ShowTrainsServingLocationFrame stslf;
021    boolean isPreview;
022
023    @Override
024    public void actionPerformed(ActionEvent e) {
025        new PrintTrainsServingLocation(isPreview, stslf._location, stslf._track, stslf._carType);
026    }
027}
028
029