src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java

Print this page




  45  * version of Swing.  A future release of Swing will provide support for
  46  * long term persistence.
  47  */
  48 public abstract class WindowsTextUI extends BasicTextUI {
  49     /**
  50      * Creates the object to use for a caret.  By default an
  51      * instance of WindowsCaret is created.  This method
  52      * can be redefined to provide something else that implements
  53      * the InputPosition interface or a subclass of DefaultCaret.
  54      *
  55      * @return the caret object
  56      */
  57     protected Caret createCaret() {
  58         return new WindowsCaret();
  59     }
  60 
  61     /* public */
  62     static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
  63 
  64     /* public */

  65     static class WindowsCaret extends DefaultCaret
  66                      implements UIResource {
  67         /**
  68          * Gets the painter for the Highlighter.
  69          *
  70          * @return the painter
  71          */
  72         protected Highlighter.HighlightPainter getSelectionPainter() {
  73             return WindowsTextUI.WindowsPainter;
  74         }
  75     }
  76 
  77     /* public */
  78     static class WindowsHighlightPainter extends
  79                      DefaultHighlighter.DefaultHighlightPainter {
  80         WindowsHighlightPainter(Color c) {
  81             super(c);
  82         }
  83 
  84         // --- HighlightPainter methods ---------------------------------------




  45  * version of Swing.  A future release of Swing will provide support for
  46  * long term persistence.
  47  */
  48 public abstract class WindowsTextUI extends BasicTextUI {
  49     /**
  50      * Creates the object to use for a caret.  By default an
  51      * instance of WindowsCaret is created.  This method
  52      * can be redefined to provide something else that implements
  53      * the InputPosition interface or a subclass of DefaultCaret.
  54      *
  55      * @return the caret object
  56      */
  57     protected Caret createCaret() {
  58         return new WindowsCaret();
  59     }
  60 
  61     /* public */
  62     static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
  63 
  64     /* public */
  65     @SuppressWarnings("serial") // Superclass is not serializable across versions
  66     static class WindowsCaret extends DefaultCaret
  67                      implements UIResource {
  68         /**
  69          * Gets the painter for the Highlighter.
  70          *
  71          * @return the painter
  72          */
  73         protected Highlighter.HighlightPainter getSelectionPainter() {
  74             return WindowsTextUI.WindowsPainter;
  75         }
  76     }
  77 
  78     /* public */
  79     static class WindowsHighlightPainter extends
  80                      DefaultHighlighter.DefaultHighlightPainter {
  81         WindowsHighlightPainter(Color c) {
  82             super(c);
  83         }
  84 
  85         // --- HighlightPainter methods ---------------------------------------