Salome HOME
Addition of a new scenario to a study is fixed. StudyMenu and NewScenarioMenu are...
[tools/siman.git] / Workspace / Siman / src / org / splat / wapp / PopupMenu.java
1 package org.splat.wapp;
2
3 import java.util.List;
4
5
6 public class PopupMenu extends ContextualMenu {
7
8 //  ==============================================================================================================================
9 //  Constructor
10 //  ==============================================================================================================================
11
12     public PopupMenu () {
13 //  -------------------
14       width  = 186;   // Includes borders (2px) and shadow (4px)
15       height = 2;     // Top and bottom border
16     }
17
18 //  ==============================================================================================================================
19 //  Member functions
20 //  ==============================================================================================================================
21
22     public void addItem (String name, PopupItem item) {
23 //  -------------------------------------------------
24       item.width  = 180;
25       item.height = 22;             // Height of image.selected.png background image
26       this.height += item.height;
27       super.addItem(name, item);
28     }
29
30     public void addSeparator () {
31 //  ---------------------------
32       PopupItem item = new PopupItem();
33       item.width  = 180;
34       item.height = 8;
35       this.height += item.height;
36       super.addItem("", item);
37     }
38
39         @SuppressWarnings({"rawtypes","unchecked"})
40         public List<PopupItem> asList () {
41 //  --------------------------------
42       return (List)items;
43     }
44
45     public PopupItem item (String name) {
46 //  -----------------------------------
47       return (PopupItem)items.get(indices.get(name));
48     }
49 }