Package javax.swing

Examples of javax.swing.JDesktopPane$ComponentPosition


            Object r = frame.getClientProperty(RESIZING);
            if (r != null && r instanceof Boolean) {
                resizing = ((Boolean) r).booleanValue();
            }

            JDesktopPane desk = frame.getDesktopPane();
            Dimension d = desk.getSize();

            // Nothing all that fancy below, just figuring out how to adjust
            // to keep the frame on the desktop.
            if (x < 0) { // too far left?
                if (resizing)
View Full Code Here


        frame_ = new JFrame(str_title);
        frame_.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) { System.exit(0); }
    });

    desktop_ = new JDesktopPane();
    desktop_.setBackground(Color.BLUE);
    desktop_.setDragMode(JDesktopPane.LIVE_DRAG_MODE);

    menu_ = new MainMenu();
   
View Full Code Here

        c.removeMouseListener(borderListener);
        c.removeMouseMotionListener(borderListener);
    }

    protected DesktopManager getDesktopManager() {
        JDesktopPane desktop = frame.getDesktopPane();
        if (desktop != null) {
            return desktop.getDesktopManager();
        }

        if (defaultDesktopManager == null) {
            defaultDesktopManager = createDesktopManager();
        }
View Full Code Here

  protected JPopupMenu systemPopup = new JPopupMenu();
  protected AbstractAction  closeAll, disambleAll, dockBackAll   ;
  protected JMenuItem  iconifyAll;
  public CDIDesktop(){
    setLayout(new BorderLayout());
    desktop = new JDesktopPane();
    add(desktop, BorderLayout.CENTER);
    JPanel mousetrap = new JPanel();
    desktop. add(mousetrap,
            new Integer(Integer.MIN_VALUE));
    mousetrap.setOpaque(false);
View Full Code Here

        JPanel contentPane = (JPanel) getContentPane();
        _toolBarPane = new JPanel();
        _toolBar = new JToolBar();
        _statusBar = new JStatusBar();
        _desktopPane = new JDesktopPane();
        _desktopPane.setBackground(contentPane.getBackground());
        _palettePane = palette;
        _splitPane = new JSplitPane();
        _splitPane.setLeftComponent(_palettePane);
        _splitPane.setRightComponent(_desktopPane);
View Full Code Here

   
   
   
   
   
    JDesktopPane desktopPane = (JDesktopPane) editor.getSettings()
        .getObject(JGraphpadPane.KEY_DESKTOPPANE);
    JGraphpadWindowMenu windowMenu = (JGraphpadWindowMenu) editor
        .getSettings().getObject(JGraphpadWindowMenu.KEY_WINDOWMENU);
   
    if (desktopPane != null && windowMenu != null) {
View Full Code Here

                }
            });
        }

        void adjustSize() {
            JDesktopPane desktop = (JDesktopPane) getParent();
            if (desktop != null) {
                int height = getPreferredSize().height;
                Insets insets = getInsets();
                if (height == insets.top + insets.bottom) {
                    if (getHeight() <= height) {
                        // Initial size, because we have no buttons yet
                        height += 21;
                    } else {
                        // We already have a good height
                        height = getHeight();
                    }
                }
                setBounds(0, desktop.getHeight() - height, desktop.getWidth(), height);
                revalidate();
                repaint();
            }
        }
View Full Code Here

    protected ComponentListener createComponentListener() {
        if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
            return new ComponentHandler() {
                public void componentResized(ComponentEvent e) {
                    if (frame != null && frame.isMaximum()) {
                        JDesktopPane desktop = (JDesktopPane) e.getSource();
                        for (Component comp : desktop.getComponents()) {
                            if (comp instanceof SeaGlassDesktopPaneUI.TaskBar) {
                                frame.setBounds(0, 0, desktop.getWidth(), desktop.getHeight() - comp.getHeight());
                                frame.revalidate();
                                break;
                            }
                        }
                    }
View Full Code Here

    public void testMinimizeFrame() {
        Dimension size = new Dimension(10, 20);
        frame.setUI(ui);
        frame.setSize(size);
        frame.setMaximizable(true);
        JDesktopPane desktop = new JDesktopPane();
        desktop.setSize(new Dimension(100, 200));
        desktop.add(frame);
        try {
            frame.setMaximum(true);
        } catch (PropertyVetoException e) {
            assertTrue("exception", false);
        }
        assertTrue("size changed", frame.getSize().equals(desktop.getSize()));
        frame.setMaximizable(false);
        ui.minimizeFrame(frame);
        assertFalse("minimized", frame.getSize().equals(desktop.getSize()));
    }
View Full Code Here

    /*
     * Class under test for void maximizeFrame(JInternalFrame)
     */
    public void testMaximizeFrame() {
        frame.setUI(ui);
        JDesktopPane desktop = new JDesktopPane();
        desktop.setSize(new Dimension(100, 200));
        desktop.add(frame);
        ui.maximizeFrame(frame);
        assertTrue("maximized", frame.getSize().equals(desktop.getSize()));
    }
View Full Code Here

TOP

Related Classes of javax.swing.JDesktopPane$ComponentPosition

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.