メモ欄の自動セーブ
本家の 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」カテゴリの記事
- インスペクタのデザイン変更(2017.09.25)
- java 1.8.0_162 で変換中の記号フォントが小さくなる(2018.02.06)
- NetBeans から IntelliJ に移行(2018.02.03)
- High Sierra に移行(2017.10.20)
- 編集中カルテの自動一時保存機能(2018.01.25)