jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java
author chegar
Mon, 17 Jun 2013 14:09:25 +0100
changeset 18178 ee71c923891d
parent 16839 d0f2e97b7359
child 23010 6dadb192ad81
permissions -rw-r--r--
8016747: Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level) Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
     2
 * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
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: 3938
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt.X11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.peer.*;
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2
diff changeset
    31
import sun.util.logging.PlatformLogger;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient {
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2
diff changeset
    34
    private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbarPeer");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    private static final int DEFAULT_LENGTH = 50;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    private static final int DEFAULT_WIDTH_SOLARIS = 19;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    private static final int DEFAULT_WIDTH_LINUX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    XScrollbar tsb;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        DEFAULT_WIDTH_LINUX = XToolkit.getUIDefaults().getInt("ScrollBar.defaultWidth");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    public void preInit(XCreateWindowParams params) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        super.preInit(params);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        Scrollbar target = (Scrollbar) this.target;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        if (target.getOrientation() == Scrollbar.VERTICAL) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
            tsb = new XVerticalScrollbar(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
            tsb = new XHorizontalScrollbar(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        int min = target.getMinimum();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        int max = target.getMaximum();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        int vis = target.getVisibleAmount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        int val = target.getValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        int line = target.getLineIncrement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        int page = target.getPageIncrement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        tsb.setValues(val, vis, min, max, line, page);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * Create a scrollbar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    XScrollbarPeer(Scrollbar target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        super(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        this.target = target;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        xSetVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Returns default size of scrollbar on the platform
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * Currently uses hardcoded values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    private int getDefaultDimension() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        if (System.getProperty("os.name").equals("Linux")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
            return DEFAULT_WIDTH_LINUX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            return DEFAULT_WIDTH_SOLARIS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * Compute the minimum size for the scrollbar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    public Dimension getMinimumSize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        Scrollbar sb = (Scrollbar)target;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        return (sb.getOrientation() == Scrollbar.VERTICAL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            ? new Dimension(getDefaultDimension(), DEFAULT_LENGTH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                : new Dimension(DEFAULT_LENGTH, getDefaultDimension());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * Paint the scrollbar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
10096
f9ac9a52952d 6596915: JCK-runtime-6a/tests/api/java_awt/Component/index.html tesPaintAll fails
serb
parents: 5506
diff changeset
    96
    @Override
f9ac9a52952d 6596915: JCK-runtime-6a/tests/api/java_awt/Component/index.html tesPaintAll fails
serb
parents: 5506
diff changeset
    97
    void paintPeer(final Graphics g) {
f9ac9a52952d 6596915: JCK-runtime-6a/tests/api/java_awt/Component/index.html tesPaintAll fails
serb
parents: 5506
diff changeset
    98
        final Color[] colors = getGUIcolors();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        g.setColor(colors[BACKGROUND_COLOR]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        tsb.paint(g, colors, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        // paint the whole scrollbar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    public void repaintScrollbarRequest(XScrollbar sb) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     repaint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * The value has changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public void notifyValue(XScrollbar obj, int type, int value, boolean isAdjusting) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        Scrollbar sb = (Scrollbar)target;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        sb.setValue(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        postEvent( new AdjustmentEvent(sb, AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED, type, value, isAdjusting));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @see java.awt.event.MouseEvent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * MouseEvent.MOUSE_CLICKED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * MouseEvent.MOUSE_PRESSED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * MouseEvent.MOUSE_RELEASED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * MouseEvent.MOUSE_MOVED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * MouseEvent.MOUSE_ENTERED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * MouseEvent.MOUSE_EXITED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * MouseEvent.MOUSE_DRAGGED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        super.handleJavaMouseEvent(mouseEvent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        int x = mouseEvent.getX();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        int y = mouseEvent.getY();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        int modifiers = mouseEvent.getModifiers();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        int id = mouseEvent.getID();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        if ((mouseEvent.getModifiers() & InputEvent.BUTTON1_MASK) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        switch (mouseEvent.getID()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
          case MouseEvent.MOUSE_PRESSED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
              target.requestFocus();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
              tsb.handleMouseEvent(id, modifiers,x,y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
          case MouseEvent.MOUSE_RELEASED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
              tsb.handleMouseEvent(id, modifiers,x,y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
          case MouseEvent.MOUSE_DRAGGED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
              tsb.handleMouseEvent(id, modifiers,x,y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public void handleJavaKeyEvent(KeyEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        super.handleJavaKeyEvent(event);
18178
ee71c923891d 8016747: Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level)
chegar
parents: 16839
diff changeset
   159
        if (log.isLoggable(PlatformLogger.Level.FINER)) {
16839
d0f2e97b7359 8010297: Missing isLoggable() checks in logging code
anthony
parents: 10096
diff changeset
   160
            log.finer("KeyEvent on scrollbar: " + event);
d0f2e97b7359 8010297: Missing isLoggable() checks in logging code
anthony
parents: 10096
diff changeset
   161
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            switch(event.getKeyCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            case KeyEvent.VK_UP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                log.finer("Scrolling up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                tsb.notifyValue(tsb.getValue() - tsb.getUnitIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            case KeyEvent.VK_DOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                log.finer("Scrolling down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                tsb.notifyValue(tsb.getValue() + tsb.getUnitIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            case KeyEvent.VK_LEFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                log.finer("Scrolling up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                tsb.notifyValue(tsb.getValue() - tsb.getUnitIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            case KeyEvent.VK_RIGHT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                log.finer("Scrolling down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                tsb.notifyValue(tsb.getValue() + tsb.getUnitIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            case KeyEvent.VK_PAGE_UP:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                log.finer("Scrolling page up");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                tsb.notifyValue(tsb.getValue() - tsb.getBlockIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            case KeyEvent.VK_PAGE_DOWN:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                log.finer("Scrolling page down");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                tsb.notifyValue(tsb.getValue() + tsb.getBlockIncrement());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            case KeyEvent.VK_HOME:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                log.finer("Scrolling to home");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                tsb.notifyValue(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            case KeyEvent.VK_END:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                log.finer("Scrolling to end");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                tsb.notifyValue(tsb.getMaximum());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public void setValue(int value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        tsb.setValue(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        repaint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    public void setValues(int value, int visible, int minimum, int maximum) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        tsb.setValues(value, visible, minimum, maximum);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        repaint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public void setLineIncrement(int l) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        tsb.setUnitIncrement(l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public void setPageIncrement(int p) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        tsb.setBlockIncrement(p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public void layout() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        super.layout();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        tsb.setSize(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
}