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.DruInfoEffect;
7   import org.catacomb.druid.gui.base.DruPanel;
8   import org.catacomb.druid.gui.edit.DruButton;
9   
10  
11  
12  public class InfoButton extends AbstractButton {
13  
14  
15      public String text;
16  
17      public InfoButton() {
18          super();
19      }
20  
21  
22  
23  
24      public DruPanel instantiatePanel() {
25          return new DruButton("?");
26      }
27  
28      public void populatePanel(DruPanel dp, Context ctx, GUIPath gpath) {
29  
30  
31          DruButton drup = (DruButton)dp;
32  
33  
34          if (image != null) {
35              drup.setImage(image);
36          }
37  
38          applyDefaultRollover(drup);
39          applyPadding(drup);
40  
41  
42          drup.addEffect(new DruInfoEffect(title, text, ctx.getInfoAggregator()));
43  
44          drup.setTip(tip);
45  
46      }
47  
48  
49  
50  }