|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.data.model.property.PropertyContainer
pl.edu.agh.cast.data.model.AbstractElement
pl.edu.agh.cast.data.model.presentation.PresentationElement<IElement>
pl.edu.agh.cast.schema.model.presentation.SchemaConnection
public class SchemaConnection
Default implementation of ISchemaConnection
.
ISchemaConnection
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from interface pl.edu.agh.cast.data.model.presentation.IPresentationElement |
---|
IPresentationElement.Properties, IPresentationElement.PropertyCategory |
Field Summary |
---|
Fields inherited from interface pl.edu.agh.cast.schema.model.presentation.ISchemaConnection |
---|
TYPE |
Fields inherited from interface pl.edu.agh.cast.data.model.presentation.IPresentationElement |
---|
ATTRIBUTE_CHANGE_EVENT |
Constructor Summary | |
---|---|
protected |
SchemaConnection()
Default constructor. |
|
SchemaConnection(ISchemaDataSet dataSet,
Type derivedType,
boolean directed)
Constructor for creating new schema connection without setting ends of it. |
|
SchemaConnection(ISchemaDataSet dataSet,
Type derivedType,
ISchemaNode source,
ISchemaNode target)
Constructor for creating new indirected schema connection associated with given schema nodes. |
|
SchemaConnection(ISchemaDataSet dataSet,
Type derivedType,
ISchemaNode source,
ISchemaNode target,
boolean directed)
Constructor for creating new schema connection associated with given schema nodes. |
|
SchemaConnection(ISchemaDataSet dataSet,
UUID id,
ISchemaNode source,
ISchemaNode target,
boolean directed,
Collection<? extends IElement> originalElements)
The constructor for schema connections created manually. |
protected |
SchemaConnection(Type type)
|
Method Summary | |
---|---|
protected boolean |
checkIfValid()
Checks if the element is valid. |
protected IVisualSchemaConnection |
createVisualElement()
Creates a new visual element to be associated with this presentation element. |
protected String |
getDescString()
Returns a string with short description of element. |
ISchemaNode |
getSourceNode()
Gets source node. |
ISchemaNode |
getTargetNode()
Gets target node. |
Integer |
getWeight()
A problem dependent weight. |
boolean |
isBetween(ISchemaNode node1,
ISchemaNode node2)
Checks if this connection is between two given nodes. |
Boolean |
isDirected()
Indicates if a connections is directed or not. |
SchemaConnection |
replicate()
Returns a replicated instance of this instance. |
SchemaConnection |
replicateTo(Object replica)
Replicates this instance state to given replica object. |
void |
setDirected(Boolean directed)
|
void |
setSourceNode(ISchemaNode node)
Sets source node. |
void |
setTargetNode(ISchemaNode node)
Sets target node. |
Methods inherited from class pl.edu.agh.cast.data.model.presentation.PresentationElement |
---|
addPropertyChangeListener, firePropertyChange, getDerivedType, getLabel, getOriginalElements, getVisualElement, hasAssociatedVisualElement, removePropertyChangeListener, setDerivedType, setLabel, setOriginalElements, setSuppressAllEvents, setVisualElement |
Methods inherited from class pl.edu.agh.cast.data.model.AbstractElement |
---|
afterSetMetaPropertyManager, canReplicateTo, equals, getDataSet, 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.presentation.IPresentationElement |
---|
getDerivedType, getLabel, getOriginalElements, getVisualElement, hasAssociatedVisualElement, setDerivedType, setLabel, setOriginalElements, setSuppressAllEvents, setVisualElement |
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 |
---|
protected SchemaConnection()
Usage of this constructor is discouraged, since it does not provide any integrity control. If, however, this
constructor is used, the AbstractElement.isValid()
method should be called in order to check the integrity.
protected SchemaConnection(Type type)
public SchemaConnection(ISchemaDataSet dataSet, UUID id, ISchemaNode source, ISchemaNode target, boolean directed, Collection<? extends IElement> originalElements)
dataSet
- data set which a new connections belongs toid
- the ID of the elementsource
- source nodetarget
- target nodedirected
- a flag which indicates if connection is directedoriginalElements
- a reference list to represented domain model elements - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
public SchemaConnection(ISchemaDataSet dataSet, Type derivedType, ISchemaNode source, ISchemaNode target, boolean directed)
dataSet
- the data set this connection belongs toderivedType
- derived typesource
- source nodetarget
- target nodedirected
- flag which indicates if connections is directed or notpublic SchemaConnection(ISchemaDataSet dataSet, Type derivedType, ISchemaNode source, ISchemaNode target)
dataSet
- the data set this connection belongs toderivedType
- derived typesource
- source nodetarget
- target nodepublic SchemaConnection(ISchemaDataSet dataSet, Type derivedType, boolean directed)
dataSet
- data set which a new connections belongs toderivedType
- derived typedirected
- flag which indicates if connections is directed or notMethod Detail |
---|
protected boolean checkIfValid()
This method is called by the AbstractElement.isValid()
method. By default it always returns true
, however
it can be overridden in order to define new validation rules. In such case the implementation from base class
should be called inside the overridden method in order to preserve data consistency.
checkIfValid
in class PresentationElement<IElement>
true
if the element is valid, false
otherwiseAbstractElement.checkIfValid()
public ISchemaNode getSourceNode()
getSourceNode
in interface ISchemaConnection
ISchemaConnection.getSourceNode()
public ISchemaNode getTargetNode()
getTargetNode
in interface ISchemaConnection
ISchemaConnection.getTargetNode()
public void setSourceNode(ISchemaNode node)
setSourceNode
in interface ISchemaConnection
node
- source node#setSourceNode(pl.edu.agh.cast.schema.model.presentation.ISchemaNode)
public void setTargetNode(ISchemaNode node)
setTargetNode
in interface ISchemaConnection
node
- target node#setTargetNode(pl.edu.agh.cast.schema.model.presentation.ISchemaNode)
public Boolean isDirected()
isDirected
in interface ISchemaConnection
ISchemaConnection.isDirected()
public void setDirected(Boolean directed)
public Integer getWeight()
getWeight
in interface ISchemaConnection
ISchemaConnection.getWeight()
protected String getDescString()
AbstractElement.toString()
and may be
overridden in order to customize its results.
getDescString
in class AbstractElement
AbstractElement.getDescString()
public boolean isBetween(ISchemaNode node1, ISchemaNode node2)
isBetween
in interface ISchemaConnection
node1
- first nodenode2
- second node
true
if this connection group is between two given nodes#isBetween(pl.edu.agh.cast.schema.model.presentation.ISchemaNode,
pl.edu.agh.cast.schema.model.presentation.ISchemaNode)
protected IVisualSchemaConnection createVisualElement()
This method should be implemented in each concrete subclass of PresentationElement
.
createVisualElement
in class PresentationElement<IElement>
PresentationElement.createVisualElement()
public SchemaConnection replicateTo(Object replica) throws IllegalArgumentException, ReplicationException
Replicates element type and ID.
Replicates element derived type, label and original element list.
Replicates the direction flag, source and target nodes are null empty.
replicateTo
in interface IReplicable
replicateTo
in class PresentationElement<IElement>
replica
- the object to replicate to
IllegalArgumentException
- if given object is null or of invalid type
ReplicationException
- if replication failsPresentationElement.replicateTo(java.lang.Object)
public SchemaConnection replicate() throws ReplicationException
replicate
in interface IReplicable
replicate
in class AbstractElement
ReplicationException
- if replication failsIReplicable.replicate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |