Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jpicedt.graphic.view
Interface Highlighter

All Known Implementing Classes:
  DefaultHighlighterFactory.DefaultHighlighter

public interface Highlighter

a view dedicated to painting an Element's highlighter, e.g. when the Element is selected. This is a delegate for a hosting HighlightableView, and is created by a dedicated HighlighterFactory.
This highlighter should provide the following capabilities :

- Rendering highlighted parts of the given Element to a Graphics2D context ;
- Mouse-hit testing on the highlighted part only.

Since:
  jpicedt 1.4
Version:
  $Id: Highlighter.java,v 1.4.2.1 2007/09/02 11:56:29 reynal Exp $
Author:
  Sylvain Reynal

Method Summary
`void` | `changedUpdate(DrawingEvent.EventType eventType, double scale)` Give notification from the model that a change occured for an element's highlighting this highlighter is responsible for rendering.
`Rectangle2D` | `getBounds()`
`HighlighterFactory` | `getHighlighterFactory()` Fetches the HighlighterFactory implementation that is feeding the view hierarchy.
`HitInfo` | `hitTest(PEMouseEvent e)`
`void` | `paint(Graphics2D g, Rectangle2D allocation, double scale)` Render the Highlighter to the given graphic context.

Method Detail

### getHighlighterFactory

    public HighlighterFactory getHighlighterFactory()

  Fetches the HighlighterFactory implementation that is feeding the view hierarchy.

  Returns:
    the factory, null if none

### changedUpdate

    public void changedUpdate(DrawingEvent.EventType eventType,
                              double scale)

  Give notification from the model that a change occured for an element's highlighting this highlighter is responsible for rendering.

### paint

    public void paint(Graphics2D g,
                      Rectangle2D allocation,
                      double scale)

  Render the Highlighter to the given graphic context.

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

### getBounds

    public Rectangle2D getBounds()

  Returns:
    the bounds of this Highlighter
    This will determine the clipping rectangle passed as a parameter to repaint in the hosting view

### hitTest

    public HitInfo hitTest(PEMouseEvent e)

  Returns:
    a HitInfo corresponding to the given mouse-event on this Highlighter.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug : syd@jpicedt.org