protected void optionWindow(ActionEvent e){
  if (optionsFrame == null) {
    optionsFrame=new JmriJFrame(Bundle.getMessage("OptionsTitle"),false,true);
    optionsPane=optionsFrame.getContentPane();
    optionsPane.setLayout(new BoxLayout(optionsFrame.getContentPane(),BoxLayout.Y_AXIS));
    clearEntry.setSelectedIndex(nxPairs.getClearDownOption());
    JPanel p1=new JPanel();
    clearEntry.setToolTipText("set the action for when the NX buttons are reselected");
    p1.add(new JLabel(Bundle.getMessage("Reselection")));
    p1.add(clearEntry);
    optionsPane.add(p1);
    JPanel p2=new JPanel();
    initializeColorCombo(settingTrackColorBox);
    setColorCombo(settingTrackColorBox,nxPairs.getSettingRouteColor());
    ActionListener settingTrackColorListener=null;
    settingTrackColorBox.addActionListener(settingTrackColorListener);
    p2.add(new JLabel(Bundle.getMessage("RouteSetColour")));
    p2.add(settingTrackColorBox);
    optionsPane.add(p2);
    durationSetting.setText("" + nxPairs.getSettingTimer());
    if (nxPairs.useDifferentColorWhenSetting()) {
      durationSetting.setEnabled(true);
    }
 else {
      durationSetting.setEnabled(false);
    }
    JPanel p3=new JPanel();
    p3.add(new JLabel(Bundle.getMessage("SettingDuration")));
    p3.add(durationSetting);
    optionsPane.add(p3);
    JPanel p4=new JPanel();
    p4.add(dispatcherUse);
    dispatcherUse.setSelected(nxPairs.getDispatcherIntegration());
    optionsPane.add(p4);
    JButton ok=new JButton(Bundle.getMessage("ButtonOK"));
    optionsPane.add(ok);
    ok.addActionListener(null);
  }
  optionsFrame.pack();
  optionsFrame.setVisible(true);
}

protected void optionWindow ( ActionEvent e ) { if ( optionsFrame == null ) { optionsFrame = new JmriJFrame ( Bundle . getMessage ( "OptionsTitle" ) , false , true ) ; optionsPane = optionsFrame . getContentPane ( ) ; optionsPane . setLayout ( new BoxLayout ( optionsFrame . getContentPane ( ) , BoxLayout . Y_AXIS ) ) ; clearEntry . setSelectedIndex ( nxPairs . getClearDownOption ( ) ) ; JPanel p1 = new JPanel ( ) ; clearEntry . setToolTipText ( "set the action for when the NX buttons are reselected" ) ; p1 . add ( new JLabel ( Bundle . getMessage ( "Reselection" ) ) ) ; p1 . add ( clearEntry ) ; optionsPane . add ( p1 ) ; JPanel p2 = new JPanel ( ) ; initializeColorCombo ( settingTrackColorBox ) ; setColorCombo ( settingTrackColorBox , nxPairs . getSettingRouteColor ( ) ) ; ActionListener settingTrackColorListener = null ; settingTrackColorBox . addActionListener ( settingTrackColorListener ) ; p2 . add ( new JLabel ( Bundle . getMessage ( "RouteSetColour" ) ) ) ; p2 . add ( settingTrackColorBox ) ; optionsPane . add ( p2 ) ; durationSetting . setText ( "" + nxPairs . getSettingTimer ( ) ) ; if ( nxPairs . useDifferentColorWhenSetting ( ) ) { durationSetting . setEnabled ( true ) ; } else { durationSetting . setEnabled ( false ) ; } JPanel p3 = new JPanel ( ) ; p3 . add ( new JLabel ( Bundle . getMessage ( "SettingDuration" ) ) ) ; p3 . add ( durationSetting ) ; optionsPane . add ( p3 ) ; JPanel p4 = new JPanel ( ) ; p4 . add ( dispatcherUse ) ; dispatcherUse . setSelected ( nxPairs . getDispatcherIntegration ( ) ) ; optionsPane . add ( p4 ) ; JButton ok = new JButton ( Bundle . getMessage ( "ButtonOK" ) ) ; optionsPane . add ( ok ) ; ok . addActionListener ( null ) ; } optionsFrame . pack ( ) ; optionsFrame . setVisible ( true ) ; }
utility methods for converting between string and color . note : these names are only used internally , so don ' t need a resource bundle .
