Converted all CRLF to LF.
[indepmod/mmn.git] / IndependentModeler / src / cz / cvut / promod / gui / ModelerModel.java
blobe57f617ce13eb4c8f5311a6d4a071aa24c3b4988
1 package cz.cvut.promod.gui;
3 import cz.cvut.promod.gui.support.utils.NotationGuiHolder;
5 import java.util.Collection;
6 import java.util.Map;
7 import java.util.HashMap;
8 import java.util.List;
10 import com.jidesoft.dialog.AbstractDialogPage;
11 import com.jidesoft.dialog.PageList;
13 /**
14 * ProMod, master thesis project
15 * User: Petr Zverina, petr.zverina@gmail.com
16 * Date: 16:09:51, 10.10.2009
19 /**
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();
34 /**
35 * @return NotationGuiHolder collection
37 public Collection<NotationGuiHolder> getNotationGuiHolders(){
38 return notationGuiHolders.values();
41 /**
42 * @param notationIdentifier is the notation identifier
43 * @return required NotationGuiHolder
45 public NotationGuiHolder getNotationGuiHolder( final String notationIdentifier ){
46 return notationGuiHolders.get(notationIdentifier);
49 /**
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);
57 /**
58 * @return selected notation identifier
60 public String getSelectedNotation() {
61 return selectedNotation;
64 /**
65 * Sets selected notation identifier
66 * @param selectedNotation newly selected identifier
68 public void setSelectedNotation(final String selectedNotation) {
69 this.selectedNotation = selectedNotation;
72 /**
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);
82 /**
83 * @return returns the model holding all settings pages
85 public PageList getSettingPagesModel() {
86 return settingPagesModel;