org.zaval.awt.gdp
Class Controller

java.lang.Object
  |
  +--org.zaval.awt.gdp.Controller
Direct Known Subclasses:
CursorController, DgnController, DragController, ShapeController

public abstract class Controller
extends java.lang.Object

This abstract class is a base for classes that want to control behaviour different java.awt.Component components. The controlled Java AWT component is defined as a target component. Use setTarget method for the purpose.


Constructor Summary
Controller(java.awt.Component target)
           Constructs a new class with the specified target component.
 
Method Summary
 java.awt.Component getTarget()
           Gets the current target component.
 void setTarget(java.awt.Component c)
           Sets the specified target component.
protected abstract  void targetWasChanged(java.awt.Component newTarget, java.awt.Component oldTarget)
           The method is called whenever the target component has been changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(java.awt.Component target)
Constructs a new class with the specified target component.
Parameters:
target - the specified target component.
Method Detail

setTarget

public void setTarget(java.awt.Component c)
Sets the specified target component.
Parameters:
c - the specified target component.

getTarget

public java.awt.Component getTarget()
Gets the current target component.
Returns:
a current target component.

targetWasChanged

protected abstract void targetWasChanged(java.awt.Component newTarget,
                                         java.awt.Component oldTarget)
The method is called whenever the target component has been changed. Use the method to remove appropriate listeners for the old target instance and set a new listener set for the new target component.
Parameters:
newTarget - the specified new target component.
oldTarget - the specified old target component.


Copyright © Zaval Creative Engineering Group, 2000-2002.
http://www.zaval.org