Package open.dolphin.ui

Examples of open.dolphin.ui.MainFrame


        // WindowSupport を生成する この時点で Frame,WindowMenu を持つMenuBar が生成されている
        String title = ClientContext.getFrameTitle(windowTitle);
        // System.out.println(title);
        windowSupport = WindowSupport.create(title);
        MainFrame myFrame = windowSupport.getFrame();    // MainWindow の JFrame
        JMenuBar myMenuBar = windowSupport.getMenuBar()// MainWindow の JMenuBar

        // Windowにこのクラス固有の設定をする
        Point loc = new Point(defaultX, defaultY);
        Dimension size = new Dimension(defaultWidth, defaultHeight);
        myFrame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                processExit();
            }
            //@Override
            //public void windowActivated(WindowEvent e) {
            //    int index = tabbedPane.getSelectedIndex();
            //    MainComponent plugin = (MainComponent) providers.get(String.valueOf(index));
            //    plugin.enter();
            //}
        });
        ComponentMemory cm = new ComponentMemory(myFrame, loc, size, this);
        cm.setToPreferenceBounds();

        // BlockGlass を設定する
        blockGlass = new BlockGlass();
        blockGlass.setSize(myFrame.getSize());
        myFrame.setGlassPane(blockGlass);

        // mainWindowのメニューを生成しメニューバーに追加する
        mediator = new Mediator(this);
        MenuFactory appMenu = new MenuFactory();
        appMenu.setMenuSupports(mediator, null);
        appMenu.build(myMenuBar);
        mediator.registerActions(appMenu.getActionMap());

        // mainWindowのコンテントGUIを生成しFrameに追加する
        tabbedPane = new PNSTabbedPane();
        tabbedPane.setButtonVgap(4);
        tabbedPane.getButtonPanel().setBackgroundColor(Color.BLACK, 0f, 0.1f);
       
        MainFrame.MainPanel mainPanel = myFrame.getMainPanel();
        mainPanel.setLayout(new BorderLayout(0,0));
        mainPanel.add(tabbedPane, BorderLayout.CENTER);
       
        // MainComponent では,MainFrame の CommandPanel, StatusPanel は使わない
        // MainComponentPanel で自前で用意する
        myFrame.removeCommandPanel();
        myFrame.removeStatusPanel();

        // タブペインに格納する Plugin をロードする
        MainComponent[] plugin = new MainComponent[3];
        plugin[0] = new WatingListImpl();
        plugin[1] = new PatientSearchImpl();
View Full Code Here


                GUIConst.ACTION_SET_KARTE_ENVIROMENT
            };
            mediator.enableMenus(enables);
        } else {
            //frame = new JFrame(title);
            frame = new MainFrame(title);
        }
//pns$
        //frame = new JFrame(title); //← 以前は JFrame で作られていた形跡がある
//pns   frame = new JDialog((JFrame) null, title, false); // ←これがオリジナル
        //frame.setFocusableWindowState(false);
View Full Code Here

     * @return WindowSupport
     */
    public static WindowSupport create(String title) {
       
        // フレームを生成する
        final MainFrame frame = new MainFrame(title);
       
        // メニューバーを生成する
        JMenuBar menuBar = new JMenuBar();
       
        // Window メニューを生成する
        JMenu windowMenu = new JMenu(WINDOW_MWNU_NAME);
       
        // メニューバーへWindow メニューを追加する
        menuBar.add(windowMenu);
       
        // フレームにメニューバーを設定する
        frame.setJMenuBar(menuBar);
       
        // Windowメニューのアクション
        // 選択されたらフレームを前面にする
        Action windowAction = new AbstractAction(title) {
            public void actionPerformed(ActionEvent e) {
                frame.toFront();
            }
        };
       
        // インスタンスを生成する
        final WindowSupport ret
                = new WindowSupport(frame, menuBar, windowMenu, windowAction);
       
        // WindowEvent をこのクラスに通知しリストの管理を行う
        frame.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        frame.addWindowListener(new java.awt.event.WindowAdapter() {
           
            @Override
            public void windowOpened(java.awt.event.WindowEvent e) {
//pns           WindowSupport.windowOpened(ret);
                setWindowList(State.OPENED);
View Full Code Here

                getPatient().getPatientId());
       
        windowSupport = WindowSupport.create(title);       
        JMenuBar myMenuBar = windowSupport.getMenuBar();
       
        MainFrame frame = windowSupport.getFrame();
        frame.setName("editorFrame");
        frame.removeStatusPanel();
       
        statusPanel = new StatusPanel(); // dummy 表示はしない AbstractChartDocument から呼ばれるので
        statusPanel.add("", "message");
       
        MainFrame.MainPanel mainPanel = frame.getMainPanel();
        mainPanel.setLayout(new BorderLayout(0,0));
        MainFrame.CommandPanel comPanel = frame.getCommandPanel();
       
        //content = new JPanel(new BorderLayout());
       
        //
        // Mediator が変更になる
        //
        mediator = new ChartMediator(this);
       
        //
        //  MenuBar を生成する
        //
        MenuFactory appMenu = new MenuFactory();
        appMenu.setMenuSupports(realChart.getContext().getMenuSupport(), mediator);
        appMenu.build(myMenuBar);
        mediator.registerActions(appMenu.getActionMap());
        myToolPanel = appMenu.getToolPanelProduct();
        //content.add(myToolPanel, BorderLayout.NORTH);
        myToolPanel.setOpaque(false);
        comPanel.add(myToolPanel);
        comPanel.setBottomLineAlpha(0.4f);       
       
        //
        // このクラス固有のToolBarを生成する
        //
        ChartToolBar toolBar = new ChartToolBar(this);
        myToolPanel.add(toolBar);

        //statusPanel = new StatusPanel();
       
        if (view != null) {
            mode = EditorMode.BROWSER;
            view.setContext(EditorFrame.this);
            view.start();
            scroller = new JScrollPane(view.getUI());
            mediator.enabledAction(GUIConst.ACTION_NEW_DOCUMENT, false);

        } else if (editor != null) {
            mode = EditorMode.EDITOR;
            editor.setContext(EditorFrame.this);
            editor.initialize();
            editor.start();
//pns^      scroller = new JScrollPane(editor.getUI());
            scroller = new MyJScrollPane(editor.getUI());
            scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
//pns$
            mediator.enabledAction(GUIConst.ACTION_NEW_KARTE, false);
            mediator.enabledAction(GUIConst.ACTION_NEW_DOCUMENT, false);

//pns       KarteEditor で save が完了したら通知される
            editor.getBoundSupport().addPropertyChangeListener(KarteEditor.SAVE_DONE, new PropertyChangeListener() {
                @Override
                public void propertyChange(PropertyChangeEvent evt) {
                    stop();
                }
            });
        }
        //content.add(scroller, BorderLayout.CENTER);
        mainPanel.add(scroller, BorderLayout.CENTER);
       
        //frame.getContentPane().setLayout(new BorderLayout(0, 7));
        //frame.getContentPane().add(content, BorderLayout.CENTER);
//pns   frame.getContentPane().add((JPanel) statusPanel, BorderLayout.SOUTH);
//pns   resMap.injectComponents(frame);
       
       
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                processWindowClosing();
            }
        });
       
        blockGlass = new BlockGlass();
        frame.setGlassPane(blockGlass);
       
        // Frame の大きさをストレージからロードする
        int x = ClientContext.getInt("editorFrame.frameX");
        int y = ClientContext.getInt("editorFrame.frameY");
        int width = ClientContext.getInt("editorFrame.frameWidth");
        int height = ClientContext.getInt("editorFrame.frameHeight");

        Rectangle bounds = PreferencesUtils.getRectangle(prefs, PN_FRAME, new Rectangle(x,y,width,height));
        frame.setBounds(bounds);
        windowSupport.getFrame().setVisible(true);
       
        Runnable awt = new Runnable() {     
            @Override
            public void run() {
View Full Code Here

TOP

Related Classes of open.dolphin.ui.MainFrame

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.