public abstract class ALcdGXYNewControllerModel extends Object implements ILcdGXYNewControllerModel, ILcdUndoableSource
ILcdGXYNewControllerModel
.
It offers support for undo/redo by means of
addUndoableListener(com.luciad.gui.ILcdUndoableListener)
.Constructor and Description |
---|
ALcdGXYNewControllerModel() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectInGXYLayer(Object aObject,
ILcdGXYLayer aGXYLayer,
ILcdGXYView aGXYView)
Adds aObject in the
ILcdModel of aGXYLayer and updates
aGXYView. |
void |
addUndoableListener(ILcdUndoableListener aListener)
Adds the given
ILcdUndoableListener to the list of registered listeners. |
ILcdGXYLayer |
chooseGXYLayer(ILcdGXYView aGXYView)
This default implementation puts in a
Vector all the ILcdGXYLayer
of the ILcdGXYView that satisfy isValidGXYLayer() then calls
the protected method chooseGXYLayer( ILcdGXYView, Vector ), and returns
its value. |
protected ILcdGXYLayer |
chooseGXYLayer(ILcdGXYView aGXYView,
Vector aVectorOfValidGXYLayer)
If isChooseFirstValidGXYLayer returns false, this method pops up a Dialog
with all the
ILcdGXYLayer s in aVectorOfValidGXYLayer
from which the user has to pick one. |
protected void |
fireUndoableEvent(TLcdUndoableEvent aEvent)
Fires the given
TLcdUndoableEvent to all listeners registered to this
controller. |
boolean |
isAddNewObjectInLayerSelection() |
boolean |
isChooseFirstValidGXYLayer() |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
abstract boolean |
isValidGXYLayer(ILcdGXYLayer aGXYLayer) |
abstract Object |
makeNewInstanceForGXYLayer(ILcdGXYLayer aGXYLayer,
ILcdGXYView aGXYView)
Delegates the creation of a new
Object to be initialized with Mouse
interactions on aGXYView and after inserted in aGXYLayer. |
void |
removeUndoableListener(ILcdUndoableListener aListener)
Removes the given
ILcdUndoableListener from the list of registered listeners. |
void |
setAddNewObjectInLayerSelection(boolean aAddNewObjectInLayerSelection) |
void |
setChooseFirstValidGXYLayer(boolean aChooseFirstValidGXYLayer) |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.public abstract Object makeNewInstanceForGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView)
Object
to be initialized with Mouse
interactions on aGXYView and after inserted in aGXYLayer.makeNewInstanceForGXYLayer
in interface ILcdGXYNewControllerModel
public abstract boolean isValidGXYLayer(ILcdGXYLayer aGXYLayer)
ILcdGXYLayer
for inserting
an Object
to be created and initialized.public ILcdGXYLayer chooseGXYLayer(ILcdGXYView aGXYView)
Vector
all the ILcdGXYLayer
of the ILcdGXYView
that satisfy isValidGXYLayer()
then calls
the protected method chooseGXYLayer( ILcdGXYView, Vector
), and returns
its value.chooseGXYLayer
in interface ILcdGXYNewControllerModel
protected ILcdGXYLayer chooseGXYLayer(ILcdGXYView aGXYView, Vector aVectorOfValidGXYLayer)
ILcdGXYLayer
s in aVectorOfValidGXYLayer
from which the user has to pick one. This method makes use of the
TLcdUserDialog.choose method and display the Strings returned by
ILcdGXYLayer.getLabel
.
If isChooseFirstValidGXYLayer returns true, this method returns the first
ILcdGXYLayer
in aVectorOfValidGXYLayer.
aVectorOfValidGXYLayer is created by the chooseGXYLayer(ILcdGXYView)
method.
public void setChooseFirstValidGXYLayer(boolean aChooseFirstValidGXYLayer)
aChooseFirstValidGXYLayer
- if true: the first valid
ILcdGXYLayer
. If false, the user has to pick one
among the valid ones. Default value is false.public boolean isChooseFirstValidGXYLayer()
ILcdGXYLayer
. false
, if
the user has to pick one among the valid ones. Default value is false.public void setAddNewObjectInLayerSelection(boolean aAddNewObjectInLayerSelection)
aAddNewObjectInLayerSelection
- if true, this
ILcdGXYNewControllerModel
put each new created Object
also in the ILcdGXYLayer
selection. If false, it
put only the objects in the ILcdModel
of the chosen
ILcdGXYLayer
. Is false
by default.public boolean isAddNewObjectInLayerSelection()
setAddNewObjectInLayerSelection(boolean)
public void addObjectInGXYLayer(Object aObject, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView)
ILcdModel
of aGXYLayer and updates
aGXYView.addObjectInGXYLayer
in interface ILcdGXYNewControllerModel
public void addUndoableListener(ILcdUndoableListener aListener)
ILcdUndoableListener
to the list of registered listeners.
The listener now receives TLcdUndoableEvent
s from this controller.
By for example adding a TLcdUndoManager
to this controller,
undo/redo support can be enabled.addUndoableListener
in interface ILcdUndoableSource
aListener
- The listener to add.removeUndoableListener(com.luciad.gui.ILcdUndoableListener)
public void removeUndoableListener(ILcdUndoableListener aListener)
ILcdUndoableListener
from the list of registered listeners.
The listener no longer receives TLcdUndoableEvent
s from this controller.
Removing a listener that was never added or already removed, has no effect.removeUndoableListener
in interface ILcdUndoableSource
aListener
- The listener to remove.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
protected void fireUndoableEvent(TLcdUndoableEvent aEvent)
TLcdUndoableEvent
to all listeners registered to this
controller.aEvent
- The event to fire to all registered listeners.addUndoableListener(com.luciad.gui.ILcdUndoableListener)