com.miginfocom.calendar.activity.renderer
Interface ActivityViewRenderer

All Known Implementing Classes:
AShapeRenderer

public interface ActivityViewRenderer

An interface that outlines a renderer that draws ActivityViews within some bounds.


Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Adds a listener that gets notified when something changes in this renderer.
 void addChangeListener(javax.swing.event.ChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when something changes in this renderer.
 java.awt.Insets getRepaintMargin()
          During the paint phase the maximum repaint padding is accumulated and returned here.
 void paint(java.awt.Graphics2D g2, java.awt.Rectangle bounds, TimeSpanList activityViewList)
          Paints the activity views in the List.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes the listener, if it is in the list.
 

Method Detail

paint

void paint(java.awt.Graphics2D g2,
           java.awt.Rectangle bounds,
           TimeSpanList activityViewList)
Paints the activity views in the List. The bounds of the activity views should already be set to the correct values, for instance by a ActivityLayout.

Parameters:
g2 - the Graphics object to paint in.
bounds - The bounds of the container to draw within. The clip can be smaller. Not null.
activityViewList - The activities to paint/draw. Should be ActivityView objects.

getRepaintMargin

java.awt.Insets getRepaintMargin()
During the paint phase the maximum repaint padding is accumulated and returned here.

Returns:
The extra margin around. Positive values or 0. Not null. Always at least 1 for the margin to compensate for anti-aliasing, strokes and such. Could be a shared object so do not change it, consider read-only!
See Also:
RootAShape.getRepaintPadding()

addChangeListener

void addChangeListener(javax.swing.event.ChangeListener l)
Adds a listener that gets notified when something changes in this renderer. Will be added as strong reference.

Parameters:
l - The listener. Not null

addChangeListener

void addChangeListener(javax.swing.event.ChangeListener l,
                       boolean asWeakRef)
Adds a listener that gets notified when something changes in this renderer.

Parameters:
l - The listener. Not null
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeChangeListener

void removeChangeListener(javax.swing.event.ChangeListener l)
Removes the listener, if it is in the list.

Parameters:
l - The listener to remove, not null.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.