/[classpath]/classpath/javax/swing/DefaultDesktopManager.java
ViewVC logotype

Diff of /classpath/javax/swing/DefaultDesktopManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6.2.2 by gnu_andrew, Sun Jan 16 15:15:13 2005 UTC revision 1.6.2.3 by gnu_andrew, Thu Jan 27 09:45:34 2005 UTC
# Line 1  Line 1 
1  /* DefaultDesktopManager.java --  /* DefaultDesktopManager.java --
2     Copyright (C) 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package javax.swing;  package javax.swing;
40    
41  import java.awt.Component;  import java.awt.Component;
# Line 90  public class DefaultDesktopManager imple Line 91  public class DefaultDesktopManager imple
91     */     */
92    public DefaultDesktopManager()    public DefaultDesktopManager()
93    {    {
94    } // DefaultDesktopManager()    }
95    
96    /**    /**
97     * This method is not normally called since the user will typically add the     * This method is not normally called since the user will typically add the
# Line 111  public class DefaultDesktopManager imple Line 112  public class DefaultDesktopManager imple
112      c.remove(frame.getDesktopIcon());      c.remove(frame.getDesktopIcon());
113      c.add(frame);      c.add(frame);
114      frame.setVisible(true);      frame.setVisible(true);
115    } // openFrame()    }
116    
117    /**    /**
118     * This method removes the JInternalFrame and JDesktopIcon (if one is     * This method removes the JInternalFrame and JDesktopIcon (if one is
# Line 132  public class DefaultDesktopManager imple Line 133  public class DefaultDesktopManager imple
133            c.remove(frame);            c.remove(frame);
134          c.repaint();          c.repaint();
135        }        }
136    } // closeFrame()    }
137    
138    /**    /**
139     * This method resizes the JInternalFrame to match its parent's bounds.     * This method resizes the JInternalFrame to match its parent's bounds.
# Line 171  public class DefaultDesktopManager imple Line 172  public class DefaultDesktopManager imple
172              // Do nothing.              // Do nothing.
173            }            }
174        }        }
175    } // maximizeFrame()    }
176    
177    /**    /**
178     * This method restores the JInternalFrame's bounds to what they were     * This method restores the JInternalFrame's bounds to what they were
# Line 200  public class DefaultDesktopManager imple Line 201  public class DefaultDesktopManager imple
201    
202      setBoundsForFrame(frame, normalBounds.x, normalBounds.y,      setBoundsForFrame(frame, normalBounds.x, normalBounds.y,
203                        normalBounds.width, normalBounds.height);                        normalBounds.width, normalBounds.height);
204    } // minimizeFrame()    }
205    
206    /**    /**
207     * This method removes the JInternalFrame from its parent and adds its     * This method removes the JInternalFrame from its parent and adds its
# Line 231  public class DefaultDesktopManager imple Line 232  public class DefaultDesktopManager imple
232        {        {
233          Rectangle r = getBoundsForIconOf(frame);          Rectangle r = getBoundsForIconOf(frame);
234          icon.setBounds(r);          icon.setBounds(r);
235          setWasIcon(frame, true);          setWasIcon(frame, Boolean.TRUE);
236        }        }
237    
238      if (c != null)      if (c != null)
# Line 243  public class DefaultDesktopManager imple Line 244  public class DefaultDesktopManager imple
244            }            }
245          c.remove(frame);          c.remove(frame);
246        }        }
247    } // iconifyFrame()    }
248    
249    /**    /**
250     * This method removes the JInternalFrame's JDesktopIcon representation and     * This method removes the JInternalFrame's JDesktopIcon representation and
# Line 279  public class DefaultDesktopManager imple Line 280  public class DefaultDesktopManager imple
280        }        }
281    
282      c.invalidate();      c.invalidate();
283    } // deiconifyFrame()    }
284    
285    /**    /**
286     * This method activates the JInternalFrame by moving it to the front and     * This method activates the JInternalFrame by moving it to the front and
# Line 305  public class DefaultDesktopManager imple Line 306  public class DefaultDesktopManager imple
306        }        }
307    
308      frame.toFront();      frame.toFront();
309    } // activateFrame()    }
310    
311    /**    /**
312     * This method is called when the JInternalFrame loses focus.     * This method is called when the JInternalFrame loses focus.
# Line 330  public class DefaultDesktopManager imple Line 331  public class DefaultDesktopManager imple
331            {            {
332            }            }
333        }        }
334    } // deactivateFrame()    }
335    
336    /**    /**
337     * This method is called to indicate that the DesktopManager should prepare     * This method is called to indicate that the DesktopManager should prepare
# Line 354  public class DefaultDesktopManager imple Line 355  public class DefaultDesktopManager imple
355        currentDragMode = JDesktopPane.LIVE_DRAG_MODE;        currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
356      else      else
357        currentDragMode = ((JDesktopPane) pane).getDragMode();        currentDragMode = ((JDesktopPane) pane).getDragMode();
358    } // beginDraggingFrame()    }
359    
360    /**    /**
361     * This method is called to drag the JInternalFrame to a new location.     * This method is called to drag the JInternalFrame to a new location.
# Line 378  public class DefaultDesktopManager imple Line 379  public class DefaultDesktopManager imple
379            setBoundsForFrame((JInternalFrame) component, newX, newY, b.width,            setBoundsForFrame((JInternalFrame) component, newX, newY, b.width,
380                              b.height);                              b.height);
381        }        }
382    } // dragFrame()    }
383    
384    /**    /**
385     * This method indicates that the dragging is done. Any state information     * This method indicates that the dragging is done. Any state information
# Line 396  public class DefaultDesktopManager imple Line 397  public class DefaultDesktopManager imple
397          dragCache = null;          dragCache = null;
398        }        }
399      component.repaint();      component.repaint();
400    } // endDraggingFrame()    }
401    
402    /**    /**
403     * This method is called to indicate that the given JComponent will be     * This method is called to indicate that the given JComponent will be
# Line 417  public class DefaultDesktopManager imple Line 418  public class DefaultDesktopManager imple
418        currentDragMode = JDesktopPane.LIVE_DRAG_MODE;        currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
419      else      else
420        currentDragMode = ((JDesktopPane) pane).getDragMode();        currentDragMode = ((JDesktopPane) pane).getDragMode();
421    } // beginResizingFrame()    }
422    
423    /**    /**
424     * This method resizes the give JComponent.     * This method resizes the give JComponent.
# Line 440  public class DefaultDesktopManager imple Line 441  public class DefaultDesktopManager imple
441      else      else
442        setBoundsForFrame(component, dragCache.x, dragCache.y, dragCache.width,        setBoundsForFrame(component, dragCache.x, dragCache.y, dragCache.width,
443                          dragCache.height);                          dragCache.height);
444    } // resizeFrame()    }
445    
446    /**    /**
447     * This method is called to indicate that the given JComponent has finished     * This method is called to indicate that the given JComponent has finished
# Line 459  public class DefaultDesktopManager imple Line 460  public class DefaultDesktopManager imple
460          dragCache = null;          dragCache = null;
461        }        }
462      component.repaint();      component.repaint();
463    } // endResizingFrame()    }
464    
465    /**    /**
466     * This method calls setBounds with the given parameters and repaints the     * This method calls setBounds with the given parameters and repaints the
# Line 482  public class DefaultDesktopManager imple Line 483  public class DefaultDesktopManager imple
483        component.getParent().repaint();        component.getParent().repaint();
484      else      else
485        component.repaint();        component.repaint();
486    } // setBoundsForFrame()    }
487    
488    /**    /**
489     * This is a helper method that removes the JDesktopIcon of the given     * This is a helper method that removes the JDesktopIcon of the given
# Line 496  public class DefaultDesktopManager imple Line 497  public class DefaultDesktopManager imple
497      Container c = icon.getParent();      Container c = icon.getParent();
498      if (c != null && icon != null)      if (c != null && icon != null)
499        c.remove(icon);        c.remove(icon);
500    } // removeIconFor()    }
501    
502    /**    /**
503     * This method is called by iconifyFrame to determine the bounds of the     * This method is called by iconifyFrame to determine the bounds of the
# Line 570  public class DefaultDesktopManager imple Line 571  public class DefaultDesktopManager imple
571        }        }
572    
573      return ideal;      return ideal;
574    } // getBoundsForIconOf()    }
575    
576    /**    /**
577     * This method sets the bounds of the JInternalFrame right before the     * This method sets the bounds of the JInternalFrame right before the
# Line 582  public class DefaultDesktopManager imple Line 583  public class DefaultDesktopManager imple
583    protected void setPreviousBounds(JInternalFrame frame, Rectangle rect)    protected void setPreviousBounds(JInternalFrame frame, Rectangle rect)
584    {    {
585      frame.setNormalBounds(rect);      frame.setNormalBounds(rect);
586    } // setPreviousBounds()    }
587    
588    /**    /**
589     * This method returns the normal bounds of the JInternalFrame from before     * This method returns the normal bounds of the JInternalFrame from before
# Line 595  public class DefaultDesktopManager imple Line 596  public class DefaultDesktopManager imple
596    protected Rectangle getPreviousBounds(JInternalFrame frame)    protected Rectangle getPreviousBounds(JInternalFrame frame)
597    {    {
598      return frame.getNormalBounds();      return frame.getNormalBounds();
599    } // getPreviousBounds()    }
600    
601    /**    /**
602     * This method sets the value to true if the given JInternalFrame has been     * This method sets the value to true if the given JInternalFrame has been
# Line 605  public class DefaultDesktopManager imple Line 606  public class DefaultDesktopManager imple
606     * @param value True if the JInternalFrame has been iconized and the bounds     * @param value True if the JInternalFrame has been iconized and the bounds
607     *        of the JDesktopIcon are valid.     *        of the JDesktopIcon are valid.
608     */     */
609    protected void setWasIcon(JInternalFrame frame, boolean value)    protected void setWasIcon(JInternalFrame frame, Boolean value)
610    {    {
611      frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY);      frame.setWasIcon(value.booleanValue(), WAS_ICON_ONCE_PROPERTY);
612    } // setWasIcon()    }
613    
614    /**    /**
615     * This method returns true if the given JInternalFrame has been iconized     * This method returns true if the given JInternalFrame has been iconized
# Line 622  public class DefaultDesktopManager imple Line 623  public class DefaultDesktopManager imple
623    protected boolean wasIcon(JInternalFrame frame)    protected boolean wasIcon(JInternalFrame frame)
624    {    {
625      return frame.getWasIcon();      return frame.getWasIcon();
626    } // wasIcon()    }
627  } // DefaultDesktopManager  }

Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.6.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26