001package jmri.jmrix.grapevine.nodeconfig; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import org.slf4j.Logger; 006import org.slf4j.LoggerFactory; 007import jmri.jmrix.grapevine.GrapevineSystemConnectionMemo; 008 009/** 010 * Swing action to create and register a NodeConfigFrame object 011 * 012 * @author Bob Jacobsen Copyright (C) 2006 013 */ 014public class NodeConfigAction extends AbstractAction { 015 016 private GrapevineSystemConnectionMemo memo = null; 017 018 public NodeConfigAction(String s, GrapevineSystemConnectionMemo _memo) { 019 super(s); 020 memo = _memo; 021 } 022 023 public NodeConfigAction(GrapevineSystemConnectionMemo _memo) { 024 this(Bundle.getMessage("WindowTitle"), _memo); 025 026 } 027 028 @Override 029 public void actionPerformed(ActionEvent e) { 030 NodeConfigFrame f = new NodeConfigFrame(memo); 031 try { 032 f.initComponents(); 033 } catch (Exception ex) { 034 log.error("Exception: {}", ex.toString()); 035 } 036 f.setLocation(100, 30); 037 f.setVisible(true); 038 } 039 040 private final static Logger log = LoggerFactory.getLogger(NodeConfigAction.class); 041 042}