org.grinvin.list

Class GraphListElement

Implemented Interfaces:
EventListener, GraphBundleListener, HasName

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

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.
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.
void
graphBundleChanged(GraphBundle graphbundle)
boolean
isDirty()
boolean
isNameEditable()
Is the name of this graph user editable?
void
removeGraphListElementListener(GraphListElementListener listener)
void
setDirty(boolean dirty)
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

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

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.
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

graphBundleChanged

public void graphBundleChanged(GraphBundle graphbundle)
Specified by:
graphBundleChanged in interface GraphBundleListener

isDirty

public boolean isDirty()

isNameEditable

public boolean isNameEditable()
Is the name of this graph user editable?

removeGraphListElementListener

public void removeGraphListElementListener(GraphListElementListener listener)

setDirty

public void setDirty(boolean dirty)

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.
Parameters:
uri - the URI

toString

public String toString()