jdk/src/share/classes/javax/swing/plaf/LayerUI.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8372 786e091594a0
child 9050 26c2c1de1631
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8372
diff changeset
     2
 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
3733
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
     4
 *
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5451
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3733
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5451
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3733
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    10
 *
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    15
 * accompanied this code).
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    16
 *
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5451
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5451
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5451
diff changeset
    23
 * questions.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    24
 */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    25
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    26
package javax.swing.plaf;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    27
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    28
import javax.accessibility.Accessible;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    29
import javax.swing.*;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    30
import javax.swing.plaf.ComponentUI;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    31
import java.awt.*;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    32
import java.awt.event.*;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    33
import java.beans.PropertyChangeEvent;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    34
import java.beans.PropertyChangeSupport;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    35
import java.beans.PropertyChangeListener;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    36
import java.io.Serializable;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    37
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    38
/**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    39
 * The base class for all {@link javax.swing.JLayer}'s UI delegates.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    40
 * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    41
 * {@link #paint(java.awt.Graphics, javax.swing.JComponent)} method performes the
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    42
 * painting of the {@code JLayer}
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    43
 * and {@link #eventDispatched(AWTEvent, JLayer)} method is notified
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    44
 * about any {@code AWTEvent}s which have been generated by a {@code JLayer}
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    45
 * or any of its subcomponents.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    46
 * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    47
 * The {@code LayerUI} differs from the UI delegates of the other components,
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    48
 * because it is LookAndFeel independent and is not updated by default when
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    49
 * the system LookAndFeel is changed.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    50
 * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    51
 * The subclasses of {@code LayerUI} can either be stateless and shareable
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    52
 * by multiple {@code JLayer}s or not shareable.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    53
 *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    54
 * @param <V> one of the super types of {@code JLayer}'s view component
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    55
 *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    56
 * @see JLayer#setUI(LayerUI)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    57
 * @see JLayer#setView(Component)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    58
 * @see JLayer#getView()
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    59
 * @since 1.7
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    60
 *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    61
 * @author Alexander Potochkin
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    62
 */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    63
public class LayerUI<V extends Component>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    64
        extends ComponentUI implements Serializable {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    65
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    66
    private final PropertyChangeSupport propertyChangeSupport =
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    67
            new PropertyChangeSupport(this);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    68
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    69
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    70
     * Paints the specified component.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    71
     * Subclasses should override this method and use
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    72
     * the specified {@code Graphics} object to
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    73
     * render the content of the component.
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    74
     * <p/>
5450
7232e9363e50 6899453: Remove unnecessary methods from LayerUI
alexp
parents: 4276
diff changeset
    75
     * The default implementation paints the passed component as is.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    76
     *
5450
7232e9363e50 6899453: Remove unnecessary methods from LayerUI
alexp
parents: 4276
diff changeset
    77
     * @param g the {@code Graphics} context in which to paint
7232e9363e50 6899453: Remove unnecessary methods from LayerUI
alexp
parents: 4276
diff changeset
    78
     * @param c the component being painted
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    79
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    80
    public void paint(Graphics g, JComponent c) {
5450
7232e9363e50 6899453: Remove unnecessary methods from LayerUI
alexp
parents: 4276
diff changeset
    81
        c.paint(g);
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    82
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    83
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    84
    /**
5451
82e4cf75e5b4 6899405: Specification for JLayer.setLayerEventMask() should mention that eventDispatch() might not be called
alexp
parents: 5450
diff changeset
    85
     * Processes {@code AWTEvent}s for {@code JLayer}
82e4cf75e5b4 6899405: Specification for JLayer.setLayerEventMask() should mention that eventDispatch() might not be called
alexp
parents: 5450
diff changeset
    86
     * and <b>all its descendants</b> to this {@code LayerUI} instance.
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    87
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    88
     * To enable the {@code AWTEvent}s of a particular type,
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    89
     * you call {@link JLayer#setLayerEventMask}
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    90
     * in {@link #installUI(javax.swing.JComponent)}
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    91
     * and set the layer event mask to {@code 0}
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    92
     * in {@link #uninstallUI(javax.swing.JComponent)} after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    93
     * By default this  method calls the appropriate
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    94
     * {@code process&lt;event&nbsp;type&gt;Event}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
    95
     * method for the given class of event.
5451
82e4cf75e5b4 6899405: Specification for JLayer.setLayerEventMask() should mention that eventDispatch() might not be called
alexp
parents: 5450
diff changeset
    96
     * <p/>
82e4cf75e5b4 6899405: Specification for JLayer.setLayerEventMask() should mention that eventDispatch() might not be called
alexp
parents: 5450
diff changeset
    97
     * <b>Note:</b> Events are processed only for displayable {@code JLayer}s.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    98
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
    99
     * @param e the event to be dispatched
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   100
     * @param l the layer this LayerUI is set to
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   101
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   102
     * @see JLayer#setLayerEventMask(long)
5451
82e4cf75e5b4 6899405: Specification for JLayer.setLayerEventMask() should mention that eventDispatch() might not be called
alexp
parents: 5450
diff changeset
   103
     * @see Component#isDisplayable()
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   104
     * @see #processComponentEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   105
     * @see #processFocusEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   106
     * @see #processKeyEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   107
     * @see #processMouseEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   108
     * @see #processMouseMotionEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   109
     * @see #processInputMethodEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   110
     * @see #processHierarchyEvent
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   111
     * @see #processMouseWheelEvent
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   112
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   113
    public void eventDispatched(AWTEvent e, JLayer<? extends V> l){
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   114
        if (e instanceof FocusEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   115
            processFocusEvent((FocusEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   116
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   117
        } else if (e instanceof MouseEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   118
            switch(e.getID()) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   119
              case MouseEvent.MOUSE_PRESSED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   120
              case MouseEvent.MOUSE_RELEASED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   121
              case MouseEvent.MOUSE_CLICKED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   122
              case MouseEvent.MOUSE_ENTERED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   123
              case MouseEvent.MOUSE_EXITED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   124
                  processMouseEvent((MouseEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   125
                  break;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   126
              case MouseEvent.MOUSE_MOVED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   127
              case MouseEvent.MOUSE_DRAGGED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   128
                  processMouseMotionEvent((MouseEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   129
                  break;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   130
              case MouseEvent.MOUSE_WHEEL:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   131
                  processMouseWheelEvent((MouseWheelEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   132
                  break;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   133
            }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   134
        } else if (e instanceof KeyEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   135
            processKeyEvent((KeyEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   136
        } else if (e instanceof ComponentEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   137
            processComponentEvent((ComponentEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   138
        } else if (e instanceof InputMethodEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   139
            processInputMethodEvent((InputMethodEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   140
        } else if (e instanceof HierarchyEvent) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   141
            switch (e.getID()) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   142
              case HierarchyEvent.HIERARCHY_CHANGED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   143
                  processHierarchyEvent((HierarchyEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   144
                  break;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   145
              case HierarchyEvent.ANCESTOR_MOVED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   146
              case HierarchyEvent.ANCESTOR_RESIZED:
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   147
                  processHierarchyBoundsEvent((HierarchyEvent)e, l);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   148
                  break;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   149
            }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   150
        }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   151
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   152
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   153
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   154
     * Processes component events occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   155
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   156
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   157
     * This method is not called unless component events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   158
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   159
     * Component events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   160
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   161
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   162
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   163
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   164
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   165
     *    l.setLayerEventMask(AWTEvent.COMPONENT_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   166
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   167
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   168
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   169
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   170
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   171
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   172
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   173
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   174
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   175
     * @param e the {@code ComponentEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   176
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   177
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   178
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   179
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   180
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   181
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   182
    protected void processComponentEvent(ComponentEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   183
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   184
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   185
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   186
     * Processes focus events occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   187
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   188
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   189
     * This method is not called unless focus events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   190
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   191
     * Focus events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   192
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   193
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   194
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   195
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   196
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   197
     *    l.setLayerEventMask(AWTEvent.FOCUS_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   198
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   199
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   200
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   201
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   202
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   203
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   204
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   205
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   206
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   207
     * @param e the {@code FocusEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   208
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   209
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   210
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   211
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   212
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   213
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   214
    protected void processFocusEvent(FocusEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   215
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   216
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   217
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   218
     * Processes key events occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   219
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   220
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   221
     * This method is not called unless key events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   222
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   223
     * Key events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   224
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   225
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   226
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   227
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   228
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   229
     *    l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   230
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   231
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   232
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   233
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   234
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   235
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   236
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   237
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   238
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   239
     * @param e the {@code KeyEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   240
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   241
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   242
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   243
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   244
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   245
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   246
    protected void processKeyEvent(KeyEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   247
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   248
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   249
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   250
     * Processes mouse events occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   251
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   252
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   253
     * This method is not called unless mouse events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   254
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   255
     * Mouse events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   256
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   257
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   258
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   259
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   260
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   261
     *    l.setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   262
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   263
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   264
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   265
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   266
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   267
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   268
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   269
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   270
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   271
     * @param e the {@code MouseEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   272
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   273
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   274
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   275
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   276
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   277
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   278
    protected void processMouseEvent(MouseEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   279
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   280
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   281
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   282
     * Processes mouse motion event occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   283
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   284
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   285
     * This method is not called unless mouse motion events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   286
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   287
     * Mouse motion events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   288
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   289
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   290
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   291
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   292
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   293
     *    l.setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   294
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   295
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   296
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   297
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   298
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   299
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   300
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   301
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   302
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   303
     * @param e the {@code MouseEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   304
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   305
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   306
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   307
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   308
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   309
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   310
    protected void processMouseMotionEvent(MouseEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   311
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   312
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   313
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   314
     * Processes mouse wheel event occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   315
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   316
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   317
     * This method is not called unless mouse wheel events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   318
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   319
     * Mouse wheel events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   320
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   321
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   322
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   323
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   324
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   325
     *    l.setLayerEventMask(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   326
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   327
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   328
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   329
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   330
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   331
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   332
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   333
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   334
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   335
     * @param e the {@code MouseEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   336
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   337
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   338
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   339
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   340
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   341
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   342
    protected void processMouseWheelEvent(MouseWheelEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   343
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   344
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   345
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   346
     * Processes input event occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   347
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   348
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   349
     * This method is not called unless input events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   350
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   351
     * Input events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   352
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   353
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   354
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   355
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   356
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   357
     *    l.setLayerEventMask(AWTEvent.INPUT_METHOD_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   358
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   359
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   360
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   361
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   362
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   363
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   364
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   365
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   366
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   367
     * @param e the {@code InputMethodEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   368
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   369
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   370
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   371
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   372
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   373
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   374
    protected void processInputMethodEvent(InputMethodEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   375
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   376
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   377
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   378
     * Processes hierarchy event occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   379
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   380
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   381
     * This method is not called unless hierarchy events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   382
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   383
     * Hierarchy events are enabled in the overridden {@link #installUI} method
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   384
     * and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   385
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   386
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   387
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   388
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   389
     *    l.setLayerEventMask(AWTEvent.HIERARCHY_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   390
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   391
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   392
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   393
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   394
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   395
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   396
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   397
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   398
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   399
     * @param e the {@code HierarchyEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   400
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   401
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   402
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   403
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   404
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   405
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   406
    protected void processHierarchyEvent(HierarchyEvent e, JLayer<? extends V> l) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   407
    }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   408
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   409
    /**
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   410
     * Processes hierarchy bounds event occurring on the {@link JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   411
     * or any of its subcomponents.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   412
     * <p/>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   413
     * This method is not called unless hierarchy bounds events are
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   414
     * enabled for the {@code JLayer} objects, this {@code LayerUI} is set to.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   415
     * Hierarchy bounds events are enabled in the overridden {@link #installUI}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   416
     * method and should be disabled in the {@link #uninstallUI} method after that.
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   417
     * <pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   418
     * public void installUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   419
     *    super.installUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   420
     *    JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   421
     *    l.setLayerEventMask(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   422
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   423
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   424
     * public void unistallUI(JComponent c) {
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   425
     *     super.uninstallUI(c);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   426
     *     JLayer l = (JLayer) c;
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   427
     *     l.setLayerEventMask(0);
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   428
     * }
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   429
     * </pre>
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   430
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   431
     * @param e the {@code HierarchyEvent} to be processed
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   432
     * @param l the layer this {@code LayerUI} instance is set to
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   433
     *
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   434
     * @see JLayer#setLayerEventMask(long)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   435
     * @see #installUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   436
     * @see #uninstallUI(javax.swing.JComponent)
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   437
     */
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   438
    protected void processHierarchyBoundsEvent(HierarchyEvent e, JLayer<? extends V> l) {
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   439
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   440
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   441
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   442
     * Invoked when {@link javax.swing.JLayer#updateUI()} is called
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   443
     * by the {@code JLayer} this {@code LayerUI} is set to.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   444
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   445
     * @param l the {@code JLayer} which UI is updated
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   446
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   447
    public void updateUI(JLayer<? extends V> l){
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   448
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   449
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   450
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   451
     * Configures the {@code JLayer} this {@code LayerUI} is set to.
7251
bfbe5cb5fbb2 6997170: Spec for javax.swing.plaf.LayerUI.installUI/uninstallUI() methods contradict behavior of the RI
alexp
parents: 6647
diff changeset
   452
     * The default implementation registers the passed {@code JLayer} component
bfbe5cb5fbb2 6997170: Spec for javax.swing.plaf.LayerUI.installUI/uninstallUI() methods contradict behavior of the RI
alexp
parents: 6647
diff changeset
   453
     * as a {@code PropertyChangeListener} for the property changes of this {@code LayerUI}.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   454
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   455
     * @param c the {@code JLayer} component where this UI delegate is being installed
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   456
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   457
    public void installUI(JComponent c) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   458
        addPropertyChangeListener((JLayer) c);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   459
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   460
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   461
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   462
     * Reverses the configuration which was previously set
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   463
     * in the {@link #installUI(JComponent)} method.
7251
bfbe5cb5fbb2 6997170: Spec for javax.swing.plaf.LayerUI.installUI/uninstallUI() methods contradict behavior of the RI
alexp
parents: 6647
diff changeset
   464
     * The default implementation unregisters the passed {@code JLayer} component
bfbe5cb5fbb2 6997170: Spec for javax.swing.plaf.LayerUI.installUI/uninstallUI() methods contradict behavior of the RI
alexp
parents: 6647
diff changeset
   465
     * as a {@code PropertyChangeListener} for the property changes of this {@code LayerUI}.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   466
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   467
     * @param c the component from which this UI delegate is being removed.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   468
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   469
    public void uninstallUI(JComponent c) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   470
        removePropertyChangeListener((JLayer) c);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   471
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   472
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   473
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   474
     * Adds a PropertyChangeListener to the listener list. The listener is
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   475
     * registered for all bound properties of this class.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   476
     * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   477
     * If {@code listener} is {@code null},
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   478
     * no exception is thrown and no action is performed.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   479
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   480
     * @param listener the property change listener to be added
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   481
     * @see #removePropertyChangeListener
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   482
     * @see #getPropertyChangeListeners
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   483
     * @see #addPropertyChangeListener(String, java.beans.PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   484
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   485
    public void addPropertyChangeListener(PropertyChangeListener listener) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   486
        propertyChangeSupport.addPropertyChangeListener(listener);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   487
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   488
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   489
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   490
     * Removes a PropertyChangeListener from the listener list. This method
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   491
     * should be used to remove PropertyChangeListeners that were registered
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   492
     * for all bound properties of this class.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   493
     * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   494
     * If {@code listener} is {@code null},
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   495
     * no exception is thrown and no action is performed.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   496
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   497
     * @param listener the PropertyChangeListener to be removed
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   498
     * @see #addPropertyChangeListener
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   499
     * @see #getPropertyChangeListeners
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   500
     * @see #removePropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   501
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   502
    public void removePropertyChangeListener(PropertyChangeListener listener) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   503
        propertyChangeSupport.removePropertyChangeListener(listener);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   504
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   505
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   506
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   507
     * Returns an array of all the property change listeners
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   508
     * registered on this component.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   509
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   510
     * @return all of this ui's {@code PropertyChangeListener}s
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   511
     *         or an empty array if no property change
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   512
     *         listeners are currently registered
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   513
     * @see #addPropertyChangeListener
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   514
     * @see #removePropertyChangeListener
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   515
     * @see #getPropertyChangeListeners(String)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   516
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   517
    public PropertyChangeListener[] getPropertyChangeListeners() {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   518
        return propertyChangeSupport.getPropertyChangeListeners();
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   519
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   520
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   521
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   522
     * Adds a PropertyChangeListener to the listener list for a specific
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   523
     * property.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   524
     * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   525
     * If {@code propertyName} or {@code listener} is {@code null},
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   526
     * no exception is thrown and no action is taken.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   527
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   528
     * @param propertyName one of the property names listed above
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   529
     * @param listener     the property change listener to be added
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   530
     * @see #removePropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   531
     * @see #getPropertyChangeListeners(String)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   532
     * @see #addPropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   533
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   534
    public void addPropertyChangeListener(String propertyName,
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   535
                                          PropertyChangeListener listener) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   536
        propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   537
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   538
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   539
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   540
     * Removes a {@code PropertyChangeListener} from the listener
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   541
     * list for a specific property. This method should be used to remove
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   542
     * {@code PropertyChangeListener}s
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   543
     * that were registered for a specific bound property.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   544
     * <p/>
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   545
     * If {@code propertyName} or {@code listener} is {@code null},
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   546
     * no exception is thrown and no action is taken.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   547
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   548
     * @param propertyName a valid property name
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   549
     * @param listener     the PropertyChangeListener to be removed
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   550
     * @see #addPropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   551
     * @see #getPropertyChangeListeners(String)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   552
     * @see #removePropertyChangeListener(PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   553
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   554
    public void removePropertyChangeListener(String propertyName,
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   555
                                             PropertyChangeListener listener) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   556
        propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   557
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   558
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   559
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   560
     * Returns an array of all the listeners which have been associated
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   561
     * with the named property.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   562
     *
3748
b88af44d77a8 6875153: JLayer.isOptimizedDrawingEnabled() throws NPE for null glass pane set
alexp
parents: 3737
diff changeset
   563
     * @param propertyName  The name of the property being listened to
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   564
     * @return all of the {@code PropertyChangeListener}s associated with
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   565
     *         the named property; if no such listeners have been added or
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   566
     *         if {@code propertyName} is {@code null}, an empty
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   567
     *         array is returned
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   568
     * @see #addPropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   569
     * @see #removePropertyChangeListener(String, PropertyChangeListener)
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   570
     * @see #getPropertyChangeListeners
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   571
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   572
    public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   573
        return propertyChangeSupport.getPropertyChangeListeners(propertyName);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   574
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   575
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   576
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   577
     * Support for reporting bound property changes for Object properties.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   578
     * This method can be called when a bound property has changed and it will
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   579
     * send the appropriate PropertyChangeEvent to any registered
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   580
     * PropertyChangeListeners.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   581
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   582
     * @param propertyName the property whose value has changed
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   583
     * @param oldValue     the property's previous value
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   584
     * @param newValue     the property's new value
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   585
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   586
    protected void firePropertyChange(String propertyName,
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   587
                                      Object oldValue, Object newValue) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   588
        propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   589
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   590
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   591
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   592
     * Notifies the {@code LayerUI} when any of its property are changed
4276
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   593
     * and enables updating every {@code JLayer}
ff9daeaa1e21 6879228: LayerUI should be extended
alexp
parents: 3748
diff changeset
   594
     * this {@code LayerUI} instance is set to.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   595
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   596
     * @param evt the PropertyChangeEvent generated by this {@code LayerUI}
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   597
     * @param l the {@code JLayer} this LayerUI is set to
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   598
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   599
    public void applyPropertyChange(PropertyChangeEvent evt, JLayer<? extends V> l) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   600
    }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   601
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   602
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   603
     * If the {@code JLayer}'s view component is not {@code null},
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   604
     * this calls the view's {@code getBaseline()} method.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   605
     * Otherwise, the default implementation is called.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   606
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   607
     * @param c {@code JLayer} to return baseline resize behavior for
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   608
     * @param width the width to get the baseline for
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   609
     * @param height the height to get the baseline for
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   610
     * @return baseline or a value &lt; 0 indicating there is no reasonable
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   611
     *                  baseline
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   612
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   613
    public int getBaseline(JComponent c, int width, int height) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   614
        JLayer l = (JLayer) c;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   615
        if (l.getView() != null) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   616
            return l.getView().getBaseline(width, height);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   617
        }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   618
        return super.getBaseline(c, width, height);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   619
     }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   620
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   621
    /**
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   622
     * If the {@code JLayer}'s view component is not {@code null},
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   623
     * this returns the result of the view's {@code getBaselineResizeBehavior()} method.
3508
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   624
     * Otherwise, the default implementation is called.
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   625
     *
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   626
     * @param c {@code JLayer} to return baseline resize behavior for
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   627
     * @return an enum indicating how the baseline changes as the component
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   628
     *         size changes
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   629
     */
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   630
    public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   631
        JLayer l = (JLayer) c;
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   632
        if (l.getView() != null) {
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   633
            return l.getView().getBaselineResizeBehavior();
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   634
        }
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   635
        return super.getBaselineResizeBehavior(c);
defe8eec9251 6822696: Integrating JXLayer component to Swing library
alexp
parents:
diff changeset
   636
    }
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   637
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   638
    /**
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   639
     * Causes the passed instance of {@code JLayer} to lay out its components.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   640
     *
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   641
     * @param l the {@code JLayer} component where this UI delegate is being installed
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   642
     */
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   643
    public void doLayout(JLayer<? extends V> l) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   644
        Component view = l.getView();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   645
        if (view != null) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   646
            view.setBounds(0, 0, l.getWidth(), l.getHeight());
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   647
        }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   648
        Component glassPane = l.getGlassPane();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   649
        if (glassPane != null) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   650
            glassPane.setBounds(0, 0, l.getWidth(), l.getHeight());
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   651
        }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   652
    }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   653
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   654
    /**
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   655
     * If the {@code JLayer}'s view component is not {@code null},
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   656
     * this returns the result of  the view's {@code getPreferredSize()} method.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   657
     * Otherwise, the default implementation is used.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   658
     *
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   659
     * @param c {@code JLayer} to return preferred size for
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   660
     * @return preferred size for the passed {@code JLayer}
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   661
     */
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   662
    public Dimension getPreferredSize(JComponent c) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   663
        JLayer l = (JLayer) c;
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   664
        Component view = l.getView();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   665
        if (view != null) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   666
            return view.getPreferredSize();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   667
        }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   668
        return super.getPreferredSize(c);
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   669
    }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   670
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   671
    /**
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   672
     * If the {@code JLayer}'s view component is not {@code null},
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   673
     * this returns the result of  the view's {@code getMinimalSize()} method.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   674
     * Otherwise, the default implementation is used.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   675
     *
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   676
     * @param c {@code JLayer} to return preferred size for
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   677
     * @return minimal size for the passed {@code JLayer}
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   678
     */
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   679
    public Dimension getMinimumSize(JComponent c) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   680
        JLayer l = (JLayer) c;
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   681
        Component view = l.getView();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   682
        if (view != null) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   683
            return view.getMinimumSize();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   684
        }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   685
        return super.getMinimumSize(c);
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   686
    }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   687
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   688
    /**
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   689
     * If the {@code JLayer}'s view component is not {@code null},
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   690
     * this returns the result of  the view's {@code getMaximumSize()} method.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   691
     * Otherwise, the default implementation is used.
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   692
     *
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   693
     * @param c {@code JLayer} to return preferred size for
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   694
     * @return maximun size for the passed {@code JLayer}
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   695
     */
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   696
    public Dimension getMaximumSize(JComponent c) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   697
        JLayer l = (JLayer) c;
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   698
        Component view = l.getView();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   699
        if (view != null) {
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   700
            return view.getMaximumSize();
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   701
        }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   702
        return super.getMaximumSize(c);
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   703
    }
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   704
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   705
    /**
8372
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   706
     * Paints the specified region in the {@code JLayer} this {@code LayerUI} is set to, immediately.
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   707
     * <p/>
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   708
     * This method is to be overridden when the dirty region needs to be changed.
8372
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   709
     * The default implementation delegates its functionality to {@link JComponent#paintImmediately(int, int, int, int)}.
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   710
     *
8372
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   711
     * @param x  the x value of the region to be painted
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   712
     * @param y  the y value of the region to be painted
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   713
     * @param w  the width of the region to be painted
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   714
     * @param h  the height of the region to be painted
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   715
     *
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   716
     * @see JComponent#paintImmediately(int, int, int, int)
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   717
     */
8372
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   718
    public void paintImmediately(int x, int y, int width, int height, JLayer<? extends V> l) {
786e091594a0 6993171: JavaTest/JDK7b114 - no help text is shown for interview questions, JavaTest HANGS UP
alexp
parents: 7668
diff changeset
   719
        l.paintImmediately(x, y, width, height);
6647
9d119d6c36b9 6982661: Complete JLayer component
alexp
parents: 5506
diff changeset
   720
    }
3733
af63479b67b8 6872492: JLayer sources contain wrong header
alexp
parents: 3508
diff changeset
   721
}