http://www.jpicedt.org

jpicedt.graphic.view
Class CompositeView

java.lang.Object
  extended by jpicedt.graphic.view.AbstractView
      extended by jpicedt.graphic.view.CompositeView
All Implemented Interfaces:
View, ViewConstants

public class CompositeView
extends AbstractView

a CompositeView is a graphic representation of a BranchElement

Since:
jpicedt 1.4
Version:
$Id: CompositeView.java,v 1.4.2.1 2007/09/02 11:56:29 reynal Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from class jpicedt.graphic.view.AbstractView
bounds, element, highlighter
 
Fields inherited from interface jpicedt.graphic.view.ViewConstants
BARBELL_SIZE, CLICK_DISTANCE
 
Constructor Summary
CompositeView(BranchElement e)
          construct a new View for the given PicGroup
 
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.
 HitInfo hitTest(PEMouseEvent e)
          Returns a HitInfo corresponding to the given mouse-event.
 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, getElement, getGraphics, getHighlighter, getParentView, getViewFactory, hitTest, paintHighlighter, repaint, setElement, setHighlighter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeView

public CompositeView(BranchElement e)
construct a new View for the given PicGroup

Method Detail

changedUpdate

public void changedUpdate(DrawingEvent.EventType eventType)
Give notification from the model that a change occured for an element this view is responsible for rendering. This implementation update the view's bounds from the element's bounding box, delegating highlighter's bounds to the current Highlighter delegate..


paint

public void paint(Graphics2D g,
                  Rectangle2D a)
Render the 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.

Parameters:
allocation - the current graphic clip

hitTest

public HitInfo hitTest(PEMouseEvent e)
Description copied from class: AbstractView
Returns a HitInfo corresponding to the given mouse-event. Only the view's shape should be included in this test.

Specified by:
hitTest in class AbstractView
Returns:
a HitInfo corresponding to the given click-point in model-coordinate.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org