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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObjectInGXYLayer(Object aObject, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView) Adds aObject in theILcdModelof aGXYLayer and updates aGXYView.voidaddUndoableListener(ILcdUndoableListener aListener) Adds the givenILcdUndoableListenerto the list of registered listeners.chooseGXYLayer(ILcdGXYView aGXYView) This default implementation puts in aVectorall theILcdGXYLayerof theILcdGXYViewthat satisfyisValidGXYLayer()then calls the protected method chooseGXYLayer( ILcdGXYView,Vector), and returns its value.protected ILcdGXYLayerchooseGXYLayer(ILcdGXYView aGXYView, Vector aVectorOfValidGXYLayer) If isChooseFirstValidGXYLayer returns false, this method pops up a Dialog with all theILcdGXYLayers in aVectorOfValidGXYLayer from which the user has to pick one.protected voidfireUndoableEvent(TLcdUndoableEvent aEvent) Fires the givenTLcdUndoableEventto all listeners registered to this controller.booleanbooleanbooleanDeprecated.This method has been deprecated.abstract booleanisValidGXYLayer(ILcdGXYLayer aGXYLayer) abstract ObjectmakeNewInstanceForGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView) Delegates the creation of a newObjectto be initialized with Mouse interactions on aGXYView and after inserted in aGXYLayer.voidremoveUndoableListener(ILcdUndoableListener aListener) Removes the givenILcdUndoableListenerfrom the list of registered listeners.voidsetAddNewObjectInLayerSelection(boolean aAddNewObjectInLayerSelection) voidsetChooseFirstValidGXYLayer(boolean aChooseFirstValidGXYLayer) static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetTraceOn(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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
makeNewInstanceForGXYLayer
Delegates the creation of a newObjectto be initialized with Mouse interactions on aGXYView and after inserted in aGXYLayer.- Specified by:
makeNewInstanceForGXYLayerin interfaceILcdGXYNewControllerModel
-
isValidGXYLayer
- Returns:
- if aGXYLayer is a valid
ILcdGXYLayerfor inserting anObjectto be created and initialized.
-
chooseGXYLayer
This default implementation puts in aVectorall theILcdGXYLayerof theILcdGXYViewthat satisfyisValidGXYLayer()then calls the protected method chooseGXYLayer( ILcdGXYView,Vector), and returns its value.- Specified by:
chooseGXYLayerin interfaceILcdGXYNewControllerModel
-
chooseGXYLayer
If isChooseFirstValidGXYLayer returns false, this method pops up a Dialog with all theILcdGXYLayers 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
ILcdGXYLayerin 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, thisILcdGXYNewControllerModelput each new createdObjectalso in theILcdGXYLayerselection. If false, it put only the objects in theILcdModelof the chosenILcdGXYLayer. Isfalseby default.
-
isAddNewObjectInLayerSelection
public boolean isAddNewObjectInLayerSelection()- See Also:
-
addObjectInGXYLayer
Adds aObject in theILcdModelof aGXYLayer and updates aGXYView.- Specified by:
addObjectInGXYLayerin interfaceILcdGXYNewControllerModel
-
addUndoableListener
Adds the givenILcdUndoableListenerto the list of registered listeners. The listener now receivesTLcdUndoableEvents from this controller. By for example adding aTLcdUndoManagerto this controller, undo/redo support can be enabled.- Specified by:
addUndoableListenerin interfaceILcdUndoableSource- Parameters:
aListener- The listener to add.- See Also:
-
removeUndoableListener
Removes the givenILcdUndoableListenerfrom the list of registered listeners. The listener no longer receivesTLcdUndoableEvents from this controller. Removing a listener that was never added or already removed, has no effect.- Specified by:
removeUndoableListenerin interfaceILcdUndoableSource- Parameters:
aListener- The listener to remove.- See Also:
-
fireUndoableEvent
Fires the givenTLcdUndoableEventto all listeners registered to this controller.- Parameters:
aEvent- The event to fire to all registered listeners.- See Also:
-