|
|||||||||
Home >> All >> jpicedt >> graphic >> [ view overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
jpicedt.graphic.view
Class AbstractView

java.lang.Objectjpicedt.graphic.view.AbstractView
- All Implemented Interfaces:
- View
- Direct Known Subclasses:
- DefaultViewFactory.CompositeView, DefaultViewFactory.LeafElementView
- public abstract class AbstractView
- extends java.lang.Object
- implements View
- extends java.lang.Object
Abstract implementation that provide some basic common behaviours for View's.
Field Summary | |
protected java.awt.geom.Rectangle2D |
bounds
the bounds rectangle used for clipping (as returned by getBounds) ; this should be updated by changedUpdate. |
protected jpicedt.graphic.model.Element |
element
the graphic element that this View renders |
Fields inherited from interface jpicedt.graphic.view.View |
BARBELL_SIZE, CLICK_DISTANCE |
Constructor Summary | |
AbstractView(jpicedt.graphic.model.Element element)
construct a new View for the given Element |
Method Summary | |
java.awt.geom.Rectangle2D |
getBounds()
|
jpicedt.graphic.PECanvas |
getContainer()
Fetches the container hosting the view. |
jpicedt.graphic.model.Drawing |
getDrawing()
Fetches the model associated with the view. |
jpicedt.graphic.model.Element |
getElement()
|
java.awt.Graphics |
getGraphics()
Fetch a Graphics for rendering from the hosting container (if not null). |
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(jpicedt.graphic.event.PEMouseEvent e,
boolean isHighlightVisible)
Current implementation returns a HitInfo.Point if highlighter is visible and a click occured on an end-point ; return null otherwise. |
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D a)
This implementation does nothing. |
void |
paintHighlighter(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D allocation,
double scale)
Render the Highlighter to the given graphic context. Current implementation paints end-points using the highlighter color if the given allocation intersects the bounds of this view. |
void |
repaint(java.awt.geom.Rectangle2D clip)
ask the hosting container (if it's non-null) to repaint itself |
void |
setElement(jpicedt.graphic.model.Element e)
set the element the View is responsible for rendering |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jpicedt.graphic.view.View |
changedUpdate |
Field Detail |
element
protected jpicedt.graphic.model.Element element
- the graphic element that this View renders
bounds
protected java.awt.geom.Rectangle2D bounds
- the bounds rectangle used for clipping (as returned by getBounds) ; this should be updated
by changedUpdate.
Constructor Detail |
AbstractView
public AbstractView(jpicedt.graphic.model.Element element)
- construct a new View for the given Element
Method Detail |
getElement
public jpicedt.graphic.model.Element getElement()
- Specified by:
getElement
in interfaceView
setElement
public void setElement(jpicedt.graphic.model.Element e)
- set the element the View is responsible for rendering
- Specified by:
setElement
in interfaceView
getParentView
public View getParentView()
- Returns the parent of the view, as given by the tree-structure the associated graphic element belongs to.
- Specified by:
getParentView
in interfaceView
getContainer
public jpicedt.graphic.PECanvas getContainer()
- Fetches the container hosting the view. This is useful for
things like scheduling a repaint, finding out the host
components font, etc. The default implementation
of this is to forward the query to the parent view, if any...
(that means that for this method to return non-null, the element attached to this view
must have a parent, and this parent, a view, etc...)
- Specified by:
getContainer
in interfaceView
getViewFactory
public ViewFactory getViewFactory()
- Fetches the ViewFactory implementation that is feeding the view hierarchy.
- Specified by:
getViewFactory
in interfaceView
getGraphics
public java.awt.Graphics getGraphics()
- Fetch a Graphics for rendering from the hosting container (if not null).
This can be used to determine
font characteristics, and will be different for a print view
than a component view.
- Specified by:
getGraphics
in interfaceView
- Since:
- 1.3
getDrawing
public jpicedt.graphic.model.Drawing getDrawing()
- Fetches the model associated with the view.
- Specified by:
getDrawing
in interfaceView
repaint
public void repaint(java.awt.geom.Rectangle2D clip)
- ask the hosting container (if it's non-null) to repaint itself
paint
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D a)
paintHighlighter
public void paintHighlighter(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)
- Render the Highlighter to the given graphic context.
Current implementation paints end-points using the highlighter color if the given allocation intersects the bounds of this view.- Specified by:
paintHighlighter
in interfaceView
- Since:
- jPicEdt 1.3.2
getBounds
public java.awt.geom.Rectangle2D getBounds()
hitTest
public HitInfo hitTest(jpicedt.graphic.event.PEMouseEvent e, boolean isHighlightVisible)
- Current implementation returns a HitInfo.Point if highlighter is visible and a click
occured on an end-point ; return null otherwise.
- Since:
- jPicEdt 1.3.2
|
|||||||||
Home >> All >> jpicedt >> graphic >> [ view overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |