public class HomerMultiContent extends MultiContent<TabScenePanel>
Constructor and Description |
---|
HomerMultiContent(TabScenePanel contentPrototype)
Create a content container.
|
HomerMultiContent(TabScenePanel contentPrototype,
CompositeEntity model)
Create a content container.
|
Modifier and Type | Method and Description |
---|---|
void |
add(NamedObj element)
Add a NamedObj element and notify all listeners.
|
void |
addElement(java.lang.String tabTag,
PositionableElement element)
Add a positionable element to the selected tab.
|
void |
addListener(java.awt.event.ActionListener listener)
Add an action listener.
|
java.lang.String |
addTab(ComponentEntity topLevel,
java.lang.String tag,
java.lang.String name,
ContentPrototype content)
Add a tab with the provided parameters.
|
void |
clear()
Clear the contents, but keep all the listeners attached.
|
boolean |
contains(NamedObj key)
Determine if the NamedObj already exists.
|
java.util.HashSet<NamedObj> |
getRemoteElements()
Get the remote model elements.
|
void |
remove(NamedObj element)
Remove the NamedObj element and notify all listeners.
|
void |
removeElement(PositionableElement element)
Remove the positionable element and its associated NamedObj.
|
void |
removeListener(java.awt.event.ActionListener listener)
Remove an action listener.
|
void |
removeTab(int index)
Remove a tab at the provided index.
|
void |
removeTab(java.lang.String tag)
Remove the tab given its tag.
|
void |
setNameAt(int position,
java.lang.String text)
Rename a content area at a given position.
|
_getContents, _getOrder, _initializeContents, addTab, addTab, addTab, getAllTabs, getContent, getElement
public HomerMultiContent(TabScenePanel contentPrototype)
contentPrototype
- A prototype of the content area. This
prototype is used to create multiple content areas on demand.public HomerMultiContent(TabScenePanel contentPrototype, CompositeEntity model) throws IllegalActionException, NameDuplicationException
contentPrototype
- A prototype of the content area.
This prototype is used to create multiple content areas on demand.model
- The model to be parsed.IllegalActionException
- If any of the elements can't be
placed into a content area.NameDuplicationException
- If multiple elements exist with
the same name. Element names within a workspace must be unique.public void add(NamedObj element)
element
- The NamedObj to be added.public void addElement(java.lang.String tabTag, PositionableElement element) throws IllegalActionException
addElement
in class MultiContent<TabScenePanel>
tabTag
- The tag of the target tab.element
- The positionable element.IllegalActionException
- If the content area is not set.public void addListener(java.awt.event.ActionListener listener)
listener
- The listener to add.public java.lang.String addTab(ComponentEntity topLevel, java.lang.String tag, java.lang.String name, ContentPrototype content) throws IllegalActionException, NameDuplicationException
addTab
in class MultiContent<TabScenePanel>
topLevel
- The container containing all tab definitions. If the container
does not have the attribute that contains all tab definition information, it will be created.tag
- The tag identifier used for the content area.name
- Name of the tab. Can be used for visualization.content
- The specific content for the new tab.IllegalActionException
- If the name coincides with an attribute already in the container.NameDuplicationException
- If the attribute is not of an acceptable class for the
container, if the name contains a period, or if a content area with the same tag already exist.public void clear()
clear
in class MultiContent<TabScenePanel>
public boolean contains(NamedObj key)
key
- The NamedObj object to look for.public java.util.HashSet<NamedObj> getRemoteElements()
public void remove(NamedObj element)
element
- The NamedObj to be removed.public void removeElement(PositionableElement element)
removeElement
in class MultiContent<TabScenePanel>
element
- The positionable element to be removed.public void removeListener(java.awt.event.ActionListener listener)
listener
- The listener to remove.addListener(ActionListener)
public void removeTab(int index)
index
- The ordinal position of the tab to remove.public void removeTab(java.lang.String tag)
removeTab
in class MultiContent<TabScenePanel>
tag
- The identifier of the tab to be removed.public void setNameAt(int position, java.lang.String text) throws IllegalActionException
setNameAt
in class MultiContent<TabScenePanel>
position
- The position of the tab.text
- The new title of the tab.IllegalActionException
- If the new name is not accepted by the model.