1 2 package org.catacomb.druid.swing; 3 4 import java.awt.Color; 5 6 import javax.swing.JDialog; 7 8 9 public class DDialog extends JDialog { 10 static final long serialVersionUID = 1001; 11 String name = "anon"; 12 13 public DDialog() { 14 this(null, "anon"); 15 } 16 17 public DDialog(DFrame dframe, String s) { 18 super(dframe); 19 name = s; 20 setTitle(s); 21 setBg(LAF.getBackgroundColor()); 22 } 23 24 25 public int[] getIntArraySize() { 26 int[] wh = new int[2]; 27 wh[0] = getWidth(); 28 wh[1] = getHeight(); 29 return wh; 30 } 31 32 33 public void setBg(Color c) { 34 setBackground(c); 35 } 36 37 38 public void setName(String s) { 39 name = s; 40 } 41 42 public String getName() { 43 return name; 44 } 45 46 public void setTitle(String s) { 47 super.setTitle(s); 48 } 49 50 51 public void open() { 52 pack(); 53 setVisible(true); 54 } 55 56 57 public void close() { 58 setVisible(false); 59 } 60 61 public void setPanel(DPanel dp) { 62 getContentPane().add("Center", dp); 63 } 64 65 } 66 67 68 69 70 71 72