001package jmri.jmrit.operations.routes.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.jmrit.operations.locations.Location;
008
009/**
010 * Action to create the ShowRoutesServingLocationFrame.
011 *
012 * @author Daniel Boudreau Copyright (C) 2023
013 */
014public class ShowRoutesServingLocationAction extends AbstractAction {
015
016    public ShowRoutesServingLocationAction(Location location) {
017        super(Bundle.getMessage("TitleShowRoutes"));
018        _location = location;
019    }
020
021    Location _location;
022    ShowRoutesServingLocationFrame _frame;
023
024    @Override
025    public void actionPerformed(ActionEvent e) {
026        if (_frame != null) {
027            _frame.dispose();
028        }
029        _frame = new ShowRoutesServingLocationFrame();
030        _frame.initComponents(_location);
031    }
032}