ARoad0.gBase
Class ViewInBaseImpl

java.lang.Object
  extended by ARoad0.gBase.FolderAbst
      extended by ARoad0.gBase.ViewInBaseImpl
All Implemented Interfaces:
BaseObject, BoundBean, Folder, ImmutableFolder, ViewInBase, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
EPRViewInBaseImpl

public class ViewInBaseImpl
extends FolderAbst
implements ViewInBase, BoundBean

This class is responsible for modeling a view which is the backing data of a GraphicView in the GUI. It is both a base listener and a bean with bounding properties. It is a direct listener of the ACS openings and ACS closings, since a view is opened only if all its ACS are opened. It is NOT a listener of the base object opening and closing which is handled by the super class. It is NOT a listener of the properties of base objects which belong to this view, since this feature is provided by the subclasses. This class is used directly only for the 'Architecture' view, where the view objects are ACS. Otherwise, the subclasses handle view objects as ACSObjects. At the opening of a view, the deserialized instance does not contain the view objects, and their value are put in the view from the open ACSs. This is why the super method prepareAfterRestoring() has to be called by BaseManagerImpl after the opening of a view. Caution: no equals() nor clone() methods.

See Also:
Serialized Form

Field Summary
static Name ARCHI_VIEW_NAME
           
static java.lang.String ARCHI_VIEW_STRING
           
static ViewInBase EMPTY_INSTANCE
           
private static long serialVersionUID__
           
 
Fields inherited from class ARoad0.gBase.FolderAbst
baseError_, changeSupport_, comment_, connectedToSeveralACS_, INITIAL_CAPACITY, INITIAL_CAPACITY_5, l_connectedACSNames_, m_BaseObjects_, m_ObjectsNames_, name_, PRIME, serialPersistentFields, type_
 
Constructor Summary
ViewInBaseImpl()
          Default constructor
ViewInBaseImpl(ImmutableName _name)
          This constructor is used by the GUI.
ViewInBaseImpl(ImmutableName _name, boolean _toRegisterInManager)
          This constructor allows the subclasses to manage directly the registration in BaseManagerImpl, to initialize their properties before the firing of the 'OpenViews' event by BaseManagerImpl.
ViewInBaseImpl(ImmutableName _name, java.util.Map _m_BaseObjects, boolean _toRegisterInManager)
          This constructor provides a ViewInBaseImpl instance from a map of base objects.
 
Method Summary
protected  void addOwnListening()
          This method registers the instance as a property event listener of 'OpenACS' on BaseManagerImpl to detect the closing of a relevant acs, and 'OneBaseObject' on ACSImpl to detect the deleting of a view object.
protected static ViewInBase copy(ImmutableName _name, ViewInBase _view, boolean _toRegisterInManager)
          This method creates a copy with another name.
 boolean getCompleteResults()
          False if at least one ACS structure modeling is incomplete for an used ACS.
 java.lang.String getNickName()
          This short name is NOT unique for the Access Road program, nor its ACS if it is an ACS object.
 long getSerialVersionUID()
           
 void propertyChange(java.beans.PropertyChangeEvent _evt)
          Observes the changes 'OpenACS' in the open ACS, and closes the instance if a connected ACS has been closed.
protected  void removeOwnListening()
          This method unregisters the instance as a property event listener of 'OpenACS' on BaseManagerImpl, and 'OneBaseObject' on ACSImpl if it is not closed (the acs closing produces a call to finalizeForBase()).
 
Methods inherited from class ARoad0.gBase.FolderAbst
addEorBaseObject, addPropertyChangeListener, addPropertyChangeListener, containsBaseObject, finalize, finalizeForBase, finalizeForCopy, finalizeFromDeserialization, firePropertyChange, getComment, getConnectedToSeveralACS, getEorBaseError, getEorL_ConnectedACSNames, getEorM_BaseObjects, getFullName, getName, getType, hashCode, isEmpty, prepareAfterRestoring, prepareBeforeSaving, prepareDataAfterRestoring, removeEorBaseObject, removePropertyChangeListener, removePropertyChangeListener, setComment, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ARoad0.gBaseInterface.Folder
addEorBaseObject, addPropertyChangeListener, addPropertyChangeListener, removeEorBaseObject, removePropertyChangeListener, removePropertyChangeListener, setComment
 
Methods inherited from interface ARoad0.gBaseInterface.ImmutableFolder
containsBaseObject, getComment, getConnectedToSeveralACS, getEorL_ConnectedACSNames, getEorM_BaseObjects, getType, isEmpty
 
Methods inherited from interface ARoad0.gBaseInterface.BaseObject
equals, getFullName, getName, hashCode
 

Field Detail

serialVersionUID__

private static final long serialVersionUID__
See Also:
Constant Field Values

ARCHI_VIEW_STRING

public static final java.lang.String ARCHI_VIEW_STRING
See Also:
Constant Field Values

ARCHI_VIEW_NAME

public static final Name ARCHI_VIEW_NAME

EMPTY_INSTANCE

public static final ViewInBase EMPTY_INSTANCE
Constructor Detail

ViewInBaseImpl

public ViewInBaseImpl()
Default constructor


ViewInBaseImpl

public ViewInBaseImpl(ImmutableName _name)
               throws CreateError
This constructor is used by the GUI. Calls the last constructor.

Parameters:
_name - ImmutableName is copied.
Throws:
CreateError - if the view name is null, already known in BaseManagerImpl, or if it contains an ISO control value.

ViewInBaseImpl

public ViewInBaseImpl(ImmutableName _name,
                      boolean _toRegisterInManager)
               throws CreateError
This constructor allows the subclasses to manage directly the registration in BaseManagerImpl, to initialize their properties before the firing of the 'OpenViews' event by BaseManagerImpl. Called by the previous constructor.

Parameters:
_name - ImmutableName is copied.
_toRegisterInManager - false if this constructor must not register the instance in BaseManagerImpl. If true, this constructor is identical to ViewInBaseImpl(_name)
Throws:
CreateError - if the view name is null, already known in BaseManagerImpl, or if it contains an ISO control value.

ViewInBaseImpl

public ViewInBaseImpl(ImmutableName _name,
                      java.util.Map _m_BaseObjects,
                      boolean _toRegisterInManager)
               throws CreateError
This constructor provides a ViewInBaseImpl instance from a map of base objects. Invoked by EPRViewInBaseImpl(ImmutableName _name, Map _m_BaseObjects) and ViewInBase_Facade.createView(). This constructor is used by BaseManagerImpl.openView() to create every instance. So, all the objects to listen (ACS...) do receive a registration from this instance through the call to the addOwnListening() method.

Parameters:
_name - of the view. It is copied.
_m_BaseObjects - is the map (name, object) of the view objects. It is copied. May be null.
_toRegisterInManager - false if this constructor must not register the instance in BaseManagerImpl.
Throws:
CreateError - if _name is already known in BaseManagerImpl, or if _m_BaseObjects contains a null, no BaseObject, or empty-name object.
Method Detail

getSerialVersionUID

public long getSerialVersionUID()
Overrides:
getSerialVersionUID in class FolderAbst
Returns:
long the serialVersionUID used by the serialization process.

getNickName

public java.lang.String getNickName()
This short name is NOT unique for the Access Road program, nor its ACS if it is an ACS object. It is often the last component name, but not for a ViewInBase where it is the two last components with ':: ' as separator. Overridden by NoThanViewInBaseImpl.

Specified by:
getNickName in interface BaseObject
Overrides:
getNickName in class FolderAbst
Returns:
the nick name. May be null.

getCompleteResults

public boolean getCompleteResults()
False if at least one ACS structure modeling is incomplete for an used ACS. The modeling of the ACS structure is incomplete when some ACSObjects miss while they participate to the decision for some important access controls, or simply when these missed ACSObjects are important for the overall ACS security, or when their important relations with some other ACSObjects are not set. An ACS structure is incomplete if one of the two methods ACS.getIncompleteStructureModeling() and getIncompleteBehaviorModeling() return false. On the other hand, the modeling remains complete if some secondary ACSObjects are not modelled, like for instance image files in an operating system file system. When the modeling of an ACS structure is incomplete, all the views which use this ACS are set incomplete in their results.

Specified by:
getCompleteResults in interface ViewInBase
Returns:
false if the result is incomplet since one ACS structure is incomplete.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent _evt)
Observes the changes 'OpenACS' in the open ACS, and closes the instance if a connected ACS has been closed. Note: the ACS is then already finalized and unregistered in BaseManagerImpl. Fires property change on 'ConnectedACS' if one connected ACS is closing (and not for the opening ACS) only if the view contains ACSObjects (unlike the 'Architecture' view). For the 'Architecture' view, fire property change on 'OneBaseObjectInView' when an acs is opening or closing. For a 'OneBaseObject' event, may call removeEorBaseObject(). Fires property change 'CompleteResults' if one connected ACS is opening or closing, or if the view elements has changed. Call BaseManagerImpl.getInstance().saveAndCloseOpenView(). Calls the super method for the 'OneBaseObject' events. Overridden method. May invoke BaseManagerImpl.closeOpenView(this).

Specified by:
propertyChange in interface Folder
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class FolderAbst
Parameters:
_evt -

copy

protected static ViewInBase copy(ImmutableName _name,
                                 ViewInBase _view,
                                 boolean _toRegisterInManager)
                          throws BaseError
This method creates a copy with another name. Each internal variable that is an external object reference has a shallow copy (no deep copy): baseError_, m_BaseObjects_. Overridden by the subclass.

Parameters:
_name - ImmutableName of the view. It is copied.
_view - ViewInBaseImpl to copy.
_toRegisterInManager - false if this method must not register the instance in BaseManagerImpl.
Returns:
a copy
Throws:
BaseError - if _name is null or already known in BaseManagerImpl, or if _view is null or not known.

addOwnListening

protected void addOwnListening()
This method registers the instance as a property event listener of 'OpenACS' on BaseManagerImpl to detect the closing of a relevant acs, and 'OneBaseObject' on ACSImpl to detect the deleting of a view object. Does not register for 'OpenViews', which is done by Gui2.ViewTreeBaseListenerImpl. Called by the constructors, copy(), prepareAfterRestoring() methods, and by the addOwnListening(boolean) subclass method.

Overrides:
addOwnListening in class FolderAbst

removeOwnListening

protected void removeOwnListening()
This method unregisters the instance as a property event listener of 'OpenACS' on BaseManagerImpl, and 'OneBaseObject' on ACSImpl if it is not closed (the acs closing produces a call to finalizeForBase()). Called by finalizeForBase(). Overrides and calls the super method.

Overrides:
removeOwnListening in class FolderAbst