< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java

Print this page

        

@@ -40,26 +40,35 @@
  * @author David Kloba
  * @author Rich Schiavi
  */
 public class BasicInternalFrameUI extends InternalFrameUI
 {
-
+    /** frame */
     protected JInternalFrame frame;
 
     private Handler handler;
+    /** border listener */
     protected MouseInputAdapter          borderListener;
+    /** property change listener */
     protected PropertyChangeListener     propertyChangeListener;
+    /** internal frame layout */
     protected LayoutManager              internalFrameLayout;
+    /** component listener */
     protected ComponentListener          componentListener;
+    /** glass pane dispatcher */
     protected MouseInputListener         glassPaneDispatcher;
     private InternalFrameListener        internalFrameListener;
 
+    /** north pane */
     protected JComponent northPane;
+    /** south pane */
     protected JComponent southPane;
+    /** west pane */
     protected JComponent westPane;
+    /** east pane */
     protected JComponent eastPane;
-
+    /** title pane */
     protected BasicInternalFrameTitlePane titlePane; // access needs this
 
     private static DesktopManager sharedDesktopManager;
     private boolean componentListenerAdded = false;
 

@@ -83,21 +92,34 @@
     private boolean keyBindingActive = false;
 
 /////////////////////////////////////////////////////////////////////////////
 // ComponentUI Interface Implementation methods
 /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Returns a component UI.
+     * @param b a component
+     * @return a component UI
+     */
     public static ComponentUI createUI(JComponent b)    {
         return new BasicInternalFrameUI((JInternalFrame)b);
     }
 
+    /**
+     * Constructs a {@code BasicInternalFrameUI}.
+     * @param b the internal frame
+     */
     public BasicInternalFrameUI(JInternalFrame b)   {
         LookAndFeel laf = UIManager.getLookAndFeel();
         if (laf instanceof BasicLookAndFeel) {
             ((BasicLookAndFeel)laf).installAWTEventListener();
         }
     }
 
+    /**
+     * Install the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c)   {
 
         frame = (JInternalFrame)c;
 
         installDefaults();

@@ -106,10 +128,14 @@
         installKeyboardActions();
 
         LookAndFeel.installProperty(frame, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstall the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         if(c != frame)
             throw new IllegalComponentStateException(
                 this + " was asked to deinstall() "
                 + c + " when it only knows about "

@@ -122,10 +148,13 @@
         updateFrameCursor();
         handler = null;
         frame = null;
     }
 
+    /**
+     * Install the defaults.
+     */
     protected void installDefaults(){
         Icon frameIcon = frame.getFrameIcon();
         if (frameIcon == null || frameIcon instanceof UIResource) {
             frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon"));
         }

@@ -142,10 +171,13 @@
         frame.setBackground(UIManager.getLookAndFeelDefaults().getColor("control"));
 
         LookAndFeel.installBorder(frame, "InternalFrame.border");
 
     }
+    /**
+     * Install the keyboard actions.
+     */
     protected void installKeyboardActions(){
         createInternalFrameListener();
         if (internalFrameListener != null) {
             frame.addInternalFrameListener(internalFrameListener);
         }

@@ -182,18 +214,22 @@
 
         // Set the ActionMap's parent to the Auditory Feedback Action Map
         BasicLookAndFeel.installAudioActionMap(map);
     }
 
+    /**
+     * Installs the components.
+     */
     protected void installComponents(){
         setNorthPane(createNorthPane(frame));
         setSouthPane(createSouthPane(frame));
         setEastPane(createEastPane(frame));
         setWestPane(createWestPane(frame));
     }
 
     /**
+     * Installs the listeners.
      * @since 1.3
      */
     protected void installListeners() {
         borderListener = createBorderListener(frame);
         propertyChangeListener = createPropertyChangeListener();

@@ -255,20 +291,26 @@
             }
         }
         return null;
     }
 
+    /**
+     * Uninstall the defaults.
+     */
     protected void uninstallDefaults() {
         Icon frameIcon = frame.getFrameIcon();
         if (frameIcon instanceof UIResource) {
             frame.setFrameIcon(null);
         }
         internalFrameLayout = null;
         frame.setLayout(null);
         LookAndFeel.uninstallBorder(frame);
     }
 
+    /**
+     * Uninstall the components.
+     */
     protected void uninstallComponents(){
         setNorthPane(null);
         setSouthPane(null);
         setEastPane(null);
         setWestPane(null);

@@ -277,10 +319,11 @@
         }
         titlePane = null;
     }
 
     /**
+     * Uninstall the listeners.
      * @since 1.3
      */
     protected void uninstallListeners() {
         if ((frame.getParent() != null) && componentListenerAdded) {
             frame.getParent().removeComponentListener(componentListener);

@@ -296,10 +339,13 @@
       frame.removePropertyChangeListener(propertyChangeListener);
       propertyChangeListener = null;
       borderListener = null;
     }
 
+    /**
+     * Uninstall the keyboard actions.
+     */
     protected void uninstallKeyboardActions(){
         if (internalFrameListener != null) {
             frame.removeInternalFrameListener(internalFrameListener);
         }
         internalFrameListener = null;

@@ -319,33 +365,54 @@
             s = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
         }
         frame.setCursor(s);
     }
 
+    /**
+     * Creates the layout manager.
+     * @return the layout manager
+     */
     protected LayoutManager createLayoutManager(){
         return getHandler();
     }
 
+    /**
+     * Creates the property change listener.
+     * @return the property change listener
+     */
     protected PropertyChangeListener createPropertyChangeListener(){
         return getHandler();
     }
 
-
-
+    /**
+     * Returns the preferred size.
+     * @param x the component
+     * @return the preferred size
+     */
     public Dimension getPreferredSize(JComponent x)    {
         if(frame == x)
             return frame.getLayout().preferredLayoutSize(x);
         return new Dimension(100, 100);
     }
 
+    /**
+     * Returns the minimum size.
+     * @param x the component
+     * @return the minimum size
+     */
     public Dimension getMinimumSize(JComponent x)  {
         if(frame == x) {
             return frame.getLayout().minimumLayoutSize(x);
         }
         return new Dimension(0, 0);
     }
 
+    /**
+     * Returns the maximum size.
+     * @param x the component
+     * @return the maximum size
+     */
     public Dimension getMaximumSize(JComponent x) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
 
 

@@ -369,64 +436,118 @@
            frame.add(newPane);
            installMouseHandlers(newPane);
         }
     }
 
+    /**
+     * Deinstalls the mouse handlers.
+     * @param c the component
+     */
     protected void deinstallMouseHandlers(JComponent c) {
       c.removeMouseListener(borderListener);
       c.removeMouseMotionListener(borderListener);
     }
 
+    /**
+     * Installs the mouse handlers.
+     * @param c the component
+     */
     protected void installMouseHandlers(JComponent c) {
       c.addMouseListener(borderListener);
       c.addMouseMotionListener(borderListener);
     }
 
+    /**
+     * Creates the north pane.
+     * @param w the internal frame
+     * @return the north pane
+     */
     protected JComponent createNorthPane(JInternalFrame w) {
       titlePane = new BasicInternalFrameTitlePane(w);
       return titlePane;
     }
 
 
+    /**
+     * Creates the north pane.
+     * @param w the internal frame
+     * @return the north pane
+     */
     protected JComponent createSouthPane(JInternalFrame w) {
         return null;
     }
 
+    /**
+     * Creates the west pane.
+     * @param w the internal frame
+     * @return the west pane
+     */
     protected JComponent createWestPane(JInternalFrame w) {
         return null;
     }
 
+    /**
+     * Creates the east pane.
+     * @param w the internal frame
+     * @return the east pane
+     */
     protected JComponent createEastPane(JInternalFrame w) {
         return null;
     }
 
-
+    /**
+     * Creates the border listener.
+     * @param w the internal frame
+     * @return the border listener
+     */
     protected MouseInputAdapter createBorderListener(JInternalFrame w) {
         return new BorderListener();
     }
 
+    /**
+     * Creates the internal frame listener.
+     */
     protected void createInternalFrameListener(){
         internalFrameListener = getHandler();
     }
 
+    /**
+     * Returns whether or no the key binding is registered.
+     * @return whether or no the key binding is registered
+     */
     protected final boolean isKeyBindingRegistered(){
       return keyBindingRegistered;
     }
 
+    /**
+     * Sets the key binding registration.
+     * @param b new value for key binding registration
+     */
     protected final void setKeyBindingRegistered(boolean b){
       keyBindingRegistered = b;
     }
 
+    /**
+     * Returns whether or no the key binding is active.
+     * @return whether or no the key binding is active
+     */
     public final boolean isKeyBindingActive(){
       return keyBindingActive;
     }
 
+    /**
+     * Sets the key binding activity.
+     * @param b new value for key binding activity
+     */
     protected final void setKeyBindingActive(boolean b){
       keyBindingActive = b;
     }
 
 
+    /**
+     * Setup the menu open key.
+     */
     protected void setupMenuOpenKey(){
         // PENDING(hania): Why are these WHEN_IN_FOCUSED_WINDOWs? Shouldn't
         // they be WHEN_ANCESTOR_OF_FOCUSED_COMPONENT?
         // Also, no longer registering on the desktopicon, the previous
         // action did nothing.

@@ -435,17 +556,28 @@
                                       JComponent.WHEN_IN_FOCUSED_WINDOW, map);
         //ActionMap actionMap = getActionMap();
         //SwingUtilities.replaceUIActionMap(frame, actionMap);
     }
 
+    /**
+     * Setup the menu close key.
+     */
     protected void setupMenuCloseKey(){
     }
 
+    /**
+     * Returns the north pane.
+     * @return the north pane
+     */
     public JComponent getNorthPane() {
         return northPane;
     }
 
+    /**
+     * Set the north pane.
+     * @param c the new north pane
+     */
     public void setNorthPane(JComponent c) {
         if (northPane != null &&
                 northPane instanceof BasicInternalFrameTitlePane) {
             ((BasicInternalFrameTitlePane)northPane).uninstallListeners();
         }

@@ -454,34 +586,61 @@
         if (c instanceof BasicInternalFrameTitlePane) {
           titlePane = (BasicInternalFrameTitlePane)c;
         }
     }
 
+    /**
+     * Returns the south pane.
+     * @return the south pane
+     */
     public JComponent getSouthPane() {
         return southPane;
     }
 
+    /**
+     * Set the south pane.
+     * @param c the new south pane
+     */
     public void setSouthPane(JComponent c) {
         southPane = c;
     }
 
+    /**
+     * Returns the west pane.
+     * @return the west pane
+     */
     public JComponent getWestPane() {
         return westPane;
     }
 
+    /**
+     * Set the west pane.
+     * @param c the new west pane
+     */
     public void setWestPane(JComponent c) {
         westPane = c;
     }
 
+    /**
+     * Returns the east pane.
+     * @return the east pane
+     */
     public JComponent getEastPane() {
         return eastPane;
     }
 
+    /**
+     * Set the east pane.
+     * @param c the new east pane
+     */
     public void setEastPane(JComponent c) {
         eastPane = c;
     }
 
+    /**
+     * Internal frame property change listener.
+     */
     public class InternalFramePropertyChangeListener implements
         PropertyChangeListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this

@@ -493,31 +652,49 @@
         public void propertyChange(PropertyChangeEvent evt) {
             getHandler().propertyChange(evt);
         }
     }
 
+    /**
+     * Internal frame layout.
+     */
   public class InternalFrameLayout implements LayoutManager {
     // NOTE: This class exists only for backward compatibility. All
     // its functionality has been moved into Handler. If you need to add
     // new functionality add it to the Handler, but make sure this
     // class calls into the Handler.
+      /**
+       * {@inheritDoc}
+       */
     public void addLayoutComponent(String name, Component c) {
         getHandler().addLayoutComponent(name, c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public void removeLayoutComponent(Component c) {
         getHandler().removeLayoutComponent(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public Dimension preferredLayoutSize(Container c)  {
         return getHandler().preferredLayoutSize(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public Dimension minimumLayoutSize(Container c) {
         return getHandler().minimumLayoutSize(c);
     }
 
+      /**
+       * {@inheritDoc}
+       */
     public void layoutContainer(Container c) {
         getHandler().layoutContainer(c);
     }
   }
 

@@ -525,20 +702,25 @@
     /**
      * Returns the proper DesktopManager. Calls getDesktopPane() to
      * find the JDesktop component and returns the desktopManager from
      * it. If this fails, it will return a default DesktopManager that
      * should work in arbitrary parents.
+     * @return the proper DesktopManager
      */
     protected DesktopManager getDesktopManager() {
         if(frame.getDesktopPane() != null
            && frame.getDesktopPane().getDesktopManager() != null)
             return frame.getDesktopPane().getDesktopManager();
         if(sharedDesktopManager == null)
           sharedDesktopManager = createDesktopManager();
         return sharedDesktopManager;
     }
 
+    /**
+     * Creates the desktop manager.
+     * @return the desktop manager
+     */
     protected DesktopManager createDesktopManager(){
       return new DefaultDesktopManager();
     }
 
     /**

@@ -651,11 +833,11 @@
         // __x & __y are the mousePressed location in source view's coordinate system
         int __x, __y;
         Rectangle startingBounds;
         int resizeDir;
 
-
+        /** resize none */
         protected final int RESIZE_NONE  = 0;
         private boolean discardRelease = false;
 
         int resizeCornerSize = 16;
 

@@ -1112,106 +1294,172 @@
             updateFrameCursor();
         }
 
     }    /// End BorderListener Class
 
+    /**
+     * Component handler.
+     */
     protected class ComponentHandler implements ComponentListener {
       // NOTE: This class exists only for backward compatibility. All
       // its functionality has been moved into Handler. If you need to add
       // new functionality add it to the Handler, but make sure this
       // class calls into the Handler.
       /** Invoked when a JInternalFrame's parent's size changes. */
       public void componentResized(ComponentEvent e) {
           getHandler().componentResized(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void componentMoved(ComponentEvent e) {
           getHandler().componentMoved(e);
       }
+        /**
+         * {@inheritDoc}
+         */
       public void componentShown(ComponentEvent e) {
           getHandler().componentShown(e);
       }
+        /**
+         * {@inheritDoc}
+         */
       public void componentHidden(ComponentEvent e) {
           getHandler().componentHidden(e);
       }
     }
 
+    /**
+     * Creates a component listener.
+     * @return a component listener
+     */
     protected ComponentListener createComponentListener() {
       return getHandler();
     }
 
 
+    /**
+     * Glass pane dispatcher.
+     */
     protected class GlassPaneDispatcher implements MouseInputListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
+        /**
+         * {@inheritDoc}
+         */
         public void mousePressed(MouseEvent e) {
             getHandler().mousePressed(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseEntered(MouseEvent e) {
             getHandler().mouseEntered(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseMoved(MouseEvent e) {
             getHandler().mouseMoved(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseExited(MouseEvent e) {
             getHandler().mouseExited(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseClicked(MouseEvent e) {
             getHandler().mouseClicked(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseReleased(MouseEvent e) {
             getHandler().mouseReleased(e);
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public void mouseDragged(MouseEvent e) {
             getHandler().mouseDragged(e);
         }
     }
 
+    /**
+     * Creates a {@code GlassPaneDispatcher}.
+     * @return a {@code GlassPaneDispatcher}
+     */
     protected MouseInputListener createGlassPaneDispatcher() {
         return null;
     }
 
-
+    /**
+     * Basic internal frame listener.
+     */
     protected class BasicInternalFrameListener implements InternalFrameListener
     {
       // NOTE: This class exists only for backward compatibility. All
       // its functionality has been moved into Handler. If you need to add
       // new functionality add it to the Handler, but make sure this
       // class calls into the Handler.
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameClosing(InternalFrameEvent e) {
           getHandler().internalFrameClosing(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameClosed(InternalFrameEvent e) {
           getHandler().internalFrameClosed(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameOpened(InternalFrameEvent e) {
           getHandler().internalFrameOpened(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameIconified(InternalFrameEvent e) {
           getHandler().internalFrameIconified(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameDeiconified(InternalFrameEvent e) {
           getHandler().internalFrameDeiconified(e);
       }
 
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameActivated(InternalFrameEvent e) {
           getHandler().internalFrameActivated(e);
       }
 
-
+        /**
+         * {@inheritDoc}
+         */
       public void internalFrameDeactivated(InternalFrameEvent e) {
           getHandler().internalFrameDeactivated(e);
       }
     }
 
< prev index next >