public class NodeManager extends Object implements DataSetChangeListener, IDARENodeManager
Constructor and Description |
---|
NodeManager(org.cytoscape.model.CyNetworkManager cyNetMgr,
ActiveNodeManager anm) |
Modifier and Type | Method and Description |
---|---|
void |
addNodeChangeListener(NodeChangedListener listener)
Add a listener that listens to changes in nodes in this manager.
|
void |
datasetChanged(DataSetChangedEvent e)
Inform that there was a change in the
DataSet s |
void |
datasetsChanged(DataSetsChangedEvent e)
Inform that a Collection of
DataSet s changed. |
void |
generateLayoutsForNodes(Set<DataSet> datasets,
ImageNodeLayout layout)
Generate Layouts for All nodes in the
DataSet s present in the DataSetLayoutInfoBundle s provided. |
void |
generateLayoutsForNodes(Set<DataSet> datasets,
ImageNodeLayout layout,
org.cytoscape.work.TaskMonitor monitor)
Generate Layouts for All nodes in the
DataSet s present in the DataSetLayoutInfoBundle s provided. |
Collection<String> |
getActiveIDs()
Get a Collection of IDs for which layouts exist and which are active.
|
Collection<String> |
getLayoutedIDs()
Get a Collection of IDs for which layouts exist.
|
ImageNodeLayout |
getLayoutForNode(String id)
Get the layout for a specific id
|
ImageNodeModel |
getNode(String ID)
Get the Node corresponding to the given ID
|
Collection<String> |
getNodesForLayout(ImageNodeLayout Layout)
Create a Collection of IDs that are associated with a specific Layout.
|
Collection<String> |
getNodesWithData()
Get all nodes, that have associated data.
|
void |
handleEvent(org.cytoscape.session.events.SessionAboutToBeSavedEvent arg0,
IDAREImageNodeApp app)
Handle a
SessionAboutToBeSavedEvent . |
void |
handleEvent(org.cytoscape.session.events.SessionLoadedEvent arg0,
IDAREImageNodeApp app)
Restore the data of this nodemanager.
|
boolean |
isNodeActive(String id)
Check whether the node with the given ID is layouted and needs an image.
|
boolean |
isNodeLayouted(String id)
Check whether a tge node with the given ID is layouted
|
void |
readNodeLayouts(File LayoutFile,
IDAREImageNodeApp app)
Read Layout data saved in a given File to restore old nodemanager data.
|
void |
removeNodeChangeListener(NodeChangedListener listener)
Remove a listener that had listened to changes in nodes in this manager.
|
void |
reset()
Reset this NodeManager clearing fields
|
void |
setDataSetManager(DataSetManager dsm)
Set the DatasetManager used by this
NodeManager . |
void |
update(DataSet ds,
boolean added)
Update the Manager/Nodes with the new DataSet, either adding it or removing it form the nodes.
|
void |
updateActiveNodes(Collection<String> updatedIDs) |
void |
updateNetworkNodes()
Update the set of NetworkNode IDs.
|
void |
writeNodeLayouts(File LayoutFile,
IDAREImageNodeApp app)
Write a structure that can be read again by a nodemanager to restore the current state of the manager.
|
public NodeManager(org.cytoscape.model.CyNetworkManager cyNetMgr, ActiveNodeManager anm)
public void addNodeChangeListener(NodeChangedListener listener)
listener
- the NodeChangeListener
to addpublic void removeNodeChangeListener(NodeChangedListener listener)
listener
- the NodeChangeListener
to removepublic void setDataSetManager(DataSetManager dsm)
NodeManager
.
This is mainly to allow nodelayouts to listen to changes in Datasets.dsm
- the DataSetManager
to assignpublic void reset()
public void updateActiveNodes(Collection<String> updatedIDs)
public void updateNetworkNodes()
IDARENodeManager
updateNetworkNodes
in interface IDARENodeManager
public void datasetChanged(DataSetChangedEvent e)
DataSetChangeListener
DataSet
sdatasetChanged
in interface DataSetChangeListener
e
- the DataSetChangedEvent
to processpublic void datasetsChanged(DataSetsChangedEvent e)
DataSetChangeListener
DataSet
s changed.datasetsChanged
in interface DataSetChangeListener
e
- The DataSetsChangedEvent
to processpublic void update(DataSet ds, boolean added)
ds
- the dataset to updateadded
- whether the dataset was addedpublic ImageNodeModel getNode(String ID)
ID
- The ID of the nodenull
, if the ID is not linked to a known node.public Collection<String> getNodesWithData()
public void generateLayoutsForNodes(Set<DataSet> datasets, ImageNodeLayout layout, org.cytoscape.work.TaskMonitor monitor) throws TooManyItemsException, ContainerUnplaceableExcpetion, DimensionMismatchException, WrongDatasetTypeException
DataSet
s present in the DataSetLayoutInfoBundle
s provided.
This version is to be used if the created nodes are created by a Task
.datasets
- The datasets to create nodes forlayout
- the layout to use for the nodesmonitor
- The TaskMonitor that keeps track of progress.TooManyItemsException
- if there are too many itemsContainerUnplaceableExcpetion
- if a container cannot be placedDimensionMismatchException
- if the dimensions dont fit.WrongDatasetTypeException
- if a dataset cannot be layout out with the layout.public void generateLayoutsForNodes(Set<DataSet> datasets, ImageNodeLayout layout) throws TooManyItemsException, ContainerUnplaceableExcpetion, DimensionMismatchException, WrongDatasetTypeException
DataSet
s present in the DataSetLayoutInfoBundle
s provided.datasets
- the datasets t generate layouts forlayout
- the layout to use for the nodesTooManyItemsException
- if too many items were in the datasetsContainerUnplaceableExcpetion
- if a container could not be placedDimensionMismatchException
- if dimensions could not fitWrongDatasetTypeException
- if a dataset could not be layout out with the selected type of layoutpublic boolean isNodeLayouted(String id)
id
- The node id to checkpublic boolean isNodeActive(String id)
id
- The node ID to checkpublic ImageNodeLayout getLayoutForNode(String id)
id
- The node ID to get the layout forpublic Collection<String> getLayoutedIDs()
Collection
of Strings containing all IDs with an associated Layoutpublic Collection<String> getActiveIDs()
Collection
of Strings containing all IDs with an associated Layoutpublic void handleEvent(org.cytoscape.session.events.SessionAboutToBeSavedEvent arg0, IDAREImageNodeApp app)
SessionAboutToBeSavedEvent
. Since the order in which the event is handles by the different components of the app is important,
This Object does not itself implement the listener, but requires another function to call the handling operation.arg0
- the event to handleapp
- the IDAREImageNodeApp
to use for referencepublic void handleEvent(org.cytoscape.session.events.SessionLoadedEvent arg0, IDAREImageNodeApp app)
DataSetManager
and NodeManager
restoration, this cannot simply be achieved
by implementing the SessionLoadedListener
interfacearg0
- the event to handleapp
- the IDAREImageNodeApp
for referencepublic Collection<String> getNodesForLayout(ImageNodeLayout Layout)
Layout
- the layout to get nodes forImageNodeLayout
public void writeNodeLayouts(File LayoutFile, IDAREImageNodeApp app) throws IOException
LayoutFile
- the File to write the lyouts toapp
- the IDAREImageNodeApp
as referenceIOException
- if something goes wrong during IOpublic void readNodeLayouts(File LayoutFile, IDAREImageNodeApp app) throws IOException
LayoutFile
- The File
to read the layouts fromapp
- the IDAREImageNodeApp
as referenceIOException
- if something goes wrong during IOCopyright © 2018. All rights reserved.