pl.edu.agh.cast.data.model.visual
Interface IVisualElement<M extends IPresentationElement<? extends IElement>>

Type Parameters:
M - type of wrapped presentation element
All Superinterfaces:
Identifiable, IDisposable, IElement, IPropertyChangeProvider, IPropertyContainer, IReplicable, IValidatable, Observer, Serializable
All Known Subinterfaces:
IVisualSchemaConnection, IVisualSchemaElement<T>, IVisualSchemaNode
All Known Implementing Classes:
VisualElement, VisualSchemaConnection, VisualSchemaNode

public interface IVisualElement<M extends IPresentationElement<? extends IElement>>
extends IElement, IPropertyChangeProvider

An interface which describes an element from visual model, for more detail see IVisualDataSet. Each visual element describes exactly one element from presentation model.

Author:
AGH CAST Team
See Also:
IVisualDataSet, IPresentationElement

Nested Class Summary
static class IVisualElement.Properties
          Enumeration of property name constants.
 
Field Summary
static String DEFAULT_VISUAL_LABEL_ID
          Property id which is default visual label.
static Type TYPE
          The type of IVisualElement.
 
Method Summary
 M getPresentationElement()
          Gets element from presentation model which is described by this visual element.
 Collection<Property<? extends MetaProperty>> getPropertiesMarkedAsLabel()
          Gets collection of properties marked as label (including properties of presentation, visual and original elements).
 String getVisualLabel()
          Gets visual label which is created from all properties returned by IVisualDataSet.getPropertiesMarkedAsLabel(Type).
 void markPropertyAsLabel(PresentationPropertyDescriptor desc, boolean flag)
          Marks given property as label.
 void setPresentationElement(M pe)
          Sets the element from presentation model which is described by this visual element.
 
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, replicateTo
 
Methods inherited from interface pl.edu.agh.cast.data.model.property.IPropertyChangeProvider
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

TYPE

static final Type TYPE
The type of IVisualElement.


DEFAULT_VISUAL_LABEL_ID

static final String DEFAULT_VISUAL_LABEL_ID
Property id which is default visual label.

See Also:
Constant Field Values
Method Detail

getPresentationElement

@PropertyGetter(name="PRESENTATION_ELEMENT",
                type=REFERENCE,
                matchable=true,
                required=true)
M getPresentationElement()
Gets element from presentation model which is described by this visual element.

Returns:
presentation element

setPresentationElement

void setPresentationElement(M pe)
                            throws ModelException
Sets the element from presentation model which is described by this visual element.

Parameters:
pe - presentation element to set
Throws:
IllegalArgumentException - if given presentation element is null
ModelException - if a presentation element is already defined for this visual element

getVisualLabel

String getVisualLabel()
Gets visual label which is created from all properties returned by IVisualDataSet.getPropertiesMarkedAsLabel(Type). If marked property does not exists in given element it is ignored. This method should be used by editor to display elements' labels.

Returns:
visual label which at least contains one property

getPropertiesMarkedAsLabel

Collection<Property<? extends MetaProperty>> getPropertiesMarkedAsLabel()
Gets collection of properties marked as label (including properties of presentation, visual and original elements). If always return collection which contains at least one property. If no properties is marked as label the DEFAULT_VISUAL_LABEL_ID.

Returns:
collection of properties marked as label

markPropertyAsLabel

void markPropertyAsLabel(PresentationPropertyDescriptor desc,
                         boolean flag)
Marks given property as label. If flag is true the property is added to label, otherwise it is removed from label.

Parameters:
desc - object which describes property to be added or removed from label
flag - flag which indicate is given property is to be added or removed from label


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