|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.graphic.view.AbstractView
jpicedt.graphic.view.CompositeView
public class CompositeView
A CompositeView is a graphic representation of a BranchElement. Since jpicedt
1.5, this can also represent a path à-la-pscustom, that is, built from the children's path (except
PicText's).
| Field Summary | |
|---|---|
protected AttributesViewFactory |
factory
|
| Fields inherited from class jpicedt.graphic.view.AbstractView |
|---|
bounds, element, highlighter |
| Constructor Summary | |
|---|---|
CompositeView(BranchElement e,
AttributesViewFactory f)
Construct a new View for the given BranchElement. |
|
| 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. |
BranchElement |
getElement()
Returns the element the View is responsible for rendering |
HitInfo |
hitTest(PEMouseEvent e)
Returns a HitInfo corresponding to the given mouse-event. |
protected boolean |
intersect(Rectangle2D r,
ArrayList<Element> list)
If this view intersects the given rectangle, return the associated BranchElement in
GLOBAL mode, or a child Element if in LOCAL mode. |
protected boolean |
isDisplayAsPath()
|
void |
paint(Graphics2D g,
Rectangle2D a)
Render the View for the graphic element to the given graphic context. |
| Methods inherited from class jpicedt.graphic.view.AbstractView |
|---|
getBounds, getContainer, getDrawing, getGraphics, getHighlighter, getParentView, getViewFactory, hitTest, intersect, paintHighlighter, repaint, setElement, setHighlighter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AttributesViewFactory factory
| Constructor Detail |
|---|
public CompositeView(BranchElement e,
AttributesViewFactory f)
View for the given BranchElement.
f - not used yet; used only for reflection purpose| Method Detail |
|---|
public BranchElement getElement()
View
getElement in interface ViewgetElement in class AbstractViewprotected boolean isDisplayAsPath()
BranchElement as a path (aka
pscustom) or not. Fetches the appropriate information from the BranchElement itself
(actually PicGroup as it is). Note that any subclass of this view that does not support
such feature should simply override to return false.public void changedUpdate(DrawingEvent.EventType eventType)
Highlighter delegate.
public void paint(Graphics2D g,
Rectangle2D a)
View for the graphic element to the given graphic context. This called "paint"
on each child's view if its bounds rectangle intersects the clip.
a - the current graphic clippublic HitInfo hitTest(PEMouseEvent e)
AbstractViewHitInfo corresponding to the given mouse-event.
Only the view's shape should be included in this test.
hitTest in class AbstractViewHitInfo corresponding to the given click-point in model-coordinate. The returned
object depends on the highlighting mode of the associated CompositeHighlighter, if any.
In GLOBAL mode, a HitInfo.Composite is returned on the first successfull
hit-test on children, with the corresponding child-index. In LOCAL mode, a
HitInfo corresponding to all successfull hit-test on children is returned, i.e., possibly
wrapped into a HitInfo.List if more than one Element matches the hit. In the
latter case, a HitInfo.Composite is NEVER returned, except in the case where
the PicGroup contains another PicGroup itself.CompositeHighlighter, the behavior defaults to the
GLOBAL mode.
protected boolean intersect(Rectangle2D r,
ArrayList<Element> list)
BranchElement in
GLOBAL mode, or a child Element if in LOCAL mode. Otherwise
return null.
intersect in class AbstractView
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||