ARoad0.Gui1
Class InternalFrameUtilities

java.lang.Object
  extended by ARoad0.Gui1.InternalFrameUtilities
All Implemented Interfaces:
StaticClass

public class InternalFrameUtilities
extends java.lang.Object
implements StaticClass

This class is responsible to deliver utilities to internal frames in the desktop. It detects the type of the frame, and adds the frame listeners. It is used by InternalFrameView, InternalFrameModel.


Field Summary
private static javax.swing.JPanel EMPTY_PANEL
           
private static int INITIAL_CAPACITY
           
private static InternalFrameUtilities instance__
          the only instance of this class, following the singleton pattern
private static InternalFrameModel model__
          the only instance, following the MVC pattern, which manages the internal frames data
 
Constructor Summary
private InternalFrameUtilities()
          only one private constructor
 
Method Summary
(package private) static javax.swing.JInternalFrame addACSFrameListener(javax.swing.JInternalFrame _frame)
          Adds a frame listener to an ACS main internal frame when it is closing and when it is activated.
(package private) static javax.swing.JInternalFrame addActivationFrameListener(javax.swing.JInternalFrame _frame)
          Add a frame listener to the frame when it is activated and de-activated.
(package private) static javax.swing.JInternalFrame addAllFullViewsFrameListener(javax.swing.JInternalFrame _frame)
          Add a frame listener to a full view main internal frame when it is closing and when it is activated.
(package private) static javax.swing.JInternalFrame addAllNoThanViewsFrameListener(javax.swing.JInternalFrame _frame)
          Add a frame listener to a NoThan view main internal frame when it is closing and when it is activated.
(package private) static javax.swing.JInternalFrame addStructureFrameListener(javax.swing.JInternalFrame _frame)
          Adds a frame listener to a full view main internal frame when it is closing and when it is activated.
(package private) static javax.swing.JInternalFrame addViewFrameListener(javax.swing.JInternalFrame _frame)
          Adds a frame listener to a view or architecture main internal frame when it is closing and when it is activated.
static Name extractACSName(java.lang.String _title)
          Extract the name from the title of an ACS main frame.
static Name extractBeamerName(java.lang.String _beamerTitle)
          Extract the name in the beamer title.
static Name extractViewNameFromFrameTitle(java.lang.String _title)
          Extracts the name from the title of a view main frame.
static Name extractViewNameFromSeeWhy(java.lang.String _title)
          Extracts the name from the title of a view 'See why' frame, and detect the presence of the NoThan view indicator.
static javax.swing.JPanel getEmptyPanel()
          Allow to avoid the use of 'new JPanel()' for the initialization of a variable.
static java.lang.String getViewFrameTitleFromViewName(ImmutableName _name)
          Gets the main frame title for an EPRViewInBase or a NoThanViewInBase.
static boolean isACSFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is a ACS frame, registered or not.
static boolean isAllFullViewsFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is the 'Full views' frame.
static boolean isAllNoThanViewsFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is the 'NoMore-NoLess views' frame.
static boolean isBeamerFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is the beamer frame.
static boolean isISstructureFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is the IS structure frame.
static boolean isSketcherFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is the sketcher frame.
static boolean isViewFrame(javax.swing.JInternalFrame _frame)
          Test if a frame is a view frame, registered or not.
static java.util.Map saveFrameDispositionInGUI(javax.swing.JInternalFrame _frame, java.util.Map _m_GUIconfig)
          Puts in the argument _GUIconfig the current location of a frame in the GUI, as a Rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance__

private static InternalFrameUtilities instance__
the only instance of this class, following the singleton pattern


model__

private static InternalFrameModel model__
the only instance, following the MVC pattern, which manages the internal frames data


INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values

EMPTY_PANEL

private static final javax.swing.JPanel EMPTY_PANEL
Constructor Detail

InternalFrameUtilities

private InternalFrameUtilities()
only one private constructor

Method Detail

extractACSName

public static Name extractACSName(java.lang.String _title)
                           throws DialogError
Extract the name from the title of an ACS main frame.

Parameters:
_title - String of the internal frame
Returns:
Name of the ACS displayed in the frame
Throws:
DialogError - if the selected frame has not the standard format of ACS frame titles

getViewFrameTitleFromViewName

public static java.lang.String getViewFrameTitleFromViewName(ImmutableName _name)
Gets the main frame title for an EPRViewInBase or a NoThanViewInBase. For a NoThanViewInBase where the name has 3 components, the title contains the component 'ViewInBase_Facade.NOTHAN_VIEW_INDICATOR ' just after the value ViewInBase_Facade.VIEW_FRAME_INDICATOR. Called by InternalFrame.showViewFrame().

Parameters:
_name - of a ViewInBase
Returns:
the title. Null if _name is null or has only one component.

extractViewNameFromFrameTitle

public static Name extractViewNameFromFrameTitle(java.lang.String _title)
                                          throws DialogError
Extracts the name from the title of a view main frame. Detects the presence of the NoThan view indicator. Works also for the Architecture view. This is the inverse method for getViewFrameTitleFromViewName().

Parameters:
_title - of the internal frame
Returns:
Name of the view displayed in the frame
Throws:
DialogError - if the selected frame has not the standard format of view frame titles

extractViewNameFromSeeWhy

public static Name extractViewNameFromSeeWhy(java.lang.String _title)
                                      throws DialogError
Extracts the name from the title of a view 'See why' frame, and detect the presence of the NoThan view indicator. Does not process the Architecture view.

Parameters:
_title - String of the internal frame
Returns:
Name of the view displayed in the frame
Throws:
DialogError - if the selected frame has not the standard format of view 'See why' frame titles

extractBeamerName

public static Name extractBeamerName(java.lang.String _beamerTitle)
                              throws DialogError
Extract the name in the beamer title.

Parameters:
_beamerTitle - of the internal frame
Returns:
Name of the beamer: title
Throws:
DialogError - if the selected frame has not the standard format of the beamer

isACSFrame

public static boolean isACSFrame(javax.swing.JInternalFrame _frame)
Test if a frame is a ACS frame, registered or not. Test the title format.

Parameters:
_frame - JInternalFrame to process
Returns:
boolean true if it is an ACS frame

isViewFrame

public static boolean isViewFrame(javax.swing.JInternalFrame _frame)
Test if a frame is a view frame, registered or not. Test 'in the View group' the title format. Used by ActionUtilities and ActionOpenAllViews

Parameters:
_frame - to process
Returns:
boolean true if it is an view frame

isAllFullViewsFrame

public static boolean isAllFullViewsFrame(javax.swing.JInternalFrame _frame)
Test if a frame is the 'Full views' frame. Test the title format. Used by ActionUtilities and ActionOpenAllViews

Parameters:
_frame - to process
Returns:
boolean true if it is the AllViews frame

isAllNoThanViewsFrame

public static boolean isAllNoThanViewsFrame(javax.swing.JInternalFrame _frame)
Test if a frame is the 'NoMore-NoLess views' frame. Test the title format. Used by ActionUtilities and ActionOpenAllViews

Parameters:
_frame - to process
Returns:
boolean true if it is the AllViews frame

isBeamerFrame

public static boolean isBeamerFrame(javax.swing.JInternalFrame _frame)
Test if a frame is the beamer frame. Test the title format.

Parameters:
_frame - to process
Returns:
boolean true if it is the beamer frame

isSketcherFrame

public static boolean isSketcherFrame(javax.swing.JInternalFrame _frame)
Test if a frame is the sketcher frame. Test the title format.

Parameters:
_frame - to process
Returns:
boolean true if it is the sketcher frame

isISstructureFrame

public static boolean isISstructureFrame(javax.swing.JInternalFrame _frame)
Test if a frame is the IS structure frame. Test the title format.

Parameters:
_frame - to process
Returns:
boolean true if it is the IS structure frame

getEmptyPanel

public static javax.swing.JPanel getEmptyPanel()
Allow to avoid the use of 'new JPanel()' for the initialization of a variable.

Returns:
an empty panel for initialization

addActivationFrameListener

static javax.swing.JInternalFrame addActivationFrameListener(javax.swing.JInternalFrame _frame)
Add a frame listener to the frame when it is activated and de-activated. Used for explorer, beamer, sketcher and See why frames. An inner class InternalFrameAdapter is used.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a listener

addACSFrameListener

static javax.swing.JInternalFrame addACSFrameListener(javax.swing.JInternalFrame _frame)
Adds a frame listener to an ACS main internal frame when it is closing and when it is activated. An inner class InternalFrameAdapter is used. If ActionClose has been already called, the closing listener cleans up the frame. The closing listener updates the variables m_BaseObjectsInMainFrames__, m_MainFramesOfBaseObjects__, m_JComponentsOfBaseObjects__ in InternalFrameModel. The activated listener updates the variable activeFrame__.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a closing listener

addViewFrameListener

static javax.swing.JInternalFrame addViewFrameListener(javax.swing.JInternalFrame _frame)
Adds a frame listener to a view or architecture main internal frame when it is closing and when it is activated. An inner class InternalFrameAdapter is used. The activation listener updates the variable activeFrame__. The closing listener updates the variables m_BaseObjectsInMainFrames__, m_MainFramesOfBaseObjects__, m_JComponentsOfBaseObjects__ in InternalFrameModel, and fires an event to ActionClose if it is not already implied.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a closing listener

addAllFullViewsFrameListener

static javax.swing.JInternalFrame addAllFullViewsFrameListener(javax.swing.JInternalFrame _frame)
Add a frame listener to a full view main internal frame when it is closing and when it is activated. An inner class InternalFrameAdapter is used. The activation listener updates the variable activeFrame__. The closing listener updates m_JComponentsOfBaseObjects__ in InternalFrameModel, and calls ActionClose.closeAllFullViewsFrame() if it is not still implied.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a closing listener

addStructureFrameListener

static javax.swing.JInternalFrame addStructureFrameListener(javax.swing.JInternalFrame _frame)
Adds a frame listener to a full view main internal frame when it is closing and when it is activated. An inner class InternalFrameAdapter is used. The activation listener updates the variable activeFrame__. The closing listener updates m_JComponentsOfBaseObjects__ in InternalFrameModel, and calls ActionClose.closeStructureFrame() if it is not still implied. '' is the name of the frame in the internal frame model.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a closing listener

addAllNoThanViewsFrameListener

static javax.swing.JInternalFrame addAllNoThanViewsFrameListener(javax.swing.JInternalFrame _frame)
Add a frame listener to a NoThan view main internal frame when it is closing and when it is activated. An inner class InternalFrameAdapter is used. The activation listener updates the variable activeFrame__. The closing listener updates m_JComponentsOfBaseObjects__ in InternalFrameModel, and calls ActionClose.closeAllViewsFrame() if it is not still implied.

Parameters:
_frame - JInternalFrame to handle
Returns:
JInternalFrame with a closing listener

saveFrameDispositionInGUI

public static java.util.Map saveFrameDispositionInGUI(javax.swing.JInternalFrame _frame,
                                                      java.util.Map _m_GUIconfig)
                                               throws ProcessError
Puts in the argument _GUIconfig the current location of a frame in the GUI, as a Rectangle. Does not save the nodes location in the views. Called by ActionSave and ActionSaveAll.

Parameters:
_frame - is the frame for which the disposition in the GUI is to save. May be null.
_m_GUIconfig - is the map of the objects in the GUI to save; object name is the key. Never null.
Returns:
an updated _m_GUIconfig in its map put for the key 'new NameImpl("")'
Throws:
ProcessError - if the _frame is not null and not found