Adds methods to add and remove components to/from the current screen.
package com.valkryst.AsciiPanel;
+import com.valkryst.AsciiPanel.component.AsciiComponent;
import com.valkryst.AsciiPanel.component.AsciiScreen;
import com.valkryst.AsciiPanel.font.AsciiFont;
import com.valkryst.radio.Radio;
@@ -115,4 +116,24 @@ public class AsciiPanel extends Canvas implements Receiver<String> {
draw();
return oldScreen;
}
+
+ /**
+ * Adds a component to the current screen.
+ *
+ * @param component
+ * The component.
+ */
+ public void addComponent(final AsciiComponent component) {
+ currentScreen.addComponent(component);
+ }
+
+ /**
+ * Removes a component from the current screen.
+ *
+ * @param component
+ * The component.
+ */
+ public void removeComponent(final AsciiComponent component) {
+ currentScreen.removeComponent(component);
+ }
}
