< prev index next >

src/java.desktop/share/classes/javax/swing/text/Highlighter.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 107     public Highlight[] getHighlights();
 108 
 109     /**
 110      * Highlight renderer.
 111      */
 112     public interface HighlightPainter {
 113 
 114         /**
 115          * Renders the highlight.
 116          *
 117          * @param g the graphics context
 118          * @param p0 the starting offset in the model &gt;= 0
 119          * @param p1 the ending offset in the model &gt;= p0
 120          * @param bounds the bounding box for the highlight
 121          * @param c the editor
 122          */
 123         public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c);
 124 
 125     }
 126 



 127     public interface Highlight {
 128 
 129         /**
 130          * Gets the starting model offset for the highlight.
 131          *
 132          * @return the starting offset &gt;= 0
 133          */
 134         public int getStartOffset();
 135 
 136         /**
 137          * Gets the ending model offset for the highlight.
 138          *
 139          * @return the ending offset &gt;= 0
 140          */
 141         public int getEndOffset();
 142 
 143         /**
 144          * Gets the painter for the highlighter.
 145          *
 146          * @return the painter
 147          */
 148         public HighlightPainter getPainter();
 149 
 150     }
 151 
 152 };
   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 107     public Highlight[] getHighlights();
 108 
 109     /**
 110      * Highlight renderer.
 111      */
 112     public interface HighlightPainter {
 113 
 114         /**
 115          * Renders the highlight.
 116          *
 117          * @param g the graphics context
 118          * @param p0 the starting offset in the model &gt;= 0
 119          * @param p1 the ending offset in the model &gt;= p0
 120          * @param bounds the bounding box for the highlight
 121          * @param c the editor
 122          */
 123         public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c);
 124 
 125     }
 126 
 127     /**
 128      * A highlight.
 129      */
 130     public interface Highlight {
 131 
 132         /**
 133          * Gets the starting model offset for the highlight.
 134          *
 135          * @return the starting offset &gt;= 0
 136          */
 137         public int getStartOffset();
 138 
 139         /**
 140          * Gets the ending model offset for the highlight.
 141          *
 142          * @return the ending offset &gt;= 0
 143          */
 144         public int getEndOffset();
 145 
 146         /**
 147          * Gets the painter for the highlighter.
 148          *
 149          * @return the painter
 150          */
 151         public HighlightPainter getPainter();
 152 
 153     }

 154 };
< prev index next >