1935 g.fillRect(x, y, listWidth, h); 1936 } 1937 g.setClip(clip); 1938 } 1939 } 1940 1941 void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) { 1942 if (log.isLoggable(PlatformLogger.Level.FINEST)) { 1943 log.finest("Painting scrollbar " + scr + " width " + 1944 width + " height " + height + ", paintAll " + paintAll); 1945 } 1946 g.translate(x, y); 1947 scr.paint(g, getSystemColors(), paintAll); 1948 g.translate(-x, -y); 1949 } 1950 1951 /** 1952 * Paint the horizontal scrollbar to the screen 1953 * 1954 * @param g the graphics context to draw into 1955 * @param colors the colors used to draw the scrollbar 1956 * @param paintAll paint the whole scrollbar if true, just the thumb if false 1957 */ 1958 void paintHorScrollbar(Graphics g, boolean paintAll) { 1959 int w = getListWidth(); 1960 paintScrollBar(hsb, g, 0, height - (SCROLLBAR_WIDTH), w, SCROLLBAR_WIDTH, paintAll); 1961 } 1962 1963 /** 1964 * Paint the vertical scrollbar to the screen 1965 * 1966 * @param g the graphics context to draw into 1967 * @param colors the colors used to draw the scrollbar 1968 * @param paintAll paint the whole scrollbar if true, just the thumb if false 1969 */ 1970 void paintVerScrollbar(Graphics g, boolean paintAll) { 1971 int h = height - (hsbVis ? (SCROLLBAR_AREA-2) : 0); 1972 paintScrollBar(vsb, g, width - SCROLLBAR_WIDTH, 0, SCROLLBAR_WIDTH - 2, h, paintAll); 1973 } 1974 1975 1976 private Rectangle prevFocusRect; 1977 private void paintFocus(Graphics g, int options) { 1978 boolean paintFocus = (options & PAINT_FOCUS) != 0; 1979 if (paintFocus && !hasFocus()) { 1980 paintFocus = false; 1981 } 1982 if (log.isLoggable(PlatformLogger.Level.FINE)) { 1983 log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " + 1984 (isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus); 1985 } 1986 Shape clip = g.getClip(); 1987 g.setClip(0, 0, listWidth, listHeight); | 1935 g.fillRect(x, y, listWidth, h); 1936 } 1937 g.setClip(clip); 1938 } 1939 } 1940 1941 void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) { 1942 if (log.isLoggable(PlatformLogger.Level.FINEST)) { 1943 log.finest("Painting scrollbar " + scr + " width " + 1944 width + " height " + height + ", paintAll " + paintAll); 1945 } 1946 g.translate(x, y); 1947 scr.paint(g, getSystemColors(), paintAll); 1948 g.translate(-x, -y); 1949 } 1950 1951 /** 1952 * Paint the horizontal scrollbar to the screen 1953 * 1954 * @param g the graphics context to draw into 1955 * @param paintAll paint the whole scrollbar if true, just the thumb if false 1956 */ 1957 void paintHorScrollbar(Graphics g, boolean paintAll) { 1958 int w = getListWidth(); 1959 paintScrollBar(hsb, g, 0, height - (SCROLLBAR_WIDTH), w, SCROLLBAR_WIDTH, paintAll); 1960 } 1961 1962 /** 1963 * Paint the vertical scrollbar to the screen 1964 * 1965 * @param g the graphics context to draw into 1966 * @param paintAll paint the whole scrollbar if true, just the thumb if false 1967 */ 1968 void paintVerScrollbar(Graphics g, boolean paintAll) { 1969 int h = height - (hsbVis ? (SCROLLBAR_AREA-2) : 0); 1970 paintScrollBar(vsb, g, width - SCROLLBAR_WIDTH, 0, SCROLLBAR_WIDTH - 2, h, paintAll); 1971 } 1972 1973 1974 private Rectangle prevFocusRect; 1975 private void paintFocus(Graphics g, int options) { 1976 boolean paintFocus = (options & PAINT_FOCUS) != 0; 1977 if (paintFocus && !hasFocus()) { 1978 paintFocus = false; 1979 } 1980 if (log.isLoggable(PlatformLogger.Level.FINE)) { 1981 log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " + 1982 (isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus); 1983 } 1984 Shape clip = g.getClip(); 1985 g.setClip(0, 0, listWidth, listHeight); |