com.miginfocom.ashape
Interface AShapeProvider

All Known Implementing Classes:
DefaultAShapeProvider

public interface AShapeProvider

A very generic interface that specify how to get a RootAShape from some kind of context object.


Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Adds a listener that gets notified when something changes in this provider.
 void addChangeListener(javax.swing.event.ChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when something changes in this provider.
 RootAShape getShape(java.lang.Object context)
          Returns a shape for the context.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes the listener, if it is in the list.
 

Method Detail

getShape

RootAShape getShape(java.lang.Object context)
Returns a shape for the context. The returned shape may be shared globally so it should not be changed.

Parameters:
context - The context to return the shape for.
Returns:
A shape or null if not able to provide a shape for context.

addChangeListener

void addChangeListener(javax.swing.event.ChangeListener l)
Adds a listener that gets notified when something changes in this provider. 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 provider.

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.