001package jmri.jmrix.rps.aligntable; 002 003import java.awt.Container; 004import java.util.ResourceBundle; 005import javax.swing.BoxLayout; 006import javax.swing.JDialog; 007import jmri.jmrix.rps.RpsSystemConnectionMemo; 008 009/** 010 * Frame for user configuration of RPS alignment. 011 * <p> 012 * We only allow one of these right now, and so don't dispose on close 013 * 014 * @see AlignTableAction 015 * 016 * @author Bob Jacobsen Copyright (C) 2008 017 */ 018public class AlignTableFrame extends jmri.util.JmriJFrame { 019 020 RpsSystemConnectionMemo memo = null; 021 022 ResourceBundle rb = ResourceBundle.getBundle("jmri.jmrix.rps.aligntable.AlignTableBundle"); 023 024 /** 025 * Constructor method 026 * @param _memo system connection. 027 */ 028 public AlignTableFrame(RpsSystemConnectionMemo _memo) { 029 super(); 030 memo = _memo; 031 } 032 033 AlignTablePane p; 034 035 /** 036 * Initialize the window 037 */ 038 @Override 039 public void initComponents() { 040 setTitle(rb.getString("WindowTitle")); 041 042 setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); 043 044 Container contentPane = getContentPane(); 045 contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); 046 047 // add table 048 p = new AlignTablePane(this); 049 p.initComponents(); 050 contentPane.add(p); 051 052 // add help menu to window 053 addHelpMenu("package.jmri.jmrix.rps.aligntable.AlignTableFrame", true); 054 055 // check at shutdown 056 setShutDownTask(); 057 058 // pack for display 059 pack(); 060 } 061 062 @Override 063 protected void storeValues() { 064 p.storeDefault(); 065 setModifiedFlag(false); 066 } 067 068}