org.grinvin.list.graphs

Class GraphListElement

Implemented Interfaces:
EventListener, GraphBundleListener, GraphNode, HasName, HasURI

public class GraphListElement
extends java.lang.Object
implements GraphBundleListener, HasName, HasURI, GraphNode

Represents the elements of a GraphList.

A graph list element combines a graph bundle and a uniform resource identifier (URI).

Graph list elements cannot be constructed directly but must be created by the graph list element manager to ensure that no two graph list elements exist with the same URI.

See Also:
GraphListElementManager

Method Summary

void
addGraphListElementListener(GraphListElementListener listener)
void
fireGraphChanged()
void
fireInvariantComputed(Invariant invariant)
void
fireNameChanged()
void
fireURIChanged()
GraphBundle
getBundle()
Return the current GraphBundle, or null if the bundle does not exist.
List
getChildren()
String
getDescription()
InvariantValue
getInvariant(Invariant invariant)
Get the requested invariant.
InvariantValue
getInvariantLater(Invariant invariant)
Get the requested invariant.
InvariantValue
getInvariantNow(Invariant invariant)
Get the requested invariant.
String
getName()
Returns the name of this graph, i.e., the internationalized property with key graph.name.
Object
getProperty(String property)
Get the requested property.
URI
getURI()
Get the uri.
boolean
gotGraph()
Check if the bundle contains a graph.
boolean
isNameEditable()
Is the name of this graph user editable?
void
removeGraphListElementListener(GraphListElementListener listener)
void
setName(String name)
Change the name of this graph.
void
setURI(URI uri)
Set the URI of this GraphListElement.
String
toString()

Method Details

addGraphListElementListener

public void addGraphListElementListener(GraphListElementListener listener)

fireGraphChanged

public void fireGraphChanged()

fireInvariantComputed

public void fireInvariantComputed(Invariant invariant)

fireNameChanged

public void fireNameChanged()

fireURIChanged

public void fireURIChanged()

getBundle

public GraphBundle getBundle()
Return the current GraphBundle, or null if the bundle does not exist.
Returns:
The current GraphBundle

getChildren

public List getChildren()
Specified by:
getChildren in interface GraphNode

getDescription

public String getDescription()

getInvariant

public InvariantValue getInvariant(Invariant invariant)
Get the requested invariant.
Parameters:
invariant - the requested invariant

getInvariantLater

public InvariantValue getInvariantLater(Invariant invariant)
Get the requested invariant. Loads the bundle and computes the invariant in the background if not available
Parameters:
invariant - the requested invariant

getInvariantNow

public InvariantValue getInvariantNow(Invariant invariant)
Get the requested invariant. Loads the bundle and computes the invariant asap if not available
Parameters:
invariant - the requested invariant

getName

public String getName()
Returns the name of this graph, i.e., the internationalized property with key graph.name.
Specified by:
getName in interface HasName
getName in interface GraphNode

getProperty

public Object getProperty(String property)
Get the requested property. Waits until the bundle is loaded and the property can be returned
Parameters:
property - the requested property

getURI

public URI getURI()
Get the uri.
Specified by:
getURI in interface HasURI
Returns:
the uri, or null

gotGraph

public boolean gotGraph()
Check if the bundle contains a graph.
Returns:
true if the graph exists, false if not

isNameEditable

public boolean isNameEditable()
Is the name of this graph user editable?
Specified by:
isNameEditable in interface HasName

removeGraphListElementListener

public void removeGraphListElementListener(GraphListElementListener listener)

setName

public void setName(String name)
Change the name of this graph.
Specified by:
setName in interface HasName

setURI

public void setURI(URI uri)
Set the URI of this GraphListElement. Use this to set the URI when the bundle has been saved.
Specified by:
setURI in interface HasURI
Parameters:
uri - the URI

toString

public String toString()