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