JPanel scrP = new JPanel();
scrP.add(vSc);
scrP.add(hSc);
// インスペクタタブ
GridBagBuilder gbb = new GridBagBuilder("インスペクタ画面");
int row = 0;
JLabel label = new JLabel("左側トップ:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
//pns gbb.add(topCompo, 1, row, 1, 1, GridBagConstraints.WEST);
gbb.add(inspectorCompo[row], 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("2番目:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
//pns gbb.add(secondCompo, 1, row, 1, 1, GridBagConstraints.WEST);
gbb.add(inspectorCompo[row], 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("3番目:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
//pns gbb.add(thirdCompo, 1, row, 1, 1, GridBagConstraints.WEST);
gbb.add(inspectorCompo[row], 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("4番目:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
//pns gbb.add(forthCompo, 1, row, 1, 1, GridBagConstraints.WEST);
gbb.add(inspectorCompo[row], 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("ボトム:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
//pns gbb.add(forthCompo, 1, row, 1, 1, GridBagConstraints.WEST);
gbb.add(inspectorCompo[row], 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel(GUIConst.ICON_INFORMATION_16);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(infoLabel, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("画面ロケータ:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(frameLocator, 1, row, 1, 1, GridBagConstraints.WEST);
JPanel insP = gbb.getProduct();
// gbb = new GridBagBuilder("紹介状等PDFの出力先");
// row = 0;
// label = new JLabel("出力先:", SwingConstants.RIGHT);
// gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
// JPanel pdfPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
// pdfPanel.add(pdfStore);
// pdfPanel.add(pdfDir);
// gbb.add(pdfPanel, 1, row, 1, 1, GridBagConstraints.WEST);
// JPanel pdfP = gbb.getProduct();
gbb = new GridBagBuilder();
gbb.add(insP, 0, 0, GridBagConstraints.HORIZONTAL, 1.0, 0.0);
// gbb.add(pdfP, 0, 1, GridBagConstraints.HORIZONTAL, 1.0, 0.0);
gbb.add(new JLabel(""), 0, 2, GridBagConstraints.BOTH, 1.0, 1.0);
JPanel inspectorPanel = gbb.getProduct();
// 文書関連タブ
// Karte
gbb = new GridBagBuilder("カルテ");
row = 0;
row++;
label = new JLabel("文書履歴:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(ascDesc, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("自動文書取得数:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(spinner, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("スクロール方向:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(scrP, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("文書抽出期間:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(periodCombo, 1, row, 1, 1, GridBagConstraints.WEST);
JPanel kartePanel = gbb.getProduct();
// Diagnosis
JPanel diagAscDesc = new JPanel();
diagAscDesc.add(diagnosisAsc);
diagAscDesc.add(diagnosisDesc);
gbb = new GridBagBuilder("傷病名");
row = 0;
label = new JLabel("表示順:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(diagAscDesc, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("抽出期間:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(diagnosisPeriodCombo, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("転帰入力時:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(autoOutcomeInput, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("入力する日(前):", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(outcomeSpinner, 1, row, 1, 1, GridBagConstraints.WEST);
JPanel diagnosisPanel = gbb.getProduct();
// LaboTest
gbb = new GridBagBuilder("ラボテスト");
row = 0;
label = new JLabel("抽出期間:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(laboTestPeriodCombo, 1, row, 1, 1, GridBagConstraints.WEST);
JPanel laboPanel = gbb.getProduct();
// Set default button
JPanel cmd = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
cmd.add(restoreDefaultBtn);
gbb = new GridBagBuilder();
gbb.add(kartePanel, 0, 0, GridBagConstraints.HORIZONTAL, 1.0, 0.0);
gbb.add(diagnosisPanel, 0, 1, GridBagConstraints.HORIZONTAL, 1.0, 0.0);
gbb.add(cmd, 0, 2, GridBagConstraints.HORIZONTAL, 1.0, 0.0);
gbb.add(new JLabel(""), 0, 3, GridBagConstraints.BOTH, 1.0, 1.0);
JPanel docPanel = gbb.getProduct();
ButtonGroup bg = new ButtonGroup();
bg.add(asc);
bg.add(desc);
bg = new ButtonGroup();
bg.add(diagnosisAsc);
bg.add(diagnosisDesc);
bg = new ButtonGroup();
bg.add(pltform);
bg.add(prefLoc);
bg = new ButtonGroup();
bg.add(vSc);
bg.add(hSc);
restoreDefaultBtn.addActionListener(EventHandler.create(ActionListener.class, this, "restoreDefault"));
// スタンプ動作
JPanel stampPanel = new JPanel();
stampPanel.setLayout(new BoxLayout(stampPanel, BoxLayout.Y_AXIS));
gbb = new GridBagBuilder("スタンプ動作の設定");
row = 0;
label = new JLabel("スタンプの上にDnDした場合:", SwingConstants.RIGHT);
JPanel stmpP = GUIFactory.createRadioPanel(new JRadioButton[]{replaceStamp, showAlert});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(stmpP, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
gbb.add(stampSpace, 0, row, 2, 1, GridBagConstraints.WEST);
row++;
gbb.add(laboFold, 0, row, 2, 1, GridBagConstraints.WEST);
stampPanel.add(gbb.getProduct());
bg = new ButtonGroup();
bg.add(replaceStamp);
bg.add(showAlert);
gbb = new GridBagBuilder("スタンプエディタのデフォルト数量");
row = 0;
label = new JLabel("錠剤の場合:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(createUnitFieldPanel(defaultZyozaiNum, "T"), 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("水薬の場合:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(createUnitFieldPanel(defaultMizuyakuNum, "ml"), 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("散薬の場合:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(createUnitFieldPanel(defaultSanyakuNum, "g"), 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("処方日数:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(createUnitFieldPanel(defaultRpNum, "日/回"), 1, row, 1, 1, GridBagConstraints.WEST);
stampPanel.add(gbb.getProduct());
stampPanel.add(Box.createVerticalStrut(400));
stampPanel.add(Box.createVerticalGlue());
// CLAIM 送信のデフォルト設定
JPanel sendPanel = new JPanel();
sendPanel.setLayout(new BoxLayout(sendPanel, BoxLayout.Y_AXIS));
gbb = new GridBagBuilder("カルテの保存時に設定するタイトル");
row = 0;
gbb.add(useTop15AsTitle, 0, row, 2, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("デフォルトのタイトル:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(defaultKarteTitle, 1, row, 1, 1, GridBagConstraints.WEST);
sendPanel.add(gbb.getProduct());
gbb = new GridBagBuilder("診療行為送信のデフォルト設定");
row = 0;
label = new JLabel("仮保存時:", SwingConstants.RIGHT);
JPanel p9 = GUIFactory.createRadioPanel(new JRadioButton[]{sendAtTmp, noSendAtTmp});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p9, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("保存時:", SwingConstants.RIGHT);
p9 = GUIFactory.createRadioPanel(new JRadioButton[]{sendAtSave, noSendAtSave});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p9, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("修正時:", SwingConstants.RIGHT);
p9 = GUIFactory.createRadioPanel(new JRadioButton[]{sendAtModify, noSendAtModify});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p9, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("傷病名:", SwingConstants.RIGHT);
p9 = GUIFactory.createRadioPanel(new JRadioButton[]{sendDiagnosis, noSendDiagnosis});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p9, 1, row, 1, 1, GridBagConstraints.WEST);
sendPanel.add(gbb.getProduct());
sendPanel.add(Box.createVerticalStrut(500));
sendPanel.add(Box.createVerticalGlue());
// 新規カルテ作成時と保存時の確認ダイアログオプション
JPanel confirmPanel = new JPanel();
confirmPanel.setLayout(new BoxLayout(confirmPanel, BoxLayout.Y_AXIS));
NumberFormat numFormat = NumberFormat.getNumberInstance();
printCount = new JFormattedTextField(numFormat);
//pns printCount.setValue(new Integer(0));
printCount.setValue(0);
row = 0;
gbb = new GridBagBuilder("新規カルテ作成時");
gbb.add(noConfirmAtNew, 0, row, 2, 1, GridBagConstraints.WEST);
row += 1;
label = new JLabel("作成方法:", SwingConstants.RIGHT);
JPanel p = GUIFactory.createRadioPanel(new JRadioButton[]{copyNew, applyRp, emptyNew});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p, 1, row, 1, 1, GridBagConstraints.WEST);
row += 1;
label = new JLabel("配置方法:", SwingConstants.RIGHT);
JPanel p2 = GUIFactory.createRadioPanel(new JRadioButton[]{placeWindow, palceTabbedPane});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p2, 1, row, 1, 1, GridBagConstraints.WEST);
confirmPanel.add(gbb.getProduct());
gbb = new GridBagBuilder("カルテ保存時");
row = 0;
gbb.add(noConfirmAtSave, 0, row, 2, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("印刷枚数:", SwingConstants.RIGHT);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(printCount, 1, row, 1, 1, GridBagConstraints.WEST);
row++;
label = new JLabel("動 作:", SwingConstants.RIGHT);
JPanel p4 = GUIFactory.createRadioPanel(new JRadioButton[]{save, saveTmp});
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(p4, 1, row, 1, 1, GridBagConstraints.WEST);
confirmPanel.add(gbb.getProduct());
confirmPanel.add(Box.createVerticalStrut(200));
confirmPanel.add(Box.createVerticalGlue());
bg = new ButtonGroup();
bg.add(copyNew);
bg.add(applyRp);
bg.add(emptyNew);
bg = new ButtonGroup();
bg.add(placeWindow);
bg.add(palceTabbedPane);
bg = new ButtonGroup();
bg.add(sendAtTmp);
bg.add(noSendAtTmp);
bg = new ButtonGroup();
bg.add(sendAtSave);
bg.add(noSendAtSave);
bg = new ButtonGroup();
bg.add(sendAtModify);
bg.add(noSendAtModify);
bg = new ButtonGroup();
bg.add(sendDiagnosis);
bg.add(noSendDiagnosis);
bg = new ButtonGroup();
bg.add(save);
bg.add(saveTmp);
//pns^ スクロール速度設定
JPanel uiPanel = new JPanel();
uiPanel.setLayout(new BoxLayout(uiPanel, BoxLayout.Y_AXIS));
row = 0;
gbb = new GridBagBuilder("スクロール速度");
// カルテスクロール速度
label = new JLabel("カルテ :", SwingConstants.RIGHT);
JPanel slider = GUIFactory.createSliderPanel(1,32, prefs.getInt(Project.SCROLL_UNIT_KARTE, 15));
scrollUnitKarte = (JSpinner) slider.getComponent(1);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(slider, 1, row++, 1, 1, GridBagConstraints.WEST);
// テーブルのスクロール速度
label = new JLabel("テーブル :", SwingConstants.RIGHT);
slider = GUIFactory.createSliderPanel(1,32, prefs.getInt(Project.SCROLL_UNIT_TABLE, 15));
scrollUnitTable = (JSpinner) slider.getComponent(1);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(slider, 1, row++, 1, 1, GridBagConstraints.WEST);
// スタンプのスクロール速度
label = new JLabel("スタンプ :", SwingConstants.RIGHT);
slider = GUIFactory.createSliderPanel(1,32, prefs.getInt(Project.SCROLL_UNIT_STAMP, 15));
scrollUnitStamp = (JSpinner) slider.getComponent(1);
gbb.add(label, 0, row, 1, 1, GridBagConstraints.EAST);
gbb.add(slider, 1, row++, 1, 1, GridBagConstraints.WEST);
uiPanel.add(gbb.getProduct());
uiPanel.add(Box.createVerticalStrut(500));
uiPanel.add(Box.createVerticalGlue());
//pns$
JTabbedPane tabbedPane = new JTabbedPane();