Module com.iamsoft.util.ui
Package com.iamsoft.util.ui.swing.mdi
Class InternalFrameContentListModel
- java.lang.Object
-
- javax.swing.AbstractListModel<Container>
-
- com.iamsoft.util.ui.swing.mdi.InternalFrameContentListModel
-
- All Implemented Interfaces:
Serializable
,ListModel<Container>
public class InternalFrameContentListModel extends AbstractListModel<Container>
Maintains a list of content panes. List is ordered by last focus. When focus is transferred, new focus owner is removed from list and re-added at the front. Consequently, two events are fired upon focus change. Guaranteed never to fire a list data changed event. Even if content pane is changed, this class continues to listen for focus with the old container. May face problems if frame focus is transferred without an internal component that grabs focus.- See Also:
JInternalFrame.getContentPane()
, Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description InternalFrameContentListModel(JDesktopPane pDesktop)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Container
getElementAt(int pIdx)
Map<Container,JInternalFrame>
getPaneToFrame()
After a ListModelEvent is fired, the size of this map is guaranteed to be equal to the number of open frames.int
getSize()
-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
-
-
-
Constructor Detail
-
InternalFrameContentListModel
public InternalFrameContentListModel(JDesktopPane pDesktop)
-
-
Method Detail
-
getElementAt
public Container getElementAt(int pIdx)
-
getSize
public int getSize()
-
getPaneToFrame
public Map<Container,JInternalFrame> getPaneToFrame()
After a ListModelEvent is fired, the size of this map is guaranteed to be equal to the number of open frames. Thus, to test whether 'remove' event is the result of a focus change, test whether getSize() == getPaneToFrame().size().- Returns:
- Map from content pane to associated internal frame.
-
-