001package jmri.jmrit.operations.routes.tools; 002 003import java.awt.Frame; 004import java.awt.event.ActionEvent; 005 006import javax.swing.AbstractAction; 007 008/** 009 * Swing action to create and register a RouteCopyFrame object. 010 * 011 * @author Bob Jacobsen Copyright (C) 2001 012 * @author Daniel Boudreau Copyright (C) 2010 013 */ 014public class SetTrainIconPositionAction extends AbstractAction { 015 016 public SetTrainIconPositionAction() { 017 super(Bundle.getMessage("MenuSetTrainIcon")); 018 } 019 020 SetTrainIconPositionFrame f = null; 021 022 @Override 023 public void actionPerformed(ActionEvent e) { 024 // create a copy route frame 025 if (f == null || !f.isVisible()) { 026 f = new SetTrainIconPositionFrame(); 027 } 028 f.setExtendedState(Frame.NORMAL); 029 f.setVisible(true); // this also brings the frame into focus 030 } 031} 032 033