メモ欄の自動セーブ
本家の OpenDolphin は,バージョン 1.4 になって,メモ欄の update ボタンが無くなり,メモ欄は自動的にセーブされるようになった。確かに,その方が便利なので,そのように変更した。
client/MemoInspector.java
private void initComponents() { //// update ボタンは使わないことにするので,すべてコメントアウト //int[] memoSize = ClientContext.getIntArray("patientInspector.memoInspector.textArea.size"); // 5,10 //// ImageIcon updateIcon = ClientContext.getImageIcon("ref_16.gif"); memoArea = new CompositeArea(5, 10); memoArea.setLineWrap(true); memoArea.setMargin(new java.awt.Insets(3, 3, 2, 2)); //// memoArea.addFocusListener(AutoKanjiListener.getInstance()); //// updateMemoBtn = new JButton(updateIcon); //// updateMemoBtn.setMargin(new Insets(2, 2, 2, 2)); //// updateMemoBtn.setEnabled(false); //// updateMemoBtn.addActionListener(ProxyActionListener.create(this, "updateMemo")); //// JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); //// btnPanel.add(updateMemoBtn); memoPanel = new JPanel(new BorderLayout()); memoPanel.add(memoArea, BorderLayout.CENTER); //// memoPanel.add(btnPanel, BorderLayout.EAST); }
////↓ /** * メモ内容が変化したかどうかチェック * @return */ public boolean isDirty() { String oldText = patientMemoModel==null? "" : patientMemoModel.getMemo(); String newText = memoArea.getText().trim(); return !oldText.equals(newText); } ////↑
client/PatientInspector.java
public void dispose() { // List をクリアする docHistory.clear(); allergyInspector.clear(); physicalInspector.clear(); ////↓ memo 欄の自動セーブ if (memoInspector.isDirty()) { memoInspector.updateMemo(); } ////↑ }
« 患者検索でのID入力 | トップページ | カルテ検索機能 »
「OpenDolphin」カテゴリの記事
- WildFly 25 へのアップデート(2021.12.21)
- 13年目の運用まとめ(2021.02.04)
- スタンプの簡易表示(2020.09.04)
- Java 1.8.0_261 での apple.awt.brushMetalLook(2020.07.26)
- Undo の充実 (4) StampEditor, StampTree(2020.07.23)