|
|
|||||||||
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 a Element. It can be rendered using its paint method.
It provides the following capabilities :
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()
|
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)
|
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()
PECanvas getContainer()
ViewFactory getViewFactory()
Graphics getGraphics()
Drawing getDrawing()
void changedUpdate(DrawingEvent.EventType eventType)
void repaint(Rectangle2D clip)
clip
- the clip rectangle in model-coordinatevoid paint(Graphics2D g, Rectangle2D allocation)
allocation
- the graphic clipRectangle2D getBounds()
Highlighter getHighlighter()
void setHighlighter(Highlighter h)
h
- the delegate ; null if this View mustn't support highlightingvoid paintHighlighter(Graphics2D g, Rectangle2D allocation, double scale)
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)
isHighlightVisible
- whether the receiver should include the highlighter shapes (e.g. end-points)
in the click-sensitive area.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |