pl.edu.agh.cast.schema.model.visual
Class VisualSchemaConnection

java.lang.Object
  extended by pl.edu.agh.cast.data.model.property.PropertyContainer
      extended by pl.edu.agh.cast.data.model.AbstractElement
          extended by pl.edu.agh.cast.data.model.visual.VisualElement<ISchemaConnection>
              extended by pl.edu.agh.cast.schema.model.visual.VisualSchemaConnection
All Implemented Interfaces:
Serializable, Observer, IDisposable, IReplicable, IValidatable, Identifiable, IElement, IPropertyChangeProvider, IPropertyContainer, IVisualElement<ISchemaConnection>, IVisualSchemaConnection, IVisualSchemaElement<ISchemaConnection>

public class VisualSchemaConnection
extends VisualElement<ISchemaConnection>
implements IVisualSchemaConnection

The default implementation of IVisualSchemaConnection.

Author:
AGH CAST Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pl.edu.agh.cast.schema.model.visual.IVisualSchemaConnection
IVisualSchemaConnection.Properties
 
Field Summary
 
Fields inherited from class pl.edu.agh.cast.data.model.visual.VisualElement
presentationElement
 
Fields inherited from interface pl.edu.agh.cast.schema.model.visual.IVisualSchemaConnection
BENDPOINTS_EVENT, TYPE
 
Fields inherited from interface pl.edu.agh.cast.data.model.visual.IVisualElement
DEFAULT_VISUAL_LABEL_ID
 
Constructor Summary
  VisualSchemaConnection()
          Default constructor.
  VisualSchemaConnection(IVisualSchemaDataSet dataSet, ISchemaConnection elementReference)
          The public constructor which wraps the schema connection.
  VisualSchemaConnection(IVisualSchemaDataSet dataSet, IVisualSchemaNode visualSourceNode, IVisualSchemaNode visualTargetNode, ISchemaConnection connection)
          Constructor for creating new visual connection associated to given connection.
protected VisualSchemaConnection(IVisualSchemaDataSet dataSet, Type type, ISchemaConnection elementReference)
          The constructor for subclasses which wraps the schema connection.
protected VisualSchemaConnection(Type type)
           
 
Method Summary
 List<SchemaConnectionBendpoint> getBendpoints()
          Returns list of bend points.
 boolean isDirected()
          Indicates if the connection is directed, i.e.
 VisualSchemaConnection replicate()
          Returns a replicated instance of this instance.
 VisualSchemaConnection replicateTo(Object replica)
          Replicates this instance state to given replica object.
 void setBendpoints(List<SchemaConnectionBendpoint> bendpoints)
          Sets list of bend points.
 
Methods inherited from class pl.edu.agh.cast.data.model.visual.VisualElement
addPropertyChangeListener, checkIfValid, checkIfValidVisualElement, firePropertyChange, getPresentationElement, getPropertiesMarkedAsLabel, getVisualLabel, markPropertyAsLabel, removePropertyChangeListener, setPresentationElement
 
Methods inherited from class pl.edu.agh.cast.data.model.AbstractElement
afterSetMetaPropertyManager, canReplicateTo, equals, getDataSet, getDescString, getId, getType, hashCode, isValid, setDataSet, setId, setType, toString
 
Methods inherited from class pl.edu.agh.cast.data.model.property.PropertyContainer
addProperty, createProperty, dispose, getCustomProperties, getMetaPropertyManager, getPermanentProperties, getProperties, getProperty, getTransientProperties, initializeProperties, matches, removeProperty, setMetaPropertyManager, setProperty, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pl.edu.agh.cast.data.model.visual.IVisualElement
getPresentationElement, getPropertiesMarkedAsLabel, getVisualLabel, markPropertyAsLabel, setPresentationElement
 
Methods inherited from interface pl.edu.agh.cast.data.model.IElement
getDataSet
 
Methods inherited from interface pl.edu.agh.cast.data.model.Identifiable
getId, getType
 
Methods inherited from interface pl.edu.agh.cast.data.model.property.IPropertyContainer
addProperty, getCustomProperties, getMetaPropertyManager, getPermanentProperties, getProperties, getProperty, getTransientProperties, matches, removeProperty, setProperty
 
Methods inherited from interface java.util.Observer
update
 
Methods inherited from interface pl.edu.agh.cast.common.IValidatable
isValid
 
Methods inherited from interface pl.edu.agh.cast.common.IDisposable
dispose
 
Methods inherited from interface pl.edu.agh.cast.data.model.property.IPropertyChangeProvider
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

VisualSchemaConnection

public VisualSchemaConnection()
Default constructor.


VisualSchemaConnection

protected VisualSchemaConnection(Type type)

VisualSchemaConnection

protected VisualSchemaConnection(IVisualSchemaDataSet dataSet,
                                 Type type,
                                 ISchemaConnection elementReference)
The constructor for subclasses which wraps the schema connection.

Parameters:
dataSet - The data set of this connection.
type - The type of this connection.
elementReference - The referenced element of presentation model.

VisualSchemaConnection

public VisualSchemaConnection(IVisualSchemaDataSet dataSet,
                              IVisualSchemaNode visualSourceNode,
                              IVisualSchemaNode visualTargetNode,
                              ISchemaConnection connection)
Constructor for creating new visual connection associated to given connection.

Parameters:
dataSet - data set which visual connection belongs to
visualSourceNode - source node of this connection
visualTargetNode - target node of this connection
connection - model connection which is visualized by this object

VisualSchemaConnection

public VisualSchemaConnection(IVisualSchemaDataSet dataSet,
                              ISchemaConnection elementReference)
The public constructor which wraps the schema connection.

Parameters:
dataSet - The data set of this connection.
elementReference - The referenced element of presentation model.
Method Detail

isDirected

public boolean isDirected()
Indicates if the connection is directed, i.e. it just binds a pair of nodes or the order of nodes is significant. The general semantics of the connection says that there should be only one connection (in given direction) of given type between two nodes. Undirected connection may be perceived as two connections pointing in both directions.

Specified by:
isDirected in interface IVisualSchemaConnection
Returns:
True if the order of nodes is significant.
See Also:
IVisualSchemaConnection.isDirected()

getBendpoints

public List<SchemaConnectionBendpoint> getBendpoints()
Returns list of bend points.

Specified by:
getBendpoints in interface IVisualSchemaConnection
Returns:
list of bend points
See Also:
pl.edu.agh.cast.schema.model.presentation.ISchemaConnection#getBendpoints()

setBendpoints

public void setBendpoints(List<SchemaConnectionBendpoint> bendpoints)
Sets list of bend points.

Specified by:
setBendpoints in interface IVisualSchemaConnection
Parameters:
bendpoints - list of bend points
See Also:
pl.edu.agh.cast.schema.model.presentation.ISchemaConnection#setBendpoints(java.util.List)

replicateTo

public VisualSchemaConnection replicateTo(Object replica)
                                   throws IllegalArgumentException,
                                          ReplicationException
Replicates this instance state to given replica object. The replica should be an instance of replicated instance's class (same class or subclass).

Replicates element type and ID.

Replicates the direction flag, source and target nodes are null empty.

Specified by:
replicateTo in interface IReplicable
Overrides:
replicateTo in class VisualElement<ISchemaConnection>
Parameters:
replica - the object to replicate to
Returns:
the replica object (the same instance as given)
Throws:
IllegalArgumentException - if given object is null or of invalid type
ReplicationException - if replication fails
See Also:
VisualElement.replicateTo(java.lang.Object)

replicate

public VisualSchemaConnection replicate()
                                 throws ReplicationException
Returns a replicated instance of this instance.

Specified by:
replicate in interface IReplicable
Overrides:
replicate in class AbstractElement
Returns:
replicated instance
Throws:
ReplicationException - if replication fails
See Also:
IReplicable.replicate()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.