|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.fopps.model.AbstractItem
AbstractItem is the base class for most classes in the model. It provides a name attribute, a description field and provides methods to issue changes. It also holds relations to other AbstractItem (e. g. dependencies or constraints).
*,
ModelListener,
Relation| Field Summary | |
static ModelEvent |
ADDED_EVENT
Emitted, if an item was added |
static ModelEvent |
CHANGE_EVENT
Emitted, if a change occurred |
protected java.lang.String |
name
|
static ModelEvent |
REMOVED_EVENT
Emitted, if an item was removed |
| Constructor Summary | |
AbstractItem(java.lang.String name)
Creates a new abstact item |
|
| Method Summary | |
void |
addIncoming(Relation pIncoming)
Adds one element to association Incoming |
void |
addListener(ModelListener pListener)
Adds a listener |
void |
addOutgoing(Relation pOutgoing)
Adds one element to association Outgoing |
int |
commitGhostRelations()
Change all existing ghost relations to 'real' relations |
static boolean |
containsType(java.lang.Class c,
java.util.Collection list)
Checks if element of given type is in the list |
protected AbstractItem |
copyAttributes(AbstractItem pItem)
Copy all attributes into a given instance |
void |
delete()
Deletes the current instance. |
static java.util.Collection |
filterElements(java.lang.Class c,
java.util.Collection list)
Filters elements out of a collection. |
void |
fireItemAdded()
Notifies all listeners, if event blocking is disabled |
void |
fireItemChanged()
Notifies all listeners, if event blocking is disabled |
void |
fireItemRemoved()
Notifies all listeners, if event blocking is disabled |
java.util.Collection |
getConstraints()
Returns a list containing all (outgoing) constraints. |
java.lang.String |
getDescription()
Returns the description of the project |
java.util.List |
getIncoming()
Getter Association Incoming |
java.util.Collection |
getIncomingConstraints()
|
java.util.List |
getListeners()
Returns all listeners |
java.lang.String |
getName()
Returns the name of the item |
java.util.List |
getOutgoing()
Getter Association Outgoing |
java.util.Collection |
getOutgoingConstraints()
|
Relation |
getRelationTo(AbstractItem pItem)
Returns the relation to a specified item, if exist. |
boolean |
hasConstraints()
Returns true, if item contains constraints |
boolean |
isBlockEvents()
Return the current status of event blocking |
boolean |
isConnectedWith(AbstractItem pItem)
Checks if a relation to a specified item already exists. |
void |
notifyListeners(ModelEvent pEvent)
Notify all listeners of the item |
void |
removeAllConstraints()
Removes all (incoming and outgoing) constraints |
void |
removeAllIncoming()
Removes all elements from association Incoming |
void |
removeAllListener()
Removes all listeners |
void |
removeAllOutgoing()
Removes all elements from association Outgoing |
void |
removeAllRelations()
Removes all relations (incoming and outcoming) |
int |
removeGhostRelations()
Change all existing ghost relations to 'real' relations |
void |
removeIncoming(Relation pIncoming)
Removes one element to association Incoming |
void |
removeListener(ModelListener pListener)
Removes a listener |
void |
removeOutgoing(Relation pOutgoing)
Removes one element to association Outgoing |
boolean |
removeRelationTo(AbstractItem pItem)
Removes all connections to given item. |
void |
setBlockEvents(boolean blockEvents)
Blocks next project event. |
void |
setDescription(java.lang.String pDescription)
Sets a new project description. |
void |
setIncoming(java.util.List pIncoming)
Setter Association Outgoing |
void |
setName(java.lang.String pName)
Sets a new name. |
void |
setOutgoing(java.util.List pOutgoing)
Setter Association Outgoing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final ModelEvent CHANGE_EVENT
ModelEventpublic static final ModelEvent ADDED_EVENT
ModelEventpublic static final ModelEvent REMOVED_EVENT
ModelEventprotected java.lang.String name
| Constructor Detail |
public AbstractItem(java.lang.String name)
name - Name of the item| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String pName)
public java.lang.String getDescription()
public void setDescription(java.lang.String pDescription)
pDescription - New value for descriptionprotected AbstractItem copyAttributes(AbstractItem pItem)
public boolean isBlockEvents()
public void setBlockEvents(boolean blockEvents)
setBlockEvents(true)
causes only the next event to be blocked. All following calls of fireItemChanged() will notify
its listeners.
blockEvents - Flag, if the next event shold be blockpublic void fireItemChanged()
setBlockEvents(boolean)public void fireItemAdded()
setBlockEvents(boolean)public void fireItemRemoved()
setBlockEvents(boolean)public java.util.List getOutgoing()
public void setOutgoing(java.util.List pOutgoing)
public void addOutgoing(Relation pOutgoing)
pOutgoing - New element in associationpublic void removeOutgoing(Relation pOutgoing)
pOutgoing - Element to remove from associationpublic void removeAllOutgoing()
public java.util.List getIncoming()
public void setIncoming(java.util.List pIncoming)
public void addIncoming(Relation pIncoming)
pIncoming - New element in associationpublic void removeIncoming(Relation pIncoming)
pIncoming - Element to remove from associationpublic void removeAllIncoming()
public boolean isConnectedWith(AbstractItem pItem)
pItem - Peer of relation
public Relation getRelationTo(AbstractItem pItem)
pItem - Peer of relation
public int removeGhostRelations()
public boolean removeRelationTo(AbstractItem pItem)
pItem - Connection peer
public int commitGhostRelations()
public void removeAllRelations()
public void addListener(ModelListener pListener)
pListener - Listener to addpublic void removeListener(ModelListener pListener)
pListener - Listener to removepublic void removeAllListener()
public void notifyListeners(ModelEvent pEvent)
public void delete()
public boolean hasConstraints()
public java.util.Collection getIncomingConstraints()
public java.util.Collection getOutgoingConstraints()
public java.util.Collection getConstraints()
public void removeAllConstraints()
public static boolean containsType(java.lang.Class c,
java.util.Collection list)
public static java.util.Collection filterElements(java.lang.Class c,
java.util.Collection list)
public java.util.List getListeners()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||