1 package cz
.cvut
.promod
.gui
;
3 import cz
.cvut
.promod
.gui
.support
.utils
.NotationGuiHolder
;
5 import java
.util
.Collection
;
7 import java
.util
.HashMap
;
10 import com
.jidesoft
.dialog
.AbstractDialogPage
;
11 import com
.jidesoft
.dialog
.PageList
;
14 * ProMod, master thesis project
15 * User: Petr Zverina, petr.zverina@gmail.com
16 * Date: 16:09:51, 10.10.2009
20 * Data holder for the Modeler class.
22 public class ModelerModel
{
24 public static final String APPLICATION_NAME
= "ProMod";
26 public static final String MODELER_IDENTIFIER
= "modeler";
28 private String selectedNotation
= null; //must be null due to initial view update invoked by Modeler class constructor
30 private Map
<String
, NotationGuiHolder
> notationGuiHolders
= new HashMap
<String
, NotationGuiHolder
>();
32 private final PageList settingPagesModel
= new PageList();
35 * @return NotationGuiHolder collection
37 public Collection
<NotationGuiHolder
> getNotationGuiHolders(){
38 return notationGuiHolders
.values();
42 * @param notationIdentifier is the notation identifier
43 * @return required NotationGuiHolder
45 public NotationGuiHolder
getNotationGuiHolder( final String notationIdentifier
){
46 return notationGuiHolders
.get(notationIdentifier
);
50 * Adds a new NotationGuiHolder.
51 * @param notationGuiHolder is the new NotationGuiHolder
53 public void addNotationGuiHolder( final NotationGuiHolder notationGuiHolder
){
54 notationGuiHolders
.put(notationGuiHolder
.getNotationIdentifier(), notationGuiHolder
);
58 * @return selected notation identifier
60 public String
getSelectedNotation() {
61 return selectedNotation
;
65 * Sets selected notation identifier
66 * @param selectedNotation newly selected identifier
68 public void setSelectedNotation(final String selectedNotation
) {
69 this.selectedNotation
= selectedNotation
;
73 * Adds settings pages to the common settings dialog.
74 * @param pages are the pages to be added
76 public void addSettingPages(final List
<AbstractDialogPage
> pages
) {
77 for(final AbstractDialogPage page
: pages
){
78 settingPagesModel
.append(page
);
83 * @return returns the model holding all settings pages
85 public PageList
getSettingPagesModel() {
86 return settingPagesModel
;