001package jmri.jmrix.cmri.serial.nodeconfigmanager; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import jmri.jmrix.cmri.CMRISystemConnectionMemo; 006import org.slf4j.Logger; 007import org.slf4j.LoggerFactory; 008 009/** 010 * Swing action to create and register a 011 * NodeConfigManagerAction object 012 * Derived from the original NodeConfig class 013 * 014 * @author Chuck Catania Copyright (C) 2014,2017 015 */ 016 017public class NodeConfigManagerAction extends AbstractAction { 018 019 CMRISystemConnectionMemo _memo = null; 020 021 public NodeConfigManagerAction(String s, CMRISystemConnectionMemo memo) { 022 super(s); 023 _memo = memo; 024 } 025 026 public NodeConfigManagerAction(CMRISystemConnectionMemo memo) { 027 this(Bundle.getMessage("WindowTitle"), memo); 028 } 029 030 @Override 031 public void actionPerformed(ActionEvent e) { 032 NodeConfigManagerFrame f = new NodeConfigManagerFrame(_memo); 033 try { 034 f.initComponents(); 035 } 036 catch (Exception ex) { 037 log.error("NodeConfigManagerAction Exception-C2: {}", ex.toString()); 038 } 039 f.setLocation(20,40); 040 f.setVisible(true); 041 } 042 private final static Logger log = LoggerFactory.getLogger(NodeConfigManagerAction.class); 043 044}