View Javadoc

1   
2   package org.catacomb.druid.blocks;
3   
4   import org.catacomb.druid.build.Context;
5   import org.catacomb.druid.build.GUIPath;
6   import org.catacomb.druid.gui.base.DruPanel;
7   import org.catacomb.druid.gui.edit.DruButton;
8   
9   
10  
11  public class Button extends AbstractButton {
12  
13  
14      public Button() {
15          super();
16      }
17  
18  
19  
20      public Button(String slab) {
21          super(slab);
22      }
23  
24  
25  
26  
27      public DruPanel instantiatePanel() {
28          return new DruButton(label, action);
29      }
30  
31      public void populatePanel(DruPanel dp, Context ctx, GUIPath gpath) {
32  
33  
34          DruButton drup = (DruButton)dp;
35  
36  
37          if (image != null) {
38              drup.setImage(image);
39          }
40  
41          applyDefaultRollover(drup);
42          applyPadding(drup);
43  
44          drup.able(able);
45  
46          drup.setEffects(realizeEffects(effects, ctx, gpath));
47  
48          if (title == null || title.length() == 0) {
49              if (label == null && image != null) {
50                  drup.setTitle("[image button]");
51              } else {
52                  drup.setTitle(label + " (button)");
53              }
54          }
55      }
56  
57  
58  
59  }