public interface ILcdGXYController extends Serializable
ILcdGXYView
.
When a controller is assigned to a view (using ILcdGXYView.setGXYController),
startInteraction
is called.
From then on the controller is responsible for interpreting the user interaction on the view, until
terminateInteraction
is called for that view.
The user interaction can originate from a key stroke, the mouse, or any other input device.
The controller implementation can therefore be a MouseListener, MouseMotionListener, KeyListener, ... implementation.
Interpreting the user interaction may consist of changing the internal state of the view or any of its constituents. For example, a zoom controller may change the views scale, while a select controller may change the selection state of an object in a layer which is part of the view. Note that consumption of user interaction is not part of this interface, but is part of other interfaces the controller may implement, such as MouseListener, MouseMotionListener, ... .
The controller may indicate how user interaction is interpreted by rendering visual feedback on the
view using the paint
method. Note that the controller is responsible for
repainting the view as needed.
ILcdIcon
.
ILcdGXYView
Modifier and Type | Method and Description |
---|---|
Cursor |
getCursor()
Returns the cursor that will be displayed on a view when this controller is active for that view.
|
ILcdIcon |
getIcon()
Returns an icon to visualize the interaction implemented.
|
default ILcdLayered |
getLayered()
Returns the layers associated with this controller.
|
String |
getName()
Returns a name for this controller that enables to determine the interaction that
can be performed with this controller.
|
String |
getShortDescription()
Returns a short description that enables to determine the interaction that
can be performed with this controller.
|
void |
paint(Graphics aGraphics)
Enables the controller to give visual feedback on the current user interactions.
|
void |
startInteraction(ILcdGXYView aGXYView)
Sets up the controller to receive input through the view passed.
|
void |
terminateInteraction(ILcdGXYView aGXYView)
Configures the controller to no longer receive input through the view passed.
|
void |
viewRepaint(ILcdGXYView aGXYView)
Deprecated.
Use the method
paint(java.awt.Graphics) . |
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.
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
void terminateInteraction(ILcdGXYView aGXYView)
All ILcdGXYView
implementations that support interaction call this method when another controller
has been made active with setGXYController
on the view,
so this method shouldn't normally be called directly.
Note that most view implementations remove the controller as listener if appropriate before calling
this method.
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
startInteraction(com.luciad.view.gxy.ILcdGXYView)
void viewRepaint(ILcdGXYView aGXYView)
paint(java.awt.Graphics)
.ILcdGXYView
after painting/drawing
all its ILcdGXYLayer
s. It allows this
ILcdGXYController
to draw specific information on top of the
ILcdGXYView
it is set to.aGXYView
- the ILcdGXYView
to draw on.void paint(Graphics aGraphics)
aGraphics
- the Graphics to paint on.default ILcdLayered getLayered()
Custom implementations of this method should take care to return the same ILcdLayered
instance every time this method is called to guarantee correct working of the ILcdLayered
interface.
Cursor getCursor()
String getName()
String getShortDescription()
ILcdGXYController
.ILcdIcon getIcon()