public abstract class AbstractView extends java.lang.Object implements View, ViewConstants
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.geom.Rectangle2D |
bounds
the bounds rectangle used for clipping (as returned by getBounds) ; this should be updated
by changedUpdate.
|
protected Element |
element
the graphic element that this View renders
|
protected Highlighter |
highlighter
the highlighter delegate for this view
|
BARBELL_SIZE, CLICK_DISTANCE| Constructor and Description |
|---|
AbstractView(Element element)
construct a new View for the given Element
|
AbstractView(Element element,
Highlighter h)
construct a new View for the given Element, delegating highlighting
to the given Highlighter.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Rectangle2D |
getBounds() |
PECanvas |
getContainer()
Fetches the container hosting the view.
|
Drawing |
getDrawing()
Fetches the model associated with the view.
|
Element |
getElement() |
java.awt.Graphics |
getGraphics()
Fetch a Graphics for rendering from the hosting container (if not null).
|
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.
|
protected abstract HitInfo |
hitTest(PEMouseEvent e)
Returns a HitInfo corresponding to the given mouse-event.
|
HitInfo |
hitTest(PEMouseEvent e,
boolean isHighlightVisible)
Depending on the value of isHighlighVisible, current implementation first delegates
to the hosted Highlighter's hitTest() method, then calls
hitTest(PEMouseEvent). |
void |
paintHighlighter(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D allocation,
double scale)
Render the Highlighter to the given graphic context.
|
void |
repaint(java.awt.geom.Rectangle2D clip)
ask the hosting container (if it's non-null) 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangedUpdate, paintprotected Element element
protected java.awt.geom.Rectangle2D bounds
protected Highlighter highlighter
public AbstractView(Element element)
public AbstractView(Element element, Highlighter h)
public Element getElement()
getElement in interface Viewpublic void setElement(Element e)
setElement in interface Viewpublic View getParentView()
getParentView in interface Viewpublic PECanvas getContainer()
getContainer in interface Viewpublic ViewFactory getViewFactory()
getViewFactory in interface Viewpublic java.awt.Graphics getGraphics()
getGraphics in interface Viewpublic Drawing getDrawing()
getDrawing in interface Viewpublic void repaint(java.awt.geom.Rectangle2D clip)
public java.awt.geom.Rectangle2D getBounds()
public Highlighter getHighlighter()
getHighlighter in interface Viewpublic void setHighlighter(Highlighter h)
setHighlighter in interface Viewh - the delegate ; null if this View mustn't support highlightingpublic void paintHighlighter(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D allocation,
double scale)
paintHighlighter in interface Viewallocation - 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.protected abstract HitInfo hitTest(PEMouseEvent e)
public HitInfo hitTest(PEMouseEvent e, boolean isHighlightVisible)
hitTest(PEMouseEvent).Submit a bug : syd@jpicedt.org