|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface View
A View
is a graphic representation of an Element
.
It can be rendered using its paint()
method.
It provides the following capabilities :
Graphics2D
context;hitTest()
method simply return null to signal that every
mouse-click just fails, and their paintHighlighter do nothing.
Method Summary | |
---|---|
void |
changedUpdate(DrawingEvent.EventType eventType)
Give notification from the model that a change occured for an element this view is responsible for rendering. |
Rectangle2D |
getBounds()
|
PECanvas |
getContainer()
Fetches the container hosting the view. |
Drawing |
getDrawing()
Fetches the document associated with the view. |
Element |
getElement()
Returns the element the View is responsible for rendering |
Graphics |
getGraphics()
Fetch a Graphics for rendering. |
Highlighter |
getHighlighter()
Returns the Highlighter responsible for rendering the highlighted part of this view. |
View |
getParentView()
Returns the parent of the view, as given by the tree-structure the associated graphic element belongs to. |
ViewFactory |
getViewFactory()
Fetches the ViewFactory implementation that is feeding the view hierarchy. |
HitInfo |
hitTest(PEMouseEvent e,
boolean isHighlightVisible)
Returns a HitInfo corresponding to the given mouse-event |
boolean |
intersect(Rectangle2D r,
boolean isHighlightVisible,
ArrayList<Element> list)
If this view or its highlighter intersects the given rectangle, add the associated Element (or a child Element if it's more appropriate, for
instance for composite views) to the given list. |
void |
paint(Graphics2D g,
Rectangle2D allocation)
Render the View of the underlying Element to the given graphic context. |
void |
paintHighlighter(Graphics2D g,
Rectangle2D allocation,
double scale)
Render the Highlighter to the given graphic context. |
void |
repaint(Rectangle2D clip)
Ask the hosting container to repaint itself. |
void |
setElement(Element e)
set the element the View is responsible for rendering |
void |
setHighlighter(Highlighter h)
Sets the Highlighter responsible for rendering the highlighted part of this view. |
Method Detail |
---|
Element getElement()
void setElement(Element e)
View getParentView()
null
if nonePECanvas getContainer()
ViewFactory getViewFactory()
ViewFactory
implementation that is feeding the view hierarchy.
Graphics getGraphics()
Graphics
for rendering. This can be used to determine
font characteristics, and will be different for a print view
than a component view.
Drawing getDrawing()
void changedUpdate(DrawingEvent.EventType eventType)
void repaint(Rectangle2D clip)
clip
- the clip rectangle in model-coordinatevoid paint(Graphics2D g, Rectangle2D allocation)
View
of the underlying Element to the given graphic context.
allocation
- the graphic clipRectangle2D getBounds()
View
.Highlighter getHighlighter()
void setHighlighter(Highlighter h)
Highlighter
responsible for rendering the highlighted part of this view.
h
- the delegate ; null if this View
mustn't support highlighting.void paintHighlighter(Graphics2D g, Rectangle2D allocation, double scale)
Highlighter
to the given graphic context.
allocation
- current clippingscale
- 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.HitInfo hitTest(PEMouseEvent e, boolean isHighlightVisible)
HitInfo
corresponding to the given mouse-event
e
- the mouse event for which a HitInfo
is returnedisHighlightVisible
- whether the receiver should include the
highlighter shapes (e.g. end-points) in the click-sensitive
area.boolean intersect(Rectangle2D r, boolean isHighlightVisible, ArrayList<Element> list)
Element
(or a child Element
if it's more appropriate, for
instance for composite views) to the given list.
isHighlightVisible
- whether the receiver should include the
highlighter shapes (e.g. control-points) in the intersection
area.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |