http://www.jpicedt.org

jpicedt.graphic.view.highlighter
Class DefaultHighlighterFactory

java.lang.Object
  extended by jpicedt.graphic.view.highlighter.DefaultHighlighterFactory
All Implemented Interfaces:
HighlighterFactory

public class DefaultHighlighterFactory
extends Object
implements HighlighterFactory

This is the default factory used to create a Highlighter for a given Element.

Since:
jPicEdt 1.4
Version:
$Id: DefaultHighlighterFactory.java,v 1.7 2013/03/27 06:54:31 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
static Color GLOBAL_HIGHLIGHTING_COLOR
           
static Color LOCAL_HIGHLIGHTING_COLOR
           
 
Constructor Summary
DefaultHighlighterFactory()
           
 
Method Summary
 Highlighter createHighlighter(Element element)
           
protected  Stroke createStroke(double scale)
          Returns a Stroke object suited for painting hightlighter's stroke, e.g. tangents.
<T extends Element>
Class<? extends Highlighter>
getMappedClass(Class<T> classElement)
           
 void map(Class<? extends Element> classElement, Class<? extends Highlighter> classHighlighter)
           
 void unmap(Class<? extends Element> classElement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_HIGHLIGHTING_COLOR

public static final Color LOCAL_HIGHLIGHTING_COLOR

GLOBAL_HIGHLIGHTING_COLOR

public static final Color GLOBAL_HIGHLIGHTING_COLOR
Constructor Detail

DefaultHighlighterFactory

public DefaultHighlighterFactory()
Method Detail

map

public void map(Class<? extends Element> classElement,
                Class<? extends Highlighter> classHighlighter)
Since:
jpicedt 1.5

unmap

public void unmap(Class<? extends Element> classElement)
Since:
jpicedt 1.5

getMappedClass

public <T extends Element> Class<? extends Highlighter> getMappedClass(Class<T> classElement)
Since:
jpicedt 1.5

createHighlighter

public Highlighter createHighlighter(Element element)
Specified by:
createHighlighter in interface HighlighterFactory
Returns:
a Highlighter for the given Element

createStroke

protected Stroke createStroke(double scale)
Returns a Stroke object suited for painting hightlighter's stroke, e.g. tangents.

Parameters:
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 lines/rectangle/... appear with the same length on the screen whatever the scale factor that's set to the graphic context.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org