org.jdrawing
Interface DrawingElementRenderer

All Known Implementing Classes:
TransformingDrawingElementRenderer

public interface DrawingElementRenderer

Defines the requirements for an object that displays a drawing element.


Method Summary
 boolean elementContains(java.lang.Object element, java.awt.geom.Point2D point)
          Tests if the given element contains the given point.
 boolean elementIntersects(java.lang.Object element, java.awt.geom.Rectangle2D rectangle)
          Tests if the given element intersects with the given rectangle.
 java.awt.Rectangle getElementBounds(java.lang.Object element)
          Gets the bounding box for the element.
 java.awt.geom.Rectangle2D getElementBounds2D(java.lang.Object element)
          Return the high precision bounding box of the element.
 void paintDrawingElement(java.awt.Graphics graphics, java.lang.Object element)
          Paints the given element.
 

Method Detail

paintDrawingElement

public void paintDrawingElement(java.awt.Graphics graphics,
                                java.lang.Object element)
Paints the given element.

Parameters:
graphics - graphics context to use for painting
element - element to be painted

getElementBounds

public java.awt.Rectangle getElementBounds(java.lang.Object element)
Gets the bounding box for the element.

Parameters:
element - element to be queried for bounding box
Returns:
bounding box of the element

getElementBounds2D

public java.awt.geom.Rectangle2D getElementBounds2D(java.lang.Object element)
Return the high precision bounding box of the element.

Parameters:
element - element to be queried for bounding box
Returns:
high precision bounding box of the element

elementIntersects

public boolean elementIntersects(java.lang.Object element,
                                 java.awt.geom.Rectangle2D rectangle)
Tests if the given element intersects with the given rectangle.

Parameters:
element - element to be checked for intersection
rectangle - rectangle to be checked for intersection
Returns:
true the given element intersects with the given rectangle; false otherwise

elementContains

public boolean elementContains(java.lang.Object element,
                               java.awt.geom.Point2D point)
Tests if the given element contains the given point.

Parameters:
element - element to be checked
point - point to be checked
Returns:
true the given element containes the given point; false otherwise