|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public Element getElement()
public void setElement(Element e)
public View getParentView()
public PECanvas getContainer()
public ViewFactory getViewFactory()
public Graphics getGraphics()
public Drawing getDrawing()
public void changedUpdate(DrawingEvent.EventType eventType)
public void repaint(Rectangle2D clip)
clip
- the clip rectangle in model-coordinatepublic void paint(Graphics2D g, Rectangle2D allocation)
allocation
- the graphic clippublic Rectangle2D getBounds()
public Highlighter getHighlighter()
public void setHighlighter(Highlighter h)
h
- the delegate ; null if this View mustn't support highlightingpublic void 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.public 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 |