1. /*
  2. * @(#)DesktopManager.java 1.10 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing;
  11. /** DesktopManager objects are owned by a JDesktopPane object. They are responsible
  12. * for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame
  13. * implementations should delegate specific behaviors to the DesktopManager. For
  14. * instance, if a JInternalFrame was asked to iconify, it should try:
  15. * <PRE>
  16. * getDesktopPane().getDesktopManager().iconifyFrame(frame);
  17. * </PRE>
  18. * This delegation allows each L&F to provide custom behaviors for desktop-specific
  19. * actions. (For example, how and where the internal frame's icon would appear.)
  20. *
  21. * @see JDesktopPane
  22. * @see JInternalFrame
  23. * @see JInternalFrame.JDesktopIcon
  24. *
  25. * @version 1.10 02/02/00
  26. * @author David Kloba
  27. */
  28. public interface DesktopManager
  29. {
  30. /** If possible, display this frame in an appropriate location.
  31. * Normally, this is not called, as the creator of the JInternalFrame
  32. * will add the frame to the appropriate parent.
  33. */
  34. void openFrame(JInternalFrame f);
  35. /** Generally, this call should remove the frame from it's parent. */
  36. void closeFrame(JInternalFrame f);
  37. /** Generally, the frame should be resized to match it's parents bounds. */
  38. void maximizeFrame(JInternalFrame f);
  39. /** Generally, this indicates that the frame should be restored to it's
  40. * size and position prior to a maximizeFrame() call.
  41. */
  42. void minimizeFrame(JInternalFrame f);
  43. /** Generally, remove this frame from it's parent and add an iconic representation. */
  44. void iconifyFrame(JInternalFrame f);
  45. /** Generally, remove any iconic representation that is present and restore the
  46. * frame to it's original size and location.
  47. */
  48. void deiconifyFrame(JInternalFrame f);
  49. /**
  50. * Generally, indicate that this frame has focus. This is usually called after
  51. * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
  52. */
  53. void activateFrame(JInternalFrame f);
  54. /**
  55. * Generally, indicate that this frame has lost focus. This is usually called
  56. * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
  57. */
  58. void deactivateFrame(JInternalFrame f);
  59. /** This method is normally called when the user has indicated that
  60. * they will begin dragging a component around. This method should be called
  61. * prior to any dragFrame() calls to allow the DesktopManager to prepare any
  62. * necessary state. Normally <b>f</b> will be a JInternalFrame.
  63. */
  64. void beginDraggingFrame(JComponent f);
  65. /** The user has moved the frame. Calls to this method will be preceeded by calls
  66. * to beginDraggingFrame().
  67. * Normally <b>f</b> will be a JInternalFrame.
  68. */
  69. void dragFrame(JComponent f, int newX, int newY);
  70. /** This method signals the end of the dragging session. Any state maintained by
  71. * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
  72. */
  73. void endDraggingFrame(JComponent f);
  74. /** This methods is normally called when the user has indicated that
  75. * they will begin resizing the frame. This method should be called
  76. * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
  77. * necessary state. Normally <b>f</b> will be a JInternalFrame.
  78. */
  79. void beginResizingFrame(JComponent f, int direction);
  80. /** The user has resized the component. Calls to this method will be preceeded by calls
  81. * to beginResizingFrame().
  82. * Normally <b>f</b> will be a JInternalFrame.
  83. */
  84. void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  85. /** This method signals the end of the resize session. Any state maintained by
  86. * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
  87. */
  88. void endResizingFrame(JComponent f);
  89. /** This is a primative reshape method.*/
  90. void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  91. }