|
||||||||||
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<T>
T
- type of referenced (presented) elementspublic abstract class PresentationElement<T extends IElement>
PresentationElement is a base class for elements of presentation models such as schema nodes or time-lines.
Nested 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.data.model.presentation.IPresentationElement |
---|
ATTRIBUTE_CHANGE_EVENT, TYPE |
Constructor Summary | |
---|---|
protected |
PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet,
Type type)
The constructor for presentation elements created manually. |
protected |
PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet,
Type type,
IReferenceList<T> references)
The constructor for presentation elements created manually. |
protected |
PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet,
Type type,
Type derivedType)
The constructor for presentation elements created manually. |
protected |
PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet,
Type type,
UUID id)
The constructor for presentation elements created manually. |
protected |
PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet,
Type type,
UUID id,
IReferenceList<T> references)
The constructor for presentation elements created manually. |
protected |
PresentationElement(Type type)
|
Method Summary | ||
---|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to the object. |
|
protected boolean |
checkIfValid()
Checks if the element is valid. |
|
protected abstract IVisualElement |
createVisualElement()
Creates a new visual element to be associated with this presentation element. |
|
protected void |
firePropertyChange(String property,
Object oldValue,
Object newValue)
Fires the property change event. |
|
Type |
getDerivedType()
The derived type of the element is based on the type of the element(s) from the domain model wrapped by this presentation element. |
|
String |
getLabel()
Label getter. |
|
List<? extends T> |
getOriginalElements()
Returns the original elements which are presented by this presentation element. |
|
|
getVisualElement()
Returns the visual element associated with this presentation element. |
|
boolean |
hasAssociatedVisualElement()
Checks if any visual element is associated with this presentation element. |
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener to the object. |
|
PresentationElement<T> |
replicateTo(Object replica)
Replicates this instance state to given replica object. |
|
void |
setDerivedType(Type derivedType)
The derived type setter may be invoked only if there is no domain model element, given presentation element is based on (i.e. |
|
void |
setLabel(String label)
Label setter. |
|
void |
setOriginalElements(List<? extends T> elements)
Sets the original elements which are presented by this presentation elements. |
|
void |
setSuppressAllEvents(boolean flag)
Sets suppress all events flag. |
|
void |
setVisualElement(IVisualElement visualElement)
Sets the visual element associated with this presentation element. |
Methods inherited from class pl.edu.agh.cast.data.model.AbstractElement |
---|
afterSetMetaPropertyManager, canReplicateTo, equals, getDataSet, getDescString, getId, getType, hashCode, isValid, replicate, 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.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.common.IReplicable |
---|
replicate |
Constructor Detail |
---|
protected PresentationElement(Type type)
protected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type)
dataSet
- the data set given element belongs totype
- the type of the elementprotected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type, Type derivedType)
dataSet
- the data set given element belongs totype
- the type of the elementderivedType
- the type of derived element (for example phone call, bank transfer, etc.); if null
than
derived type is also set to to null
- no exception is thrownprotected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type, UUID id)
dataSet
- the data set given element belongs totype
- the type of the elementid
- the ID of the elementprotected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type, IReferenceList<T> references)
dataSet
- the data set given element belongs totype
- the type of the elementoriginalElements
- the list of references to represented domain model elements - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
protected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type, UUID id, IReferenceList<T> references)
dataSet
- the data set given element belongs totype
- the type of the elementid
- the ID of the elementoriginalElements
- the list of originalElements to represented domain model elements - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
Method 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 AbstractElement
true
if the element is valid, false
otherwiseAbstractElement.checkIfValid()
public final void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface IPropertyChangeProvider
listener
- property change listener#addPropertyChangeListener(java.beans.PropertyChangeListener)
public final void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface IPropertyChangeProvider
listener
- property change listener#removePropertyChangeListener(java.beans.PropertyChangeListener)
protected final void firePropertyChange(String property, Object oldValue, Object newValue)
property
- the name of the propertyoldValue
- the old value of the propertynewValue
- the new value of the propertyPropertyChangeProviderHelper.firePropertyChange(java.lang.String,
java.lang.Object, java.lang.Object)
public void setSuppressAllEvents(boolean flag)
true
all events will be ignored.
setSuppressAllEvents
in interface IPresentationElement<T extends IElement>
flag
- suppress all events flagIPresentationDataSet.setSuppressAllEvents(boolean)
public String getLabel()
getLabel
in interface IPresentationElement<T extends IElement>
IPresentationElement.getLabel()
public void setLabel(String label)
setLabel
in interface IPresentationElement<T extends IElement>
label
- The label to set.IPresentationElement.setLabel(java.lang.String)
public Type getDerivedType()
getDerivedType
in interface IPresentationElement<T extends IElement>
IPresentationElement.getDerivedType()
public void setDerivedType(Type derivedType)
setDerivedType
in interface IPresentationElement<T extends IElement>
derivedType
- The type to set.IPresentationElement.setDerivedType(pl.edu.agh.cast.data.model.Type)
public List<? extends T> getOriginalElements()
getOriginalElements
in interface IPresentationElement<T extends IElement>
IPresentationElement.getOriginalElements()
public void setOriginalElements(List<? extends T> elements)
setOriginalElements
in interface IPresentationElement<T extends IElement>
elements
- a list of original elements presented by this presentation elementIPresentationElement.setOriginalElements(java.util.List)
public <V extends IVisualElement<? extends IPresentationElement<T>>> V getVisualElement()
getVisualElement
in interface IPresentationElement<T extends IElement>
V
- the type of expected visual element
null
IPresentationElement.getVisualElement()
public void setVisualElement(IVisualElement visualElement)
setVisualElement
in interface IPresentationElement<T extends IElement>
visualElement
- the associated visual element (null
value is allowed)#setVisualElement(pl.edu.agh.cast.data.model.visual.IVisualElement)
protected abstract IVisualElement createVisualElement()
This method should be implemented in each concrete subclass of PresentationElement
.
public final boolean hasAssociatedVisualElement()
hasAssociatedVisualElement
in interface IPresentationElement<T extends IElement>
true
if an associated visual element is presentIPresentationElement.hasAssociatedVisualElement()
public PresentationElement<T> replicateTo(Object replica) throws IllegalArgumentException, ReplicationException
Replicates element type and ID.
Replicates element derived type, label and original element list.
replicateTo
in interface IReplicable
replicateTo
in class AbstractElement
replica
- the object to replicate to
IllegalArgumentException
- if given object is null or of invalid type
ReplicationException
- if replication failsAbstractElement.replicateTo(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |