jdk/src/share/classes/sun/swing/LightweightContent.java
author anthony
Tue, 12 Aug 2014 14:22:05 +0400
changeset 26342 3637212ae8f2
parent 25195 9de77f5b0df2
permissions -rw-r--r--
8049065: [JLightweightFrame] Support DnD for SwingNode Summary: Delegate DnD operations to LightweightContent when appropriate Reviewed-by: ant, pchelko
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     1
/*
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     4
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    10
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    15
 * accompanied this code).
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    16
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    20
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    23
 * questions.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    24
 */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    25
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    26
package sun.swing;
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    27
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    28
import javax.swing.JComponent;
26342
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    29
import java.awt.Component;
20127
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
    30
import java.awt.Cursor;
26342
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    31
import java.awt.dnd.DragGestureEvent;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    32
import java.awt.dnd.DragGestureListener;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    33
import java.awt.dnd.DragGestureRecognizer;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    34
import java.awt.dnd.DragSource;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    35
import java.awt.dnd.DropTarget;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    36
import java.awt.dnd.InvalidDnDOperationException;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
    37
import java.awt.dnd.peer.DragSourceContextPeer;
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    38
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    39
/**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    40
 * The interface by means of which the {@link JLightweightFrame} class
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    41
 * communicates to its client application.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    42
 * <p>
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    43
 * The client application implements this interface so it can response
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    44
 * to requests and process notifications from {@code JLightweightFrame}.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    45
 * An implementation of this interface is associated with a {@code
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    46
 * JLightweightFrame} instance via the {@link JLightweightFrame#setContent}
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    47
 * method.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    48
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    49
 * A hierarchy of components contained in the {@code JComponent} instance
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    50
 * returned by the {@link #getComponent} method should not contain any
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    51
 * heavyweight components, otherwise {@code JLightweightFrame} may fail
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    52
 * to paint it.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    53
 *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    54
 * @author Artem Ananiev
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    55
 * @author Anton Tarasov
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    56
 * @author Jim Graham
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    57
 */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    58
public interface LightweightContent {
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    59
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    60
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    61
     * The client application overrides this method to return the {@code
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    62
     * JComponent} instance which the {@code JLightweightFrame} container
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    63
     * will paint as its lightweight content. A hierarchy of components
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    64
     * contained in this component should not contain any heavyweight objects.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    65
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    66
     * @return the component to paint
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    67
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    68
    public JComponent getComponent();
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    69
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    70
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    71
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    72
     * application that it acquires the paint lock. The client application
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    73
     * should implement the locking mechanism in order to synchronize access
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    74
     * to the content image data, shared between {@code JLightweightFrame}
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    75
     * and the client application.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    76
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    77
     * @see #paintUnlock
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    78
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    79
    public void paintLock();
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    80
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    81
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    82
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    83
     * application that it releases the paint lock. The client application
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    84
     * should implement the locking mechanism in order to synchronize access
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    85
     * to the content image data, shared between {@code JLightweightFrame}
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    86
     * and the client application.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    87
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    88
     * @see #paintLock
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    89
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    90
    public void paintUnlock();
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    91
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    92
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    93
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    94
     * application that a new data buffer has been set as a content pixel
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    95
     * buffer. Typically this occurs when a buffer of a larger size is
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
    96
     * created in response to a content resize event.
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
    97
     * <p>
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
    98
     * The method reports a reference to the pixel data buffer, the content
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
    99
     * image bounds within the buffer and the line stride of the buffer.
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   100
     * These values have the following correlation.
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   101
     * The {@code width} and {@code height} matches the layout size of the content
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   102
     * (the component returned from the {@link #getComponent} method). The
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   103
     * {@code x} and {@code y} is the origin of the content, {@code (0, 0)}
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   104
     * in the layout coordinate space of the content, appearing at
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   105
     * {@code data[y * scale * linestride + x * scale]} in the buffer.
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   106
     * A pixel with indices {@code (i, j)}, where {@code (0 <= i < width)} and
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   107
     * {@code (0 <= j < height)}, in the layout coordinate space of the content
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   108
     * is represented by a {@code scale^2} square of pixels in the physical
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   109
     * coordinate space of the buffer. The top-left corner of the square has the
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   110
     * following physical coordinate in the buffer:
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   111
     * {@code data[(y + j) * scale * linestride + (x + i) * scale]}.
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   112
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   113
     * @param data the content pixel data buffer of INT_ARGB_PRE type
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   114
     * @param x the logical x coordinate of the image
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   115
     * @param y the logical y coordinate of the image
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   116
     * @param width the logical width of the image
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   117
     * @param height the logical height of the image
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   118
     * @param linestride the line stride of the pixel buffer
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   119
     * @param scale the scale factor of the pixel buffer
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   120
     */
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   121
    default public void imageBufferReset(int[] data,
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   122
                                 int x, int y,
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   123
                                 int width, int height,
25195
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   124
                                 int linestride,
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   125
                                 int scale)
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   126
    {
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   127
        imageBufferReset(data, x, y, width, height, linestride);
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   128
    }
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   129
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   130
    /**
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   131
     * The default implementation for #imageBufferReset uses a hard-coded value
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   132
     * of 1 for the scale factor. Both the old and the new methods provide
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   133
     * default implementations in order to allow a client application to run
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   134
     * with any JDK version without breaking backward compatibility.
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   135
     */
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   136
    default public void imageBufferReset(int[] data,
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   137
                                 int x, int y,
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   138
                                 int width, int height,
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   139
                                 int linestride)
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   140
    {
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   141
        imageBufferReset(data, x, y, width, height, linestride, 1);
9de77f5b0df2 8029455: [JLightweightFrame] support scaled painting
serb
parents: 20127
diff changeset
   142
    }
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   143
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   144
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   145
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   146
     * application that the content image bounds have been changed within the
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   147
     * image's pixel buffer.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   148
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   149
     * @param x the x coordinate of the image
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   150
     * @param y the y coordinate of the image
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   151
     * @param width the width of the image
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   152
     * @param height the height of the image
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   153
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   154
     * @see #imageBufferReset
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   155
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   156
    public void imageReshaped(int x, int y, int width, int height);
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   157
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   158
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   159
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   160
     * application that a part of the content image, or the whole image has
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   161
     * been updated. The method reports bounds of the rectangular dirty region.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   162
     * The {@code dirtyX} and {@code dirtyY} is the origin of the dirty
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   163
     * rectangle, which is relative to the origin of the content, appearing
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   164
     * at {@code data[(y + dirtyY] * linestride + (x + dirtyX)]} in the pixel
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   165
     * buffer (see {@link #imageBufferReset}). All indices
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   166
     * {@code data[(y + dirtyY + j) * linestride + (x + dirtyX + i)]} where
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   167
     * {@code (0 <= i < dirtyWidth)} and {@code (0 <= j < dirtyHeight)}
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   168
     * will represent valid pixel data, {@code (i, j)} in the coordinate space
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   169
     * of the dirty rectangle.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   170
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   171
     * @param dirtyX the x coordinate of the dirty rectangle,
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   172
     *        relative to the image origin
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   173
     * @param dirtyY the y coordinate of the dirty rectangle,
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   174
     *        relative to the image origin
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   175
     * @param dirtyWidth the width of the dirty rectangle
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   176
     * @param dirtyHeight the height of the dirty rectangle
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   177
     *
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   178
     * @see #imageBufferReset
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   179
     * @see #imageReshaped
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   180
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   181
    public void imageUpdated(int dirtyX, int dirtyY,
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   182
                             int dirtyWidth, int dirtyHeight);
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   183
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   184
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   185
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   186
     * application that the frame has grabbed focus.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   187
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   188
    public void focusGrabbed();
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   189
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   190
    /**
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   191
     * {@code JLightweightFrame} calls this method to notify the client
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   192
     * application that the frame has ungrabbed focus.
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   193
     */
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   194
    public void focusUngrabbed();
19026
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   195
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   196
    /**
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   197
     * {@code JLightweightFrame} calls this method to notify the client
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   198
     * application that the content preferred size has changed.
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   199
     */
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   200
    public void preferredSizeChanged(int width, int height);
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   201
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   202
    /**
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   203
     * {@code JLightweightFrame} calls this method to notify the client
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   204
     * application that the content maximum size has changed.
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   205
     */
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   206
    public void maximumSizeChanged(int width, int height);
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   207
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   208
    /**
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   209
     * {@code JLightweightFrame} calls this method to notify the client
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   210
     * application that the content minimum size has changed.
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   211
     */
96141cb8d7eb 8020927: JLightweightFrame API should export layout properties change notifications
ant
parents: 15983
diff changeset
   212
    public void minimumSizeChanged(int width, int height);
20127
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   213
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   214
    /**
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   215
     * {@code JLightweightFrame} calls this method to notify the client
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   216
     * application that in needs to set a cursor
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   217
     * @param cursor a cursor to set
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   218
     */
a3a34675d847 8024170: [SwingNode] Implement cursor change
pchelko
parents: 19026
diff changeset
   219
    default public void setCursor(Cursor cursor) { }
26342
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   220
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   221
    /**
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   222
     * Create a drag gesture recognizer for the lightweight frame.
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   223
     */
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   224
    default public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   225
            Class<T> abstractRecognizerClass,
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   226
            DragSource ds, Component c, int srcActions,
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   227
            DragGestureListener dgl)
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   228
    {
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   229
        return null;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   230
    }
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   231
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   232
    /**
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   233
     * Create a drag source context peer for the lightweight frame.
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   234
     */
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   235
    default public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   236
    {
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   237
        return null;
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   238
    }
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   239
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   240
    /**
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   241
     * Adds a drop target to the lightweight frame.
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   242
     */
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   243
    default public void addDropTarget(DropTarget dt) {}
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   244
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   245
    /**
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   246
     * Removes a drop target from the lightweight frame.
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   247
     */
3637212ae8f2 8049065: [JLightweightFrame] Support DnD for SwingNode
anthony
parents: 25195
diff changeset
   248
    default public void removeDropTarget(DropTarget dt) {}
15983
26a673dec5b2 8006406: lightweight embedding in other Java UI toolkits
ant
parents:
diff changeset
   249
}