001    /*
002     * LAPIS lightweight structured text processing system
003     *
004     * Copyright (C) 1998-2002 Carnegie Mellon University,
005     * Copyright (C) 2003 Massachusetts Institute of Technology.
006     * All rights reserved.
007     *
008     * This library is free software; you can redistribute it
009     * and/or modify it under the terms of the GNU General
010     * Public License as published by the Free Software
011     * Foundation, version 2.
012     *
013     * LAPIS homepage: http://graphics.lcs.mit.edu/lapis/
014     */
015    
016    package lapisx.swing;
017    
018    import java.awt.*;
019    import javax.swing.*;
020    import javax.swing.plaf.*;
021    import javax.swing.plaf.metal.*;
022    
023    public class HighlightingScrollBarUI extends MetalScrollBarUI {
024        public void paint (Graphics g, JComponent c) {
025            super.paint (g, c);
026            ScrollBarHighlighter h = ((HighlightingScrollPane.HighlightingScrollBar) c).getHighlighter ();
027            if (h != null)
028                h.paintScrollBarHighlights (g, (JScrollBar) c, 
029                                            getTrackBounds (),
030                                            incrButton.getBounds (),
031                                            decrButton.getBounds ());
032        }
033    
034        public static ComponentUI createUI (JComponent c) {
035            return new HighlightingScrollBarUI ();
036        }
037    }
038