de.jdemo.extensions
Class AwtDemoCase

java.lang.Object
  extended by de.jdemo.framework.AbstractDemoCase
      extended by de.jdemo.extensions.GuiDemoCase
          extended by de.jdemo.extensions.AwtDemoCase
All Implemented Interfaces:
IDemo, IDemoCase, java.lang.Cloneable
Direct Known Subclasses:
SwingDemoCase

public abstract class AwtDemoCase
extends GuiDemoCase

Abstract superclass for all demos demonstrating AWT components.

Author:
Markus Gebhard

Constructor Summary
AwtDemoCase()
           
AwtDemoCase(java.lang.String name)
           
 
Method Summary
protected  java.awt.Frame createFrame()
          Convenience method for creating a new Frame object that can be used for demo implementations.
protected  java.awt.Component createParentComponent()
           
protected  java.awt.Image getFrameIconImage()
           
protected  java.lang.String getFrameTitle()
           
protected  void runOnEventDispatchThread(java.lang.Runnable runnable)
           
protected  void setFrameIconImage(java.awt.Image image)
          Sets the image that will be used for the frame icon when showing this demo.
protected  void setFrameTitle(java.lang.String frameTitle)
          Sets the title for the frame being created by this demo case.
protected  void show(java.lang.CharSequence text)
          Shows the given text in a TextArea using a fixed width font.
protected  void show(java.awt.Component component)
          Convenience method for showing any kind of Component object.
protected  void show(java.awt.Component[] components, java.awt.LayoutManager layoutManager)
          Convenience method for showing an array of Component objects.
protected  void show(java.awt.Window window)
          Convenience method for showing any kind of Window object.
protected  void showAsIs(java.awt.Window window)
          Shows the given Window object without modifying its size or position.
protected  void showProportional(java.lang.CharSequence text)
          Shows the given text in a TextArea using a proportional font.
 
Methods inherited from class de.jdemo.extensions.GuiDemoCase
cancel, clone, createRunnable, disposeDemoWindow, executeTearDown, exit, getRegisteredDemoWindow, isRegisteredDemoWindowOpened, registerDemoWindow, setRegisteredDemoWindowOpened
 
Methods inherited from class de.jdemo.framework.AbstractDemoCase
accept, after, assertNotNull, assertNull, assertTrue, before, createThreadGroup, executeSetUp, fail, getClone, getIdentifier, getName, getRunnable, runDemo, setName, setRunnable, setUp, tearDown, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AwtDemoCase

public AwtDemoCase()

AwtDemoCase

public AwtDemoCase(java.lang.String name)
Method Detail

show

protected void show(java.awt.Component component)
Convenience method for showing any kind of Component object. The frame provided to this object will also be registred as demo window for this GuiDemoCase.


show

protected void show(java.awt.Component[] components,
                    java.awt.LayoutManager layoutManager)
Convenience method for showing an array of Component objects. The frame containing the components will also be registered as demo window for this democase. The specified layout manager will be used to lay out the components.


show

protected void show(java.awt.Window window)
Convenience method for showing any kind of Window object. The given object will also be registred as demo window for this democase (if not being registered already). Note that the window will be packed, centered on the screen and made non-modal if being a dialog.

See Also:
showAsIs(Window)

runOnEventDispatchThread

protected void runOnEventDispatchThread(java.lang.Runnable runnable)

showAsIs

protected void showAsIs(java.awt.Window window)
Shows the given Window object without modifying its size or position. The given object will also be registred as demo window for this democase. Note that the window will be made non-modal if being a dialog.

See Also:
show(Window)

createFrame

protected java.awt.Frame createFrame()
Convenience method for creating a new Frame object that can be used for demo implementations. The frame is automatically registered as demo window and decorated with the necessary window listener, icon, title, etc.

See Also:
show(Window), show(Component)

createParentComponent

protected java.awt.Component createParentComponent()

getFrameTitle

protected java.lang.String getFrameTitle()

setFrameTitle

protected void setFrameTitle(java.lang.String frameTitle)
Sets the title for the frame being created by this demo case. Setting it to null (default) will set the title to the name of the demo.

See Also:
createFrame()

getFrameIconImage

protected java.awt.Image getFrameIconImage()

setFrameIconImage

protected void setFrameIconImage(java.awt.Image image)
Sets the image that will be used for the frame icon when showing this demo.


show

protected void show(java.lang.CharSequence text)
Shows the given text in a TextArea using a fixed width font.

See Also:
showProportional(CharSequence)

showProportional

protected void showProportional(java.lang.CharSequence text)
Shows the given text in a TextArea using a proportional font.

See Also:
show(CharSequence)


JDemo homepage: http://www.jdemo.de
Copyright © 2003-2008 Markus Gebhard. All Rights Reserved.