Package com.luciad.view.gxy.controller
Class ALcdGXYNewControllerModel
java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYNewControllerModel
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdGXYNewControllerModel
public abstract class ALcdGXYNewControllerModel
extends Object
implements ILcdGXYNewControllerModel, ILcdUndoableSource
This abstract class can be used as a basis for creating an implementation of
ILcdGXYNewControllerModel
.
It offers support for undo/redo by means of
addUndoableListener(com.luciad.gui.ILcdUndoableListener)
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObjectInGXYLayer
(Object aObject, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView) Adds aObject in theILcdModel
of aGXYLayer and updates aGXYView.void
addUndoableListener
(ILcdUndoableListener aListener) Adds the givenILcdUndoableListener
to the list of registered listeners.chooseGXYLayer
(ILcdGXYView aGXYView) This default implementation puts in aVector
all theILcdGXYLayer
of theILcdGXYView
that satisfyisValidGXYLayer()
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 theILcdGXYLayer
s in aVectorOfValidGXYLayer from which the user has to pick one.protected void
fireUndoableEvent
(TLcdUndoableEvent aEvent) Fires the givenTLcdUndoableEvent
to all listeners registered to this controller.boolean
boolean
boolean
Deprecated.This method has been deprecated.abstract boolean
isValidGXYLayer
(ILcdGXYLayer aGXYLayer) abstract Object
makeNewInstanceForGXYLayer
(ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView) Delegates the creation of a newObject
to be initialized with Mouse interactions on aGXYView and after inserted in aGXYLayer.void
removeUndoableListener
(ILcdUndoableListener aListener) Removes the givenILcdUndoableListener
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.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.
-
Constructor Details
-
ALcdGXYNewControllerModel
public ALcdGXYNewControllerModel()
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
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.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
makeNewInstanceForGXYLayer
Delegates the creation of a newObject
to be initialized with Mouse interactions on aGXYView and after inserted in aGXYLayer.- Specified by:
makeNewInstanceForGXYLayer
in interfaceILcdGXYNewControllerModel
-
isValidGXYLayer
- Returns:
- if aGXYLayer is a valid
ILcdGXYLayer
for inserting anObject
to be created and initialized.
-
chooseGXYLayer
This default implementation puts in aVector
all theILcdGXYLayer
of theILcdGXYView
that satisfyisValidGXYLayer()
then calls the protected method chooseGXYLayer( ILcdGXYView,Vector
), and returns its value.- Specified by:
chooseGXYLayer
in interfaceILcdGXYNewControllerModel
-
chooseGXYLayer
If isChooseFirstValidGXYLayer returns false, this method pops up a Dialog with all theILcdGXYLayer
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 byILcdGXYLayer.getLabel
.If isChooseFirstValidGXYLayer returns true, this method returns the first
ILcdGXYLayer
in aVectorOfValidGXYLayer.aVectorOfValidGXYLayer is created by the
chooseGXYLayer(ILcdGXYView)
method. -
setChooseFirstValidGXYLayer
public void setChooseFirstValidGXYLayer(boolean aChooseFirstValidGXYLayer) - Parameters:
aChooseFirstValidGXYLayer
- if true: the first validILcdGXYLayer
. If false, the user has to pick one among the valid ones. Default value is false.
-
isChooseFirstValidGXYLayer
public boolean isChooseFirstValidGXYLayer()- Returns:
- true if the first valid
ILcdGXYLayer
.false
, if the user has to pick one among the valid ones. Default value is false.
-
setAddNewObjectInLayerSelection
public void setAddNewObjectInLayerSelection(boolean aAddNewObjectInLayerSelection) - Parameters:
aAddNewObjectInLayerSelection
- if true, thisILcdGXYNewControllerModel
put each new createdObject
also in theILcdGXYLayer
selection. If false, it put only the objects in theILcdModel
of the chosenILcdGXYLayer
. Isfalse
by default.
-
isAddNewObjectInLayerSelection
public boolean isAddNewObjectInLayerSelection()- See Also:
-
addObjectInGXYLayer
Adds aObject in theILcdModel
of aGXYLayer and updates aGXYView.- Specified by:
addObjectInGXYLayer
in interfaceILcdGXYNewControllerModel
-
addUndoableListener
Adds the givenILcdUndoableListener
to the list of registered listeners. The listener now receivesTLcdUndoableEvent
s from this controller. By for example adding aTLcdUndoManager
to this controller, undo/redo support can be enabled.- Specified by:
addUndoableListener
in interfaceILcdUndoableSource
- Parameters:
aListener
- The listener to add.- See Also:
-
removeUndoableListener
Removes the givenILcdUndoableListener
from the list of registered listeners. The listener no longer receivesTLcdUndoableEvent
s from this controller. Removing a listener that was never added or already removed, has no effect.- Specified by:
removeUndoableListener
in interfaceILcdUndoableSource
- Parameters:
aListener
- The listener to remove.- See Also:
-
fireUndoableEvent
Fires the givenTLcdUndoableEvent
to all listeners registered to this controller.- Parameters:
aEvent
- The event to fire to all registered listeners.- See Also:
-