private void initComponents() { final SimpleDateFormat dateFrmt = new SimpleDateFormat(DEFAULT_DATE_FORMAT); panel = new JPanel(); panel.setLayout(new BorderLayout()); JPanel north = new JPanel(); north.setLayout(new BoxLayout(north, BoxLayout.X_AXIS)); JLabel dateLbl = new JLabel("検査日:"); north.add(dateLbl); dateFld = new JTextField(10); dateFld.setMaximumSize(dateFld.getPreferredSize()); dateFld.setEditable(false); dateFld.setText(dateFrmt.format(new Date())); north.add(dateFld); north.add(Box.createHorizontalGlue()); editCheck = new JCheckBox("項目編集"); north.add(editCheck); panel.add(north, BorderLayout.NORTH); JPanel south = new JPanel(); south.setLayout(new FlowLayout()); deleteBtn = new JButton("削除", deleteIcon); deleteBtn.setEnabled(false); south.add(deleteBtn); closeBtn = new JButton("閉じる", closeIcon); south.add(closeBtn); saveBtn = new JButton("保存", saveIcon); south.add(saveBtn); panel.add(south, BorderLayout.SOUTH); setTable = new JTable(); JScrollPane scroll = new JScrollPane(setTable); centerPanel = new JPanel(); centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.X_AXIS)); centerPanel.add(scroll); panel.add(centerPanel, BorderLayout.CENTER); templateTable = new JTable(); templateTable.setToolTipText("DnDで左の施設内検査項目テーブルに追加してください。"); rtScroll = new JScrollPane(templateTable); Dimension d = new Dimension(200, 200); rtScroll.setPreferredSize(d); d = new Dimension(200, Integer.MAX_VALUE); rtScroll.setMaximumSize(d); dialog = new JDialog(); String title = ClientContext.getFrameTitle("院内検査項目追加"); dialog.setTitle(title); dialog.setModal(true); dialog.setContentPane(panel); ClientContext.setDolphinIcon(dialog); dialog.pack(); dialog.setLocationRelativeTo(chart.getFrame()); }
protected void failed(Throwable e) { e.printStackTrace(System.err); StringBuilder why = new StringBuilder(); why.append(ERROR_ACCESS); why.append("\n"); Throwable cause = e.getCause(); if (cause != null) { why.append(cause.getMessage()); } else { why.append(e.getMessage()); } Window parent = SwingUtilities.getWindowAncestor(chart.getFrame()); JOptionPane.showMessageDialog( parent, why.toString(), ClientContext.getFrameTitle(TITLE), JOptionPane.WARNING_MESSAGE); }
public void openKarte() { boolean showReceiptMessage = Project.getBoolean("showReceiptMessage", true); if (showReceiptMessage) { JLabel msg1 = new JLabel("受付リストからオープンしないと診療データをレセコンに"); JLabel msg2 = new JLabel("送信することができません。続けますか?"); final JCheckBox cb = new JCheckBox("今後このメッセージを表示しない"); cb.setFont(new Font("Dialog", Font.PLAIN, 10)); cb.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Project.setBoolean("showReceiptMessage", !cb.isSelected()); } }); JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3)); p1.add(msg1); JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3)); p2.add(msg2); JPanel p3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3)); p3.add(cb); JPanel box = new JPanel(); box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS)); box.add(p1); box.add(p2); box.add(p3); box.setBorder(BorderFactory.createEmptyBorder(0, 0, 11, 11)); int option = JOptionPane.showConfirmDialog( SwingUtilities.getWindowAncestor(getUI()), new Object[] {box}, ClientContext.getFrameTitle(getName()), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, ClientContext.getImageIcon("about_32.gif")); if (option != JOptionPane.YES_OPTION) { return; } } PatientModel patient = selectedLabo.getPatient(); PatientVisitModel pvt = new PatientVisitModel(); pvt.setNumber(number++); pvt.setPatientModel(patient); // 受け付けを通していないので診療科はユーザ登録してあるものを使用する // 診療科名、診療科コード、医師名、医師コード、JMARI // 2.0 pvt.setDeptName(Project.getUserModel().getDepartmentModel().getDepartmentDesc()); pvt.setDeptCode(Project.getUserModel().getDepartmentModel().getDepartment()); pvt.setDoctorName(Project.getUserModel().getCommonName()); if (Project.getUserModel().getOrcaId() != null) { pvt.setDoctorId(Project.getUserModel().getOrcaId()); } else { pvt.setDoctorId(Project.getUserModel().getUserId()); } pvt.setJmariNumber(Project.getString(Project.JMARI_CODE)); // カルテコンテナを生成する getContext().openKarte(pvt); }