src/share/classes/sun/swing/LightweightContent.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.swing;
  27 
  28 import javax.swing.JComponent;

  29 import java.awt.Cursor;







  30 
  31 /**
  32  * The interface by means of which the {@link JLightweightFrame} class
  33  * communicates to its client application.
  34  * <p>
  35  * The client application implements this interface so it can response
  36  * to requests and process notifications from {@code JLightweightFrame}.
  37  * An implementation of this interface is associated with a {@code
  38  * JLightweightFrame} instance via the {@link JLightweightFrame#setContent}
  39  * method.
  40  *
  41  * A hierarchy of components contained in the {@code JComponent} instance
  42  * returned by the {@link #getComponent} method should not contain any
  43  * heavyweight components, otherwise {@code JLightweightFrame} may fail
  44  * to paint it.
  45  *
  46  * @author Artem Ananiev
  47  * @author Anton Tarasov
  48  * @author Jim Graham
  49  */


 192     public void preferredSizeChanged(int width, int height);
 193 
 194     /**
 195      * {@code JLightweightFrame} calls this method to notify the client
 196      * application that the content maximum size has changed.
 197      */
 198     public void maximumSizeChanged(int width, int height);
 199 
 200     /**
 201      * {@code JLightweightFrame} calls this method to notify the client
 202      * application that the content minimum size has changed.
 203      */
 204     public void minimumSizeChanged(int width, int height);
 205 
 206     /**
 207      * {@code JLightweightFrame} calls this method to notify the client
 208      * application that in needs to set a cursor
 209      * @param cursor a cursor to set
 210      */
 211     default public void setCursor(Cursor cursor) { }





























 212 }


   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.swing;
  27 
  28 import javax.swing.JComponent;
  29 import java.awt.Component;
  30 import java.awt.Cursor;
  31 import java.awt.dnd.DragGestureEvent;
  32 import java.awt.dnd.DragGestureListener;
  33 import java.awt.dnd.DragGestureRecognizer;
  34 import java.awt.dnd.DragSource;
  35 import java.awt.dnd.DropTarget;
  36 import java.awt.dnd.InvalidDnDOperationException;
  37 import java.awt.dnd.peer.DragSourceContextPeer;
  38 
  39 /**
  40  * The interface by means of which the {@link JLightweightFrame} class
  41  * communicates to its client application.
  42  * <p>
  43  * The client application implements this interface so it can response
  44  * to requests and process notifications from {@code JLightweightFrame}.
  45  * An implementation of this interface is associated with a {@code
  46  * JLightweightFrame} instance via the {@link JLightweightFrame#setContent}
  47  * method.
  48  *
  49  * A hierarchy of components contained in the {@code JComponent} instance
  50  * returned by the {@link #getComponent} method should not contain any
  51  * heavyweight components, otherwise {@code JLightweightFrame} may fail
  52  * to paint it.
  53  *
  54  * @author Artem Ananiev
  55  * @author Anton Tarasov
  56  * @author Jim Graham
  57  */


 200     public void preferredSizeChanged(int width, int height);
 201 
 202     /**
 203      * {@code JLightweightFrame} calls this method to notify the client
 204      * application that the content maximum size has changed.
 205      */
 206     public void maximumSizeChanged(int width, int height);
 207 
 208     /**
 209      * {@code JLightweightFrame} calls this method to notify the client
 210      * application that the content minimum size has changed.
 211      */
 212     public void minimumSizeChanged(int width, int height);
 213 
 214     /**
 215      * {@code JLightweightFrame} calls this method to notify the client
 216      * application that in needs to set a cursor
 217      * @param cursor a cursor to set
 218      */
 219     default public void setCursor(Cursor cursor) { }
 220 
 221     /**
 222      * Create a drag gesture recognizer for the lightweight frame.
 223      */
 224     default public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
 225             Class<T> abstractRecognizerClass,
 226             DragSource ds, Component c, int srcActions,
 227             DragGestureListener dgl)
 228     {
 229         return null;
 230     }
 231     
 232     /**
 233      * Create a drag source context peer for the lightweight frame.
 234      */
 235     default public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException
 236     {
 237         return null;
 238     }
 239 
 240     /**
 241      * Adds a drop target to the lightweight frame.
 242      */
 243     default public void addDropTarget(DropTarget dt) {}
 244 
 245     /**
 246      * Removes a drop target from the lightweight frame.
 247      */
 248     default public void removeDropTarget(DropTarget dt) {}
 249 }