|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.Network
public class Network
| Nested Class Summary | |
|---|---|
(package private) static class |
Network.NetworkSchemaChangeListener
Add to a Schema to make it listen to changes, and update the corresponding Network and Node |
| Field Summary | |
|---|---|
private static java.util.List |
allNetworks
|
private java.awt.Color |
bgColor
|
private boolean |
cyclic
|
static int |
DEFAULT_INDENT
|
private boolean |
deleted
|
private boolean |
directed
|
private java.awt.Color |
fgColor
|
private int |
lblxpos
|
private int |
lblypos
|
private boolean |
maximal
|
private java.lang.String |
name
|
(package private) java.util.Set |
networkChangeListeners
|
(package private) static java.util.Set |
networksListeners
|
(package private) java.util.Map |
nodes
|
static java.lang.String |
NONVIRTUAL_SCHEMA_SEPARATOR
The string to put between any non-virtual schemas in the network name |
private java.awt.Color |
textColor
|
private boolean |
tree
|
private int |
xpos
|
private int |
ypos
|
| Constructor Summary | |
|---|---|
|
Network(Schema[][] paths,
int indent)
Constructs a directed network from the schema paths supplied. |
private |
Network(java.lang.String name,
boolean directed,
boolean maximal,
int indent)
|
|
Network(java.lang.String name,
Schema[][] paths,
boolean directed,
boolean maximal,
int indent)
Constructs a network from the schema paths supplied. |
|
Network(java.lang.String name,
Schema[][] paths,
int indent)
Constructs a directed network from the schema paths supplied. |
| Method Summary | |
|---|---|
private void |
activateNetwork(int indent)
|
boolean |
addNetworkChangeListener(NetworkChangeListener scl)
|
static boolean |
addNetworksListener(NetworksListener nl)
|
boolean |
areRelativesMaximal()
|
boolean |
contains(Node node)
Returns whether or not the network contains the supplied node. |
boolean |
contains(Schema schema)
Returns whether or not the network contains the supplied schema |
boolean |
contains(java.lang.String name)
Returns whether or not the network contains the named schema |
boolean |
deleted()
Return true when the Network class is finished with, after all Schemas have been deleted from it |
(package private) void |
fireNetworkChangeEvent(int type,
java.lang.Object delta)
|
(package private) static void |
fireNetworksEvent(int type,
java.lang.Object delta)
|
java.awt.Point |
getAbsolutePosition()
Same behaviour as getPosition() since Network instances
are not placed relative to other Positionables. |
private static Network[] |
getAllNetworks(int indent)
Returns an array of all networks in the repository. |
Node[] |
getAllNodes()
|
java.awt.Color |
getBackgroundColor()
|
java.awt.Color |
getForegroundColor()
|
java.lang.String |
getLabel()
Get the text used to label this Network. |
java.awt.Point |
getLabelPosition()
|
int |
getLabelXPos()
|
int |
getLabelYPos()
|
Node[] |
getLeafs()
|
java.lang.String |
getName()
|
static Network |
getNetwork(Schema s)
Returns the complete undirected network that contains schema s. |
static java.util.List |
getNetworks(boolean recompute,
int indent)
Return a list that contains all Networks held in the repository. |
static java.util.List |
getNetworks(int indent)
Return a List that contains all Networks held in the repository. |
Node |
getNode(Node node)
Deprecated. |
Node |
getNode(Schema schema)
Returns the network node representing the supplied schema |
Node |
getNode(java.lang.String name)
Returns the network node representing the named schema |
java.awt.Point |
getPosition()
Return the Point that represents the position of this
Positionable in a Panel. |
Positionable |
getPositionedRelativeTo()
Return the Positionable this is relative to. |
java.lang.Object |
getRepObject()
|
Node[] |
getRoots()
|
Schema[] |
getSchemas()
Return all the Schemas in this network. |
java.awt.Color |
getTextColor()
|
int |
getXPos()
|
int |
getYPos()
|
boolean |
isCyclic()
|
boolean |
isDirected()
|
boolean |
isTree()
|
private void |
remove()
Only the Network class should remove itself, when it finds that it no longer contains any Schemas. |
boolean |
removeNetworkChangeListener(NetworkChangeListener scl)
|
static boolean |
removeNetworksListener(NetworksListener nl)
|
void |
setAbsolutePosition(int x,
int y)
Same behaviour as #setPosition() since Network instances
are not placed relative to other Positionables. |
void |
setBackgroundColor(java.awt.Color c)
|
void |
setForegroundColor(java.awt.Color c)
|
void |
setLabel(java.lang.String label)
|
void |
setLabelPosition(int x,
int y)
|
void |
setLabelXPos(int x)
|
void |
setLabelYPos(int y)
|
void |
setPosition(int x,
int y)
|
void |
setTextColor(java.awt.Color c)
|
void |
setXPos(int x)
|
void |
setYPos(int y)
|
private java.lang.String |
suggestName()
|
java.lang.String |
toString()
|
private void |
trawlNetwork(Node ns,
java.util.Set visited)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String name
private boolean directed
private boolean maximal
private boolean cyclic
private boolean tree
private boolean deleted
private int xpos
private int ypos
private int lblxpos
private int lblypos
public static final int DEFAULT_INDENT
public static final java.lang.String NONVIRTUAL_SCHEMA_SEPARATOR
java.util.Map nodes
private static java.util.List allNetworks
private java.awt.Color fgColor
private java.awt.Color bgColor
private java.awt.Color textColor
java.util.Set networkChangeListeners
static java.util.Set networksListeners
| Constructor Detail |
|---|
public Network(Schema[][] paths,
int indent)
throws IntegrityException
IntegrityException
public Network(java.lang.String name,
Schema[][] paths,
int indent)
throws IntegrityException
name - The name to give the network
IntegrityException
public Network(java.lang.String name,
Schema[][] paths,
boolean directed,
boolean maximal,
int indent)
throws IntegrityException
name - The name to give the networkdirected - Shoud the network be directedmaximal - If not directed, should each nodes parents and children
be the empty set or the same as the adjacent set for the node
IntegrityException
private Network(java.lang.String name,
boolean directed,
boolean maximal,
int indent)
| Method Detail |
|---|
public java.lang.String getName()
public boolean isDirected()
public boolean isCyclic()
public boolean isTree()
public boolean areRelativesMaximal()
public boolean contains(java.lang.String name)
name - The name of the schema
public boolean contains(Schema schema)
name - The schema to be tested
public boolean contains(Node node)
node - A node representing the schema to be tested
public Node getNode(java.lang.String name)
name - Name of the schema whose Node is to be returned
public Node getNode(Schema schema)
schema - The schema whose Node is to be returned
public Node getNode(Node node)
public Node[] getAllNodes()
public Schema[] getSchemas()
Schemas in this network.
public Node[] getRoots()
public Node[] getLeafs()
private void activateNetwork(int indent)
public static java.util.List getNetworks(int indent)
public static java.util.List getNetworks(boolean recompute,
int indent)
recompute - If set true, then the set of Networks will be recomputed
from the description of pathways held in the recompository, even if
this has previously been done. This means that there may be duplicates
of the same network being represented by different Network instances.
Thus normally this parameter should be false unless some problem is
suspected where the existing set of Network instances are suspected
not to reflect the contents of the repositoryprivate void remove()
public boolean deleted()
private static Network[] getAllNetworks(int indent)
private java.lang.String suggestName()
public static Network getNetwork(Schema s)
s - The schema to trawl the network fromname - The name to give the new network or null for a default name
private void trawlNetwork(Node ns,
java.util.Set visited)
throws IntegrityException
IntegrityExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getXPos()
getXPos in interface Positionablepublic int getYPos()
getYPos in interface Positionablepublic java.awt.Point getPosition()
PositionablePoint that represents the position of this
Positionable in a Panel. Note that depending on
the implementation of the interface, this might a coordinate
relative to some other positionable
getPosition in interface Positionablepublic Positionable getPositionedRelativeTo()
PositionablePositionable this is relative to. If not relative
to some other Positionable then return null.
getPositionedRelativeTo in interface Positionablepublic java.awt.Point getAbsolutePosition()
getPosition() since Network instances
are not placed relative to other Positionables.
getAbsolutePosition in interface Positionablepublic void setXPos(int x)
setXPos in interface Positionablepublic void setYPos(int y)
setYPos in interface Positionable
public void setPosition(int x,
int y)
setPosition in interface Positionable
public void setAbsolutePosition(int x,
int y)
#setPosition() since Network instances
are not placed relative to other Positionables.
setAbsolutePosition in interface Positionablepublic int getLabelXPos()
getLabelXPos in interface Positionablepublic int getLabelYPos()
getLabelYPos in interface Positionablepublic void setLabelXPos(int x)
setLabelXPos in interface Positionablepublic void setLabelYPos(int y)
setLabelYPos in interface Positionablepublic java.awt.Point getLabelPosition()
getLabelPosition in interface Positionable
public void setLabelPosition(int x,
int y)
setLabelPosition in interface Positionablepublic java.lang.String getLabel()
getName() at least in that any characters that need escaping
for printing are escaped.
getLabel in interface Positionablepublic void setLabel(java.lang.String label)
setLabel in interface Positionablepublic java.lang.Object getRepObject()
getRepObject in interface Positionablepublic java.awt.Color getForegroundColor()
getForegroundColor in interface Positionablepublic void setForegroundColor(java.awt.Color c)
setForegroundColor in interface Positionablepublic java.awt.Color getBackgroundColor()
getBackgroundColor in interface Positionablepublic void setBackgroundColor(java.awt.Color c)
setBackgroundColor in interface Positionablepublic java.awt.Color getTextColor()
getTextColor in interface Positionablepublic void setTextColor(java.awt.Color c)
setTextColor in interface Positionablepublic boolean addNetworkChangeListener(NetworkChangeListener scl)
public boolean removeNetworkChangeListener(NetworkChangeListener scl)
void fireNetworkChangeEvent(int type,
java.lang.Object delta)
public static boolean addNetworksListener(NetworksListener nl)
public static boolean removeNetworksListener(NetworksListener nl)
static void fireNetworksEvent(int type,
java.lang.Object delta)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||