public class MergingGraphProvider extends Object implements GraphProvider, VertexListener, EdgeListener, ProviderManager.ProviderListener
Modifier and Type | Field and Description |
---|---|
static GraphProvider |
NULL_PROVIDER |
Constructor and Description |
---|
MergingGraphProvider(ProviderManager providerManager) |
Modifier and Type | Method and Description |
---|---|
void |
addEdgeListener(EdgeListener edgeListener) |
protected void |
addEdgeProvider(EdgeProvider edgeProvider) |
void |
addEdges(Edge... edges) |
Vertex |
addGroup(String label,
String iconKey)
TODO Is this going to work properly?
|
Vertex |
addVertex(int x,
int y)
TODO Is this going to work properly?
|
void |
addVertexListener(VertexListener vertexListener) |
protected void |
addVertexProvider(VertexProvider vertexProvider) |
void |
addVertices(Vertex... vertices) |
void |
clearEdges() |
void |
clearVertices() |
Edge |
connectVertices(VertexRef sourceVertextId,
VertexRef targetVertextId)
TODO Is this going to work properly?
|
boolean |
containsVertexId(String id) |
boolean |
containsVertexId(VertexRef id,
Criteria... criteria) |
boolean |
contributesTo(ContentType type)
Allows the
GraphProvider to define if it
contributes to a certain ContentType . |
boolean |
contributesTo(String namespace)
This boolean returns true if the vertices in this provider are intended
to contribute to or overlay another namespace
|
void |
edgeProviderAdded(EdgeProvider oldProvider,
EdgeProvider newProvider) |
void |
edgeProviderRemoved(EdgeProvider removedProvider) |
void |
edgeSetChanged(EdgeProvider provider) |
void |
edgeSetChanged(EdgeProvider provider,
Collection<? extends Edge> added,
Collection<? extends Edge> updated,
Collection<String> removedEdgeIds) |
protected List<? extends Edge> |
filteredEdges(EdgeProvider edgeProvider,
Criteria[] criteria,
boolean returnAllOnNullFilter) |
protected List<? extends Vertex> |
filteredVertices(VertexProvider vertexProvider,
Criteria[] criteria,
boolean returnAllOnNullFilter) |
protected void |
fireEdgeChanged() |
protected void |
fireVertexChanged() |
protected GraphProvider |
getBaseGraphProvider() |
List<Vertex> |
getChildren(VertexRef group,
Criteria... criteria) |
Criteria |
getDefaultCriteria() |
Edge |
getEdge(EdgeRef reference) |
Edge |
getEdge(String namespace,
String id) |
EdgeRef[] |
getEdgeIdsForVertex(VertexRef vertex)
TODO This will miss edges provided by auxiliary edge providers
|
Map<VertexRef,Set<EdgeRef>> |
getEdgeIdsForVertices(VertexRef... vertices)
TODO This will miss edges provided by auxiliary edge providers
|
String |
getEdgeNamespace()
A string used to identify references belonging to this provider
May only container characters that make for a reasonable java identifier
such as letters digits and underscore (no colons, periods, commans etc.)
|
protected EdgeProvider |
getEdgeProvider(EdgeRef edgeRef) |
protected EdgeProvider |
getEdgeProvider(String namespace) |
List<Edge> |
getEdges(Collection<? extends EdgeRef> references)
Return an immutable list of all edges that match this set of references.
|
List<Edge> |
getEdges(Criteria... criteria)
Return an immutable list of edges that match the criteria.
|
MetaInfo |
getMetaInfo() |
Vertex |
getParent(VertexRef vertex) |
List<Vertex> |
getRootGroup() |
SelectionChangedListener.Selection |
getSelection(List<VertexRef> selectedVertices,
ContentType type)
Converts the provided
selectedVertices to a Selection. |
int |
getSemanticZoomLevel(VertexRef vertex) |
Vertex |
getVertex(String namespace,
String id) |
Vertex |
getVertex(VertexRef reference,
Criteria... criteria) |
String |
getVertexNamespace()
A string used to identify references belonging to this provider
May only contain characters that make for a reasonable Java identifier
such as letters digits and underscore (no colons, periods, commas etc.)
|
protected VertexProvider |
getVertexProvider(String namespace) |
protected VertexProvider |
getVertexProvider(VertexRef vertexRef) |
int |
getVertexTotalCount() |
List<Vertex> |
getVertices(Collection<? extends VertexRef> references,
Criteria... criteria) |
List<Vertex> |
getVertices(Criteria... criteria)
Return an immutable list of vertices that match the criteria.
|
boolean |
groupingSupported()
TODO Is this going to work properly?
|
boolean |
hasChildren(VertexRef group) |
void |
load(String filename) |
void |
refresh() |
void |
removeEdgeListener(EdgeListener edgeListener) |
protected void |
removeEdgeProvider(EdgeProvider edgeProvider) |
void |
removeEdges(EdgeRef... edges) |
void |
removeVertex(VertexRef... vertexId) |
void |
removeVertexListener(VertexListener vertexListener) |
protected void |
removeVertexProvider(VertexProvider vertexProvider) |
void |
resetContainer() |
void |
save() |
protected void |
setBaseGraphProvider(GraphProvider baseGraphProvider) |
boolean |
setParent(VertexRef vertexId,
VertexRef parentId)
This function will always delegate to the base graph provider.
|
void |
vertexProviderAdded(VertexProvider oldProvider,
VertexProvider newProvider) |
void |
vertexProviderRemoved(VertexProvider removedProvider) |
void |
vertexSetChanged(VertexProvider provider) |
void |
vertexSetChanged(VertexProvider provider,
Collection<? extends Vertex> added,
Collection<? extends Vertex> update,
Collection<String> removedVertexIds) |
public static final GraphProvider NULL_PROVIDER
public MergingGraphProvider(ProviderManager providerManager)
public String getVertexNamespace()
VertexProvider
getVertexNamespace
in interface VertexProvider
public String getEdgeNamespace()
EdgeProvider
getEdgeNamespace
in interface EdgeProvider
public boolean contributesTo(String namespace)
VertexProvider
contributesTo
in interface EdgeProvider
contributesTo
in interface VertexProvider
namespace
- the namespace of a providerprotected GraphProvider getBaseGraphProvider()
protected void setBaseGraphProvider(GraphProvider baseGraphProvider)
protected void addVertexProvider(VertexProvider vertexProvider)
protected void removeVertexProvider(VertexProvider vertexProvider)
protected void addEdgeProvider(EdgeProvider edgeProvider)
protected void removeEdgeProvider(EdgeProvider edgeProvider)
protected VertexProvider getVertexProvider(String namespace)
protected VertexProvider getVertexProvider(VertexRef vertexRef)
protected EdgeProvider getEdgeProvider(EdgeRef edgeRef)
protected EdgeProvider getEdgeProvider(String namespace)
public Vertex getVertex(String namespace, String id)
getVertex
in interface VertexProvider
public Vertex getVertex(VertexRef reference, Criteria... criteria)
getVertex
in interface VertexProvider
public int getSemanticZoomLevel(VertexRef vertex)
getSemanticZoomLevel
in interface VertexProvider
public List<Vertex> getVertices(Criteria... criteria)
VertexProvider
getVertices
in interface VertexProvider
protected List<? extends Vertex> filteredVertices(VertexProvider vertexProvider, Criteria[] criteria, boolean returnAllOnNullFilter)
public List<Vertex> getVertices(Collection<? extends VertexRef> references, Criteria... criteria)
getVertices
in interface VertexProvider
public List<Vertex> getRootGroup()
getRootGroup
in interface VertexProvider
public boolean hasChildren(VertexRef group)
hasChildren
in interface VertexProvider
public Vertex getParent(VertexRef vertex)
getParent
in interface VertexProvider
public List<Vertex> getChildren(VertexRef group, Criteria... criteria)
getChildren
in interface VertexProvider
public Edge getEdge(String namespace, String id)
getEdge
in interface EdgeProvider
public Edge getEdge(EdgeRef reference)
getEdge
in interface EdgeProvider
public List<Edge> getEdges(Criteria... criteria)
EdgeProvider
getEdges
in interface EdgeProvider
protected List<? extends Edge> filteredEdges(EdgeProvider edgeProvider, Criteria[] criteria, boolean returnAllOnNullFilter)
public List<Edge> getEdges(Collection<? extends EdgeRef> references)
EdgeProvider
getEdges
in interface EdgeProvider
public void clearEdges()
clearEdges
in interface EdgeProvider
public void addEdges(Edge... edges)
addEdges
in interface GraphProvider
public boolean groupingSupported()
groupingSupported
in interface GraphProvider
public Vertex addGroup(String label, String iconKey)
addGroup
in interface GraphProvider
public Vertex addVertex(int x, int y)
addVertex
in interface GraphProvider
public void addVertices(Vertex... vertices)
addVertices
in interface GraphProvider
public Edge connectVertices(VertexRef sourceVertextId, VertexRef targetVertextId)
connectVertices
in interface GraphProvider
public Criteria getDefaultCriteria()
getDefaultCriteria
in interface GraphProvider
public EdgeRef[] getEdgeIdsForVertex(VertexRef vertex)
getEdgeIdsForVertex
in interface GraphProvider
public Map<VertexRef,Set<EdgeRef>> getEdgeIdsForVertices(VertexRef... vertices)
getEdgeIdsForVertices
in interface GraphProvider
public void load(String filename)
load
in interface GraphProvider
public void refresh()
refresh
in interface GraphProvider
public void removeEdges(EdgeRef... edges)
removeEdges
in interface GraphProvider
public void removeVertex(VertexRef... vertexId)
removeVertex
in interface GraphProvider
public void resetContainer()
resetContainer
in interface GraphProvider
public void save()
save
in interface GraphProvider
public boolean setParent(VertexRef vertexId, VertexRef parentId)
setParent
in interface VertexProvider
public void clearVertices()
clearVertices
in interface VertexProvider
public int getVertexTotalCount()
getVertexTotalCount
in interface VertexProvider
public boolean containsVertexId(String id)
containsVertexId
in interface VertexProvider
public boolean containsVertexId(VertexRef id, Criteria... criteria)
containsVertexId
in interface VertexProvider
protected void fireVertexChanged()
public void vertexSetChanged(VertexProvider provider)
vertexSetChanged
in interface VertexListener
public void vertexSetChanged(VertexProvider provider, Collection<? extends Vertex> added, Collection<? extends Vertex> update, Collection<String> removedVertexIds)
vertexSetChanged
in interface VertexListener
public void addVertexListener(VertexListener vertexListener)
addVertexListener
in interface VertexProvider
public void removeVertexListener(VertexListener vertexListener)
removeVertexListener
in interface VertexProvider
protected void fireEdgeChanged()
public void edgeSetChanged(EdgeProvider provider)
edgeSetChanged
in interface EdgeListener
public void edgeSetChanged(EdgeProvider provider, Collection<? extends Edge> added, Collection<? extends Edge> updated, Collection<String> removedEdgeIds)
edgeSetChanged
in interface EdgeListener
public void addEdgeListener(EdgeListener edgeListener)
addEdgeListener
in interface EdgeProvider
public void removeEdgeListener(EdgeListener edgeListener)
removeEdgeListener
in interface EdgeProvider
public SelectionChangedListener.Selection getSelection(List<VertexRef> selectedVertices, ContentType type)
SelectionAware
selectedVertices
to a Selection.
The provided type
represents the according browser table.
This method is only invoked if SelectionAware.contributesTo(ContentType)
returns to for the provided type
getSelection
in interface SelectionAware
selectedVertices
- The vertices currently selected in the Topology UI.type
- The type to filter for. Represents the according browser table.SelectionChangedListener.Selection
public boolean contributesTo(ContentType type)
SelectionAware
GraphProvider
to define if it
contributes to a certain ContentType
.
If false
it is not shown in the browsers tab at allcontributesTo
in interface SelectionAware
type
- The type to check if this
contribute tothis
contributes to the provided type
public void edgeProviderAdded(EdgeProvider oldProvider, EdgeProvider newProvider)
edgeProviderAdded
in interface ProviderManager.ProviderListener
public void edgeProviderRemoved(EdgeProvider removedProvider)
edgeProviderRemoved
in interface ProviderManager.ProviderListener
public void vertexProviderAdded(VertexProvider oldProvider, VertexProvider newProvider)
vertexProviderAdded
in interface ProviderManager.ProviderListener
public void vertexProviderRemoved(VertexProvider removedProvider)
vertexProviderRemoved
in interface ProviderManager.ProviderListener
public MetaInfo getMetaInfo()
getMetaInfo
in interface GraphProvider
Copyright © 2017. All rights reserved.