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