Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.graphic.view
Interface View  view View download View.java

All Known Implementing Classes:
AbstractView

public interface View

a View is a graphic representation of a Element. It can be rendered using its paint method.

It provides the following capabilities :

View's belong to a tree that has the same structure as the associated Drawing, since each View is attached to an element in the tree.


Field Summary
static double BARBELL_SIZE
          a constant that can be used as the size of selection-barbells (in pixels !!!)
static double CLICK_DISTANCE
          a constant that can be used as the max.
 
Method Summary
 void changedUpdate(jpicedt.graphic.event.DrawingEvent.EventType eventType)
          Give notification from the model that a change occured for an element this view is responsible for rendering.
 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.
 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 allocation)
          Render the View of the underlying Element to the given graphic context.
 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 to repaint itself
 void setElement(jpicedt.graphic.model.Element e)
          set the element the View is responsible for rendering
 

Field Detail

CLICK_DISTANCE

public static final double CLICK_DISTANCE
a constant that can be used as the max. distance b/w a point and a mouse click that triggers a selection (in mm !!!)

See Also:
Constant Field Values

BARBELL_SIZE

public static final double BARBELL_SIZE
a constant that can be used as the size of selection-barbells (in pixels !!!)

See Also:
Constant Field Values
Method Detail

getElement

public jpicedt.graphic.model.Element getElement()

setElement

public void setElement(jpicedt.graphic.model.Element e)
set the element the View is responsible for rendering


getParentView

public View getParentView()
Returns the parent of the view, as given by the tree-structure the associated graphic element belongs to.


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.


getViewFactory

public ViewFactory getViewFactory()
Fetches the ViewFactory implementation that is feeding the view hierarchy.


getGraphics

public java.awt.Graphics getGraphics()
Fetch a Graphics for rendering. This can be used to determine font characteristics, and will be different for a print view than a component view.

Since:
1.3

getDrawing

public jpicedt.graphic.model.Drawing getDrawing()
Fetches the model associated with the view.


changedUpdate

public void changedUpdate(jpicedt.graphic.event.DrawingEvent.EventType eventType)
Give notification from the model that a change occured for an element this view is responsible for rendering.


repaint

public void repaint(java.awt.geom.Rectangle2D clip)
ask the hosting container to repaint itself


paint

public void paint(java.awt.Graphics2D g,
                  java.awt.geom.Rectangle2D allocation)
Render the View of the underlying Element to the given graphic context.

Since:
jPicEdt 1.3.2

paintHighlighter

public void paintHighlighter(java.awt.Graphics2D g,
                             java.awt.geom.Rectangle2D allocation,
                             double scale)
Render the Highlighter to the given graphic context.

Since:
jPicEdt 1.3.2

getBounds

public java.awt.geom.Rectangle2D getBounds()
Since:
jPicEdt 1.3.2

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