jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java
changeset 3938 ef327bd847c0
parent 715 f16baef3a20e
child 5506 202f599c92aa
equal deleted inserted replaced
3934:487e1aa949c4 3938:ef327bd847c0
    28 import java.awt.*;
    28 import java.awt.*;
    29 import java.awt.event.*;
    29 import java.awt.event.*;
    30 import java.awt.image.BufferedImage;
    30 import java.awt.image.BufferedImage;
    31 import sun.awt.SunToolkit;
    31 import sun.awt.SunToolkit;
    32 import sun.awt.X11GraphicsConfig;
    32 import sun.awt.X11GraphicsConfig;
    33 import java.util.logging.*;
    33 import sun.util.logging.PlatformLogger;
    34 
    34 
    35 /**
    35 /**
    36 * A simple vertical scroll bar.
    36 * A simple vertical scroll bar.
    37 */
    37 */
    38 abstract class XScrollbar {
    38 abstract class XScrollbar {
    39 
    39 
    40     private static Logger log = Logger.getLogger("sun.awt.X11.XScrollbar");
    40     private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbar");
    41     /**
    41     /**
    42      * The thread that asynchronously tells the scrollbar to scroll.
    42      * The thread that asynchronously tells the scrollbar to scroll.
    43      * @see #startScrolling
    43      * @see #startScrolling
    44      */
    44      */
    45     private static XScrollRepeater scroller = new XScrollRepeater(null);
    45     private static XScrollRepeater scroller = new XScrollRepeater(null);
   116     }
   116     }
   117 
   117 
   118     abstract protected void rebuildArrows();
   118     abstract protected void rebuildArrows();
   119 
   119 
   120     public void setSize(int width, int height) {
   120     public void setSize(int width, int height) {
   121         if (log.isLoggable(Level.FINER)) log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
   121         if (log.isLoggable(PlatformLogger.FINER)) log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
   122         this.width = width;
   122         this.width = width;
   123         this.height = height;
   123         this.height = height;
   124     }
   124     }
   125 
   125 
   126     /**
   126     /**
   162      * @param width the width of the scrollbar
   162      * @param width the width of the scrollbar
   163      * @param height the height of the scrollbar
   163      * @param height the height of the scrollbar
   164      * @param paintAll paint the whole scrollbar if true, just the thumb is false
   164      * @param paintAll paint the whole scrollbar if true, just the thumb is false
   165      */
   165      */
   166     void paint(Graphics g, Color colors[], boolean paintAll) {
   166     void paint(Graphics g, Color colors[], boolean paintAll) {
   167         if (log.isLoggable(Level.FINER)) log.finer("Painting scrollbar " + this);
   167         if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting scrollbar " + this);
   168 
   168 
   169         boolean useBufferedImage = false;
   169         boolean useBufferedImage = false;
   170         Graphics2D g2 = null;
   170         Graphics2D g2 = null;
   171         BufferedImage buffer = null;
   171         BufferedImage buffer = null;
   172         if (!(g instanceof Graphics2D)) {
   172         if (!(g instanceof Graphics2D)) {
   452     public void handleMouseEvent(int id, int modifiers, int x, int y) {
   452     public void handleMouseEvent(int id, int modifiers, int x, int y) {
   453         if ((modifiers & InputEvent.BUTTON1_MASK) == 0) {
   453         if ((modifiers & InputEvent.BUTTON1_MASK) == 0) {
   454             return;
   454             return;
   455         }
   455         }
   456 
   456 
   457         if (log.isLoggable(Level.FINER)) {
   457         if (log.isLoggable(PlatformLogger.FINER)) {
   458              String type;
   458              String type;
   459              switch (id) {
   459              switch (id) {
   460                 case MouseEvent.MOUSE_PRESSED:
   460                 case MouseEvent.MOUSE_PRESSED:
   461                     type = "press";
   461                     type = "press";
   462                     break;
   462                     break;