jcreek.cke.conceptview
Class ConceptViewPaintEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjcreek.cke.conceptview.ConceptViewPaintEvent
All Implemented Interfaces:
java.io.Serializable

public class ConceptViewPaintEvent
extends java.util.EventObject

Event object used with ConceptViewPaintListener interface. Provides necessary information for the paint listeners so they can draw to the correct view object with the appropriate graphics context.

Version:
Author:
See Also:
Serialized Form

Field Summary
protected  java.awt.Graphics2D g
          Graphics context the view paint listener is supposed to draw to.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ConceptViewPaintEvent(DrawingSurface view, java.awt.Graphics2D g)
          Creates a new ViewPaintEvent object, using the given view as the source of the event.
 
Method Summary
 java.awt.Graphics2D getGraphics()
          Returns the graphics context to which the view paint listener can draw to the view.
 DrawingSurface getView()
          Returns the ConceptView object associated with this view paint event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

g

protected java.awt.Graphics2D g
Graphics context the view paint listener is supposed to draw to.

Constructor Detail

ConceptViewPaintEvent

public ConceptViewPaintEvent(DrawingSurface view,
                             java.awt.Graphics2D g)
Creates a new ViewPaintEvent object, using the given view as the source of the event.

Method Detail

getGraphics

public java.awt.Graphics2D getGraphics()
Returns the graphics context to which the view paint listener can draw to the view. The returned graphics context object is actually a copy of the original, so the caller may modify this context as they please.

Returns:
graphics context associated with this view

getView

public DrawingSurface getView()
Returns the ConceptView object associated with this view paint event. In the event that the source of the event is not a ConceptView object then this method will return null. Use EventObject.getSource() instead.

Returns:
ConceptView object associated with this event, or null if source is not a view object


Created at IDI, NTNU by the Artificial Intelligence and Learning group