public class IlvMapDataSourceModel extends DefaultTreeModel implements IlvPersistentObject
IlvMapDataSourceModel
is a tree model
used to display data sources in a tree. A data source model
can be attached to a IlvManager
through a IlvMapDataSourceProperty
in order to be saved in an .ivl
file.
The following code retrieves the data source model from an IlvManager
and inserts a data source.
IlvMapDataSourceModel model = IlvMapDataSourceProperty.GetMapDataSourceModel(manager); IlvMapDataSource reader = new IlvShapeDataSource("shapeFile.shp", true); model.insert(reader);
asksAllowsChildren, listenerList, root
Constructor and Description |
---|
IlvMapDataSourceModel()
Constructs an empty
IlvMapDataSourceModel . |
IlvMapDataSourceModel(IlvInputStream stream)
Reads the model from an
IlvInputStream . |
IlvMapDataSourceModel(TreeNode root)
Constructs an
IlvMapDataSourceModel with a root. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the nodes of this model.
|
IlvMapDataSource |
getDataSource(String name)
Finds a data source by its name.
|
IlvMapDataSource[] |
getDataSources()
Returns all the data sources known by this
IlvMapDataSourceModel . |
Enumeration<?> |
getEnumeration()
Returns an enumeration of the nodes of this model.
|
IlvManager |
getManager()
Retrieves the manager.
|
void |
insert(IlvMapDataSource source)
Inserts a data source in this model.
|
void |
remove(IlvMapDataSource source)
Removes a datasource from its parent.
|
void |
setManager(IlvManager manager)
Sets the manager.
|
void |
start()
Starts all the data sources present in this model.
|
void |
write(IlvOutputStream stream)
Writes this model into an
IlvOutputStream . |
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
public IlvMapDataSourceModel(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The stream to read from.IlvReadFileException
public IlvMapDataSourceModel()
IlvMapDataSourceModel
.public IlvMapDataSourceModel(TreeNode root)
IlvMapDataSourceModel
with a root.root
- The root.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
stream
- The stream to write to.IOException
public void setManager(IlvManager manager)
manager
- The manager.public IlvManager getManager()
public Enumeration<?> getEnumeration()
getRoot().preorderEnumeration();
public void clear()
public void start()
public void insert(IlvMapDataSource source)
source
- The data source to insert.public void remove(IlvMapDataSource source)
source
- The data source to remove.public IlvMapDataSource getDataSource(String name)
name
- Name of the data source to find.public IlvMapDataSource[] getDataSources()
IlvMapDataSourceModel
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.