import java.awt.*; /* * ButtonMaker.java * * Created on May 17, 2002, 3:39 PM */ /** * * @author levenick * @version */ import io.*; public class ButtonMaker extends AbstractMaker { public String getName() { return "Buttons"; } public String createDeclSource(Object o) { Button aButton = (Button) o; String theButtonName = aButton.getLabel(); returnMe = ""; emit(1, "Button " + theButtonName + " = new Button(\"" + theButtonName + "\");\n"); return returnMe; } public String createSource(Object o) { Button aButton = (Button) o; String theButtonName = aButton.getLabel(); Rectangle r = aButton.getBounds(); emitCreateComponent(r, "Button", theButtonName); emitActionListener(theButtonName, "theTA.append(\"greetings from: " + theButtonName + "\\n\");"); emitAddComponent(theButtonName); return returnMe; } }