public abstract class ALcdGXYChainableController extends ALcdGXYController implements ILcdGXYChainableController
ILcdGXYChainableController that implements
startInteraction
, terminateInteraction
and paint
to call a
corresponding implementation ( see startInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
, terminateInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
and paintImpl(java.awt.Graphics)
) and then call the same method in the next controller.
ILcdAWTEventListener.handleAWTEvent(java.awt.AWTEvent)
should be handled in a similar way, but this is left
to the implementations.Constructor and Description |
---|
ALcdGXYChainableController() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aStatusListener)
Registers the given listener so it will receive status events from this source.
|
void |
appendGXYController(ILcdGXYChainableController aEnd)
This method will append the passed controller to the end of the chain.
|
ILcdGXYChainableController |
getNextGXYController()
Returns a reference to the controller that is located after this one in a chain, or null
if this controller is the last element of the chain.
|
void |
paint(Graphics aGraphics)
Enables the controller to give visual feedback on the current user interactions.
|
protected void |
paintImpl(Graphics aGraphics)
The specific implementation of
paint for this controller. |
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Removes the specified listener so it is no longer notified.
|
void |
setNextGXYController(ILcdGXYChainableController aNext)
This method sets the next controller in the chain for this controller.
|
void |
startInteraction(ILcdGXYView aGXYView)
Sets up the controller to receive input through the view passed.
|
protected void |
startInteractionImpl(ILcdGXYView aGXYView)
The specific implementation of
startInteraction for this controller. |
void |
terminateInteraction(ILcdGXYView aGXYView)
Releases a few items.
|
protected void |
terminateInteractionImpl(ILcdGXYView aGXYView)
The specific implementation of
terminateInteraction for this controller. |
asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, isTraceOn, registerInstance, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, setTraceOn, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
handleAWTEvent
public ILcdGXYChainableController getNextGXYController()
ILcdGXYChainableController
getNextGXYController
in interface ILcdGXYChainableController
ILcdGXYChainableController.setNextGXYController(ILcdGXYChainableController)
public void setNextGXYController(ILcdGXYChainableController aNext)
ILcdGXYChainableController
setNextGXYController
in interface ILcdGXYChainableController
aNext
- the reference to the controller that will be the next element in the chainILcdGXYChainableController.getNextGXYController()
public void appendGXYController(ILcdGXYChainableController aEnd)
ILcdGXYChainableController
appendGXYController
in interface ILcdGXYChainableController
aEnd
- the controller to be appended to the end of the chain.public void addStatusListener(ILcdStatusListener aStatusListener)
ILcdStatusSource
Registers the given listener so it will receive status events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source,
you can use a ALcdWeakStatusListener
instance as status listener.
addStatusListener
in interface ILcdStatusSource
addStatusListener
in class ALcdGXYController
aStatusListener
- The listener to be notified when the status has changed.public void removeStatusListener(ILcdStatusListener aStatusListener)
ILcdStatusSource
removeStatusListener
in interface ILcdStatusSource
removeStatusListener
in class ALcdGXYController
aStatusListener
- The listener to remove.public void startInteraction(ILcdGXYView aGXYView)
All ILcdGXYView
implementations that support interaction call this method when the controller
has been made active with setGXYController
on the view,
so this method shouldn't normally be called directly.
Note that most view implementations add the controller as listener if appropriate before calling
this method.
Sets the cursor on the view and sets the view for which this controller is now active.
Sends out a status event based on the short description
.
This method also calls startInteraction(com.luciad.view.gxy.ILcdGXYView)
on the next controller.
Override startInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
if you want to add your own behavior to this controller.
startInteraction
in interface ILcdGXYController
startInteraction
in class ALcdGXYController
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.startInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
public void terminateInteraction(ILcdGXYView aGXYView)
This method also calls terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
on the next controller.
Override terminateInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
if you want to add your own behavior to this controller.
terminateInteraction
in interface ILcdGXYController
terminateInteraction
in class ALcdGXYController
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.terminateInteractionImpl(com.luciad.view.gxy.ILcdGXYView)
public void paint(Graphics aGraphics)
Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
This method also calls paint(java.awt.Graphics)
on the next controller.
Override paintImpl(java.awt.Graphics)
if you want to add your own behavior to this controller.
paint
in interface ILcdGXYController
paint
in class ALcdGXYController
aGraphics
- the Graphics on which the view was rendered.paintImpl(java.awt.Graphics)
protected void startInteractionImpl(ILcdGXYView aGXYView)
startInteraction
for this controller.aGXYView
- the view to start interaction with.protected void terminateInteractionImpl(ILcdGXYView aGXYView)
terminateInteraction
for this controller.aGXYView
- the view to terminate interaction with.protected void paintImpl(Graphics aGraphics)
paint
for this controller.aGraphics
- the graphics to be used for painting.