http://www.jpicedt.org

jpicedt.graphic.view.highlighter
Class TextHighlighter

java.lang.Object
  extended by jpicedt.graphic.view.highlighter.DefaultHighlighter
      extended by jpicedt.graphic.view.highlighter.TextHighlighter
All Implemented Interfaces:
Highlighter

public class TextHighlighter
extends DefaultHighlighter

a Highlighter for TextEditable's. [SR:underway] use TextLayout highlighting facilities ; this Highlighter is not used yet.

Since:
jPicEdt 1.4
Version:
$Id: TextHighlighter.java,v 1.5 2013/03/27 06:54:01 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter
bounds, element, factory, pointIndexIterator, ptBuffer, rectBuffer, shape
 
Constructor Summary
TextHighlighter(TextEditable text, DefaultHighlighterFactory f)
          construct a new Highlighter for the given TextEditable
 
Method Summary
 TextEditable getElement()
          returns the higlighted Element
 void paint(Graphics2D g, Rectangle2D allocation, double scale)
          Render the Highlighter to the given graphic context.
 
Methods inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getHighlighterFactory, hitTest, intersect, syncBounds, syncShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextHighlighter

public TextHighlighter(TextEditable text,
                       DefaultHighlighterFactory f)
construct a new Highlighter for the given TextEditable

Method Detail

getElement

public TextEditable getElement()
Description copied from interface: Highlighter
returns the higlighted Element

Specified by:
getElement in interface Highlighter
Overrides:
getElement in class DefaultHighlighter
Returns:
the higlighted Element.

paint

public void paint(Graphics2D g,
                  Rectangle2D allocation,
                  double scale)
Description copied from class: DefaultHighlighter
Render the Highlighter to the given graphic context.
Current implementation first paints the shape member if it's non-null (see the syncShape() method), then control-points by delegating to a DefaultPointIndexIterator, using the highlighter color if the given allocation intersects the bounds of this view,

Specified by:
paint in interface Highlighter
Overrides:
paint in class DefaultHighlighter
allocation - current clipping
scale - The current scale factor from-model-to-screen for the Graphics2D context ; this may be used to scale down line thickess, etc… so that e.g. barbells appear with the same size on the screen whatever the scale factor being set to the graphic context.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org