Package open.dolphin.ui

Examples of open.dolphin.ui.MyJPopupMenu


        StampTree tree = stampBox.getStampTree(IInfoModel.ENTITY_TEXT);
        if (tree == null) {
            return;
        }
       
        popup = new MyJPopupMenu();
       
        //
        // メニューのスタックを生成する
        //
        LinkedList menus = new LinkedList();
View Full Code Here


        textStampButton.setOpaque(false);
        textStampButton.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                if (!((JButton) e.getSource()).isEnabled()) return;
                MyJPopupMenu popup = new MyJPopupMenu();
                mediator.addTextMenu(popup);
                if (!e.isPopupTrigger()) {
                    popup.show(e.getComponent(), e.getX(), e.getY());
                }
            }
        });

        JButton schemaButton = new JButton();
        schemaButton.setBorderPainted(false);
        schemaButton.setName("schemaBtn");
        schemaButton.setAction(mediator.getActions().get(GUIConst.ACTION_INSERT_SCHEMA));
        schemaButton.setText("");
        schemaButton.setToolTipText("シェーマボックスを起動します。");
        schemaButton.setIcon(GUIConst.ICON_GRAPHICS_BRUSH_22);
        schemaButton.setOpaque(false);
        schemaButton.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                if (!((JButton) e.getSource()).isEnabled()) return;
                context.showSchemaBox();
            }
        });

        JButton stampButton = new JButton();
        stampButton.setBorderPainted(false);
        stampButton.setName("stampBtn");
        stampButton.setAction(mediator.getActions().get(GUIConst.ACTION_INSERT_STAMP));
        stampButton.setText("");
        stampButton.setToolTipText("スタンプを挿入します。");
        stampButton.setIcon(GUIConst.ICON_STAMP_22);
        stampButton.setOpaque(false);
        stampButton.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                if (!((JButton) e.getSource()).isEnabled()) return;
                MyJPopupMenu popup = new MyJPopupMenu();
                mediator.addStampMenu(popup);
                popup.show(e.getComponent(), e.getX(), e.getY());
            }
        });

        JButton windowButton = new JButton();
        windowButton.setBorderPainted(false);
        windowButton.setIcon(GUIConst.ICON_WINDOWS_22);
        windowButton.setToolTipText("開いているカルテの一覧を表示します。");
        windowButton.setOpaque(false);
        windowButton.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                MyJPopupMenu popup = new MyJPopupMenu();
                final ArrayList<WindowSupport> windows = WindowSupport.getAllWindows();
                Action action;
                String name;

                int count = 0;
                // カルテを popup に追加
                for (WindowSupport ws : windows) {
                    action = ws.getWindowAction();
                    name = action.getValue(Action.NAME).toString();
                    if (name.contains("カルテ")) {
                        action.putValue(Action.SMALL_ICON, WindowSupport.getIcon(ws.getFrame()));
                        popup.add(action);
                        count++;
                    }               
                }
                if (count != 0) { popup.addSeparator(); count = 0; }

                // インスペクタを popup に追加
                for (WindowSupport ws : windows) {
                    action = ws.getWindowAction();
                    name = action.getValue(Action.NAME).toString();
                    if (name.contains("インスペクタ")) {
                        action.putValue(Action.SMALL_ICON, WindowSupport.getIcon(ws.getFrame()));
                        popup.add(action);
                        count++;
                    }
                }

                // インスペクタウインドウ整列
                if (count != 0) {
                    popup.addSeparator();
                    count = 0;

                    Action a = new AbstractAction() {
                        private static final long serialVersionUID = 1L;
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            JFrame f;
                            int x = WindowSupport.INITIAL_X; int y = WindowSupport.INITIAL_Y; int width = 0; int height = 0;

                            for (WindowSupport ws : windows) {
                                f = ws.getFrame();
                                if (f.getTitle().contains("インスペクタ")) {
                                    if (width == 0) width = f.getBounds().width;
                                    if (height == 0) height = f.getBounds().height;

                                    f.setBounds(x, y, width, height);
                                    f.toFront();
                                    x += WindowSupport.INITIAL_DX; y += WindowSupport.INITIAL_DY;
                                }
                            }
                        }
                    };

                    a.putValue(Action.NAME, "インスペクタを整列");
                    a.putValue(Action.SMALL_ICON, GUIConst.ICON_WINDOWS_22);
                    popup.add(a);
                }

                popup.show(e.getComponent(), e.getX(), e.getY());
            }
        });

        add(stampButton);
        add(textStampButton);
View Full Code Here

    /**
     * カレンダーポップアップを出す
     * @param e
     */
    private void popupCalendar(MouseEvent e) {
        calendarPopup = new MyJPopupMenu();
        calendarPopup.setBorder(BorderFactory.createEmptyBorder());
        GregorianCalendar gc = new GregorianCalendar();
        int this_month = gc.get(Calendar.MONTH);
        int dif = lastVisitYmd[1] - this_month; //lastVisit, this_month は gc なので,両者とも値が0-11 になる
        if (dif > 0) dif -= 12;
View Full Code Here

    /**
     * 病名修飾ポップアップメニュー作成
     */
    private void createDiagnosisPopupMenu() {
        diagPopup = new MyJPopupMenu();

        // Diagnosis preposition 項目の作成
        for (DiagnosisPreposition p : DiagnosisPreposition.values()) {
            JMenuItem item = new JMenuItem(p.desc);
            item.addActionListener(new DiagAction(p));
View Full Code Here

    }
    /**
     * 主病名/疑い病名ポップアップを作る
     */
    private void createCategoryPopupMenu() {
        categoryPopup = new MyJPopupMenu();

        for (DiagnosisDocument.DiagnosisCategory c : DiagnosisDocument.DiagnosisCategory.values()) {
            JMenuItem item = new JMenuItem(c.model.getDiagnosisCategoryDesc());
            item.addActionListener(new CategoryOutcomeAction(c.model));
            categoryPopup.add(item);
View Full Code Here

    }
    /**
     * 転帰ポップアップを作る
     */
    private void createOutcomePopupMenu() {
        outcomePopup = new MyJPopupMenu();

        for (DiagnosisDocument.DiagnosisOutcome o : DiagnosisDocument.DiagnosisOutcome.values()) {
            JMenuItem item = new JMenuItem(o.model.getOutcomeDesc());
            item.addActionListener(new CategoryOutcomeAction(o.model));
            outcomePopup.add(item);
View Full Code Here

   
    @Override
    public void enter(ActionMap map) {
        this.map = map;
        map.get(GUIConst.ACTION_PASTE).setEnabled(canPaste());
        MyJPopupMenu menu = new MyJPopupMenu();
        menu.add(map.get(GUIConst.ACTION_COPY));
        menu.add(map.get(GUIConst.ACTION_CUT));
        menu.add(map.get(GUIConst.ACTION_PASTE));
        this.setComponentPopupMenu(menu);
    }
View Full Code Here

TOP

Related Classes of open.dolphin.ui.MyJPopupMenu

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.