|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.FolderAbst
public abstract class FolderAbst
This abstract class is responsible for managing a folder of BaseObjects (even if most of the code is adapted to ACSObjects folder), where the members are added and removed from the container _without_ object deleting. This is the main differene with a Node which deletes its children when they are removed from it. It is a javabean with the following bound properties: 'OneBaseObjectInFolder' (when one base object is added or removed), 'Comment'. The subclasses have different managers on which they are registered: - BaseManagerImpl for ViewInBaseImpl, - ACSImpl for VirtualFolderImpl. The listeners are proper to the instance, outside gBase, transient (not serialized in this instance backup). They are called in any order. Excepted for 'OneBaseObjectInFolder', the listeners receive only a copy of the new value to protect the property. All the exceptions from the listeners are catched, and a dialog box is displayed to inform the user. Caution: no equals() nor clone() methods. See the Copyright.
Field Summary | |
---|---|
protected BaseError |
baseError_
|
protected java.beans.PropertyChangeSupport |
changeSupport_
manages all the property change listeners of this classes and its subclasses |
protected java.lang.String |
comment_
|
protected boolean |
connectedToSeveralACS_
|
protected static int |
INITIAL_CAPACITY
|
protected static int |
INITIAL_CAPACITY_5
|
protected java.util.List<ImmutableName> |
l_connectedACSNames_
The connected ACS are the ACS of the BaseObjects, and it is empty if it is a view of non-ACSObjects like 'Architecture'. |
protected java.util.SortedMap<ImmutableName,BaseObject> |
m_BaseObjects_
|
protected java.util.SortedMap<ImmutableName,ImmutableName> |
m_ObjectsNames_
Used in the folder saving, to avoid some links to the ACSObjects, and then to not include the connected ACSs in the folder saving. |
protected ImmutableName |
name_
|
protected static int |
PRIME
|
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization. |
private static long |
serialVersionUID
|
protected java.lang.String |
type_
|
Constructor Summary | |
---|---|
protected |
FolderAbst()
Default constructor |
protected |
FolderAbst(ImmutableName _name)
|
protected |
FolderAbst(ImmutableName _name,
java.util.Map _m_BaseObjects)
This constructor provides a FolderAbst instance from a map of base objects. |
Method Summary | |
---|---|
void |
addEorBaseObject(BaseObject _obj)
Adds a base object to the folder. |
protected void |
addOwnListening()
This method registers the instance as a property event listener of 'OneBaseObject' on the ACS to detect the deleting of a folder object. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Adds a listener to the bean for the porperties 'OneBaseObjectInFolder', 'ConnectedACS', 'Comment'. |
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Add a listener to the bean for the properties 'OneBaseObjectInFolder', 'ConnectedACS', 'Comment'. |
boolean |
containsBaseObject(BaseObject _obj)
Tests if a BaseObject is within the folder. |
protected void |
finalize()
This method removes the object from the application space, but there is no guarantee that the JVM calls this method before the end of the application. |
void |
finalizeForBase()
The folder is removed as an ACS listener. |
protected void |
finalizeForCopy()
The folder is removed as an ACS listener. |
protected void |
finalizeFromDeserialization()
The folder is NOT removed as an ACS listener. |
protected void |
firePropertyChange(java.lang.String _propertyName,
java.lang.Object _oldValue,
java.lang.Object _newValue)
Fire an event to every registered listener, in any order, for a bound property. |
java.lang.String |
getComment()
|
boolean |
getConnectedToSeveralACS()
Always false when the elements are not ACSObjects, like in an Architecture view, or for a VirtualFolder. |
BaseError |
getEorBaseError()
|
java.util.List<ImmutableName> |
getEorL_ConnectedACSNames()
|
java.util.SortedMap<ImmutableName,BaseObject> |
getEorM_BaseObjects()
Gets all the base objects displayed in this folder. |
ImmutableName |
getFullName()
The full name is unique for the Access Road program. |
ImmutableName |
getName()
The name is unique for the Access Road program only for the ACSObjects. |
java.lang.String |
getNickName()
This short name is NOT unique for the Access Road program nor the ACS if it is an ACS object. |
long |
getSerialVersionUID()
|
java.lang.String |
getType()
The type is defined at the creation of the object, by a subclass. |
int |
hashCode()
|
boolean |
isEmpty()
Caution: an empty folder is not equals to a new FolderAbst() instance, since it may have an non-null name and other non-null properties. |
protected java.lang.String |
prepareAfterRestoring()
This method is called by BaseManagerImpl after the opening of the folder, to update m_BaseObjects_ and l_connectedACSNames_ from m_ObjectsNames_, and to check the open ACS and their objects which are in the restored view. |
protected void |
prepareBeforeSaving()
This method must be called by BaseManagerImpl before the saving of the folder, to update m_ObjectsNames_ from m_BaseObjects_ which is not saved nor updated. |
protected java.lang.String |
prepareDataAfterRestoring()
This method updates m_BaseObjects_ and l_connectedACSNames_ from m_ObjectsNames_, and checks up the open ACS and their objects which are in the restored view. |
void |
propertyChange(java.beans.PropertyChangeEvent _evt)
Observes the changes in the base objects list from the ACS. |
void |
removeEorBaseObject(BaseObject _obj)
Removes a base object to the folder. |
protected void |
removeOwnListening()
This method unregister the instance as a property event listener of 'OneBaseObject' on the relevant ACS. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener _l)
remove a listener to the bean for the properties 'OneBaseObjectInFolder', 'ConnectedACS', 'Comment'. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
remove a listener to the bean for the properties 'OneBaseObjectInFolder', 'ConnectedACS', 'Comment'. |
void |
setComment(java.lang.String _s)
Sets any comment related to this folder. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ARoad0.gBaseInterface.BaseObject |
---|
equals |
Field Detail |
---|
protected java.lang.String type_
protected static final int PRIME
protected static final int INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY_5
protected ImmutableName name_
protected BaseError baseError_
protected transient java.util.SortedMap<ImmutableName,BaseObject> m_BaseObjects_
private static final long serialVersionUID
protected java.lang.String comment_
protected boolean connectedToSeveralACS_
protected transient java.util.List<ImmutableName> l_connectedACSNames_
protected java.util.SortedMap<ImmutableName,ImmutableName> m_ObjectsNames_
protected transient java.beans.PropertyChangeSupport changeSupport_
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
protected FolderAbst()
protected FolderAbst(ImmutableName _name) throws CreateError
_name
- is copied.
CreateError
- if the folder name is null,
or if it contains a character that is not a letterprotected FolderAbst(ImmutableName _name, java.util.Map _m_BaseObjects) throws CreateError
_name
- ImmutableName of the folder. It is copied._m_BaseObjects
- is the map (name, object) of the folder objects.
It is copied. May be null.
CreateError
- if _m_BaseObjects contains a null,
no BaseObject, or empty-name object.Method Detail |
---|
public long getSerialVersionUID()
public final ImmutableName getName()
BaseObject
getName
in interface BaseObject
public ImmutableName getFullName()
getFullName
in interface BaseObject
public java.lang.String getNickName()
getNickName
in interface BaseObject
public BaseError getEorBaseError()
public java.lang.String getType()
getType
in interface ImmutableFolder
public boolean getConnectedToSeveralACS()
getConnectedToSeveralACS
in interface ImmutableFolder
public java.util.List<ImmutableName> getEorL_ConnectedACSNames()
getEorL_ConnectedACSNames
in interface ImmutableFolder
public boolean isEmpty()
isEmpty
in interface ImmutableFolder
public final int hashCode()
hashCode
in interface BaseObject
hashCode
in class java.lang.Object
public boolean containsBaseObject(BaseObject _obj)
containsBaseObject
in interface ImmutableFolder
_obj
- BaseObject to test
public java.util.SortedMap<ImmutableName,BaseObject> getEorM_BaseObjects()
getEorM_BaseObjects
in interface ImmutableFolder
public void addEorBaseObject(BaseObject _obj) throws CreateError
addEorBaseObject
in interface Folder
_obj
- non-null BaseObject to add in the folder
CreateError
- if the name is null, or the object name is null or empty,
or if the name is already known by the folder.public void removeEorBaseObject(BaseObject _obj) throws CreateError
removeEorBaseObject
in interface Folder
_obj
- non-null BaseObject to remove in the folder
CreateError
- if the object name is empty, or
the object is not known by the folder.public void propertyChange(java.beans.PropertyChangeEvent _evt)
propertyChange
in interface Folder
propertyChange
in interface java.beans.PropertyChangeListener
_evt
- PropertyChangeEventpublic void setComment(java.lang.String _s)
setComment
in interface Folder
_s
- comment which is associated to the folder.public java.lang.String getComment()
getComment
in interface ImmutableFolder
public void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BoundBean
addPropertyChangeListener
in interface Folder
_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.public void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BoundBean
addPropertyChangeListener
in interface Folder
_propertyName
- is the name of the property_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.public void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BoundBean
removePropertyChangeListener
in interface Folder
_l
- PropertyChangeListener to removepublic void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BoundBean
removePropertyChangeListener
in interface Folder
_propertyName
- String is the name of the property_l
- PropertyChangeListener to removepublic java.lang.String toString()
toString
in class java.lang.Object
public void finalizeForBase() throws UpDateError
UpDateError
- is not thrownprotected void firePropertyChange(java.lang.String _propertyName, java.lang.Object _oldValue, java.lang.Object _newValue)
_propertyName
- name of the changing property_oldValue
- of the property_newValue
- of the property. No operation if equal to _oldValue
and if the two values are not null.protected void finalizeFromDeserialization()
protected void finalizeForCopy()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void addOwnListening()
protected void removeOwnListening()
protected void prepareBeforeSaving()
protected java.lang.String prepareAfterRestoring() throws DialogError
DialogError
- if the folder contains an object from a closed or removed ACS,
before the registering of the folder as listener;
the exception message should be shown to the user, and this instance has to be
finalized through finalizeFromDeserialization().protected java.lang.String prepareDataAfterRestoring() throws DialogError
If this method is called by BaseManagerImpl.getElementsOfOneView() for a closed view, it is used for updating m_BaseObjects_ and l_connectedACSNames_, then to finalize the instance with finalizeFromDeserialization(). Clears m_BaseObjects_ if it is not null. Called by prepareAfterRestoring() and BaseManagerImpl.getElementsOfOneView().
DialogError
- if the folder contains an object from a closed or removed ACS;
the exception message should be shown to the user, and this instance has to be
finalized through finalizeFromDeserialization().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |