de.jdemo.extensions
Class SwingDemoCase

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

public abstract class SwingDemoCase
extends AwtDemoCase

Abstract superclass for all demos demonstrating Swing (JFC) components.

Author:
Markus Gebhard

Constructor Summary
SwingDemoCase()
           
SwingDemoCase(java.lang.String name)
           
 
Method Summary
protected  javax.swing.JFrame createJFrame()
          Convenience method for creating a new JFrame object that can be used for demo implementations.
protected  java.awt.Component createParentComponent()
           
 void executeSetUp()
          Called by the DemoCaseRunner to invoke the setUp method.
 java.lang.String getConfiguredLookAndFeelClassName()
           
static void installLookAndFeel(java.lang.String name, java.lang.String lookAndFeelClassName)
          Installs the given LookAndFeel if it is not yet installed.
static boolean isInstalledLookAndFeel(java.lang.String name)
           
 void setConfiguredLookAndFeelClassName(java.lang.String configuredLookAndFeelClassName)
          Sets the configured LookAndFeel class name, that shall be used when showing Swing components.
 void setCrossPlatformLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelCrossPlatform()
protected  void setFrameIcon(javax.swing.Icon icon)
          Sets the icon that will be used for the frame when showing this democase.
 void setGtkLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelGtk()
 void setLookAndFeel(java.lang.String lookAndFeelClassName)
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeel(String)
 void setMacLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelMac()
 void setMotifLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelMotif()
protected  void setPreferredLookAndFeel(java.lang.String lookAndFeelClassName)
          Sets the preferred LookAndFeel for this demo to the one represented by the given LookAndFeel class name.
protected  void setPreferredLookAndFeelCrossPlatform()
          Sets the preferred LookAndFeel for this demo to the Java Cross Platform LookAndFeel.
protected  void setPreferredLookAndFeelGtk()
          Sets the preferred LookAndFeel for this demo to the Gtk LookAndFeel (com.sun.java.swing.plaf.gtk.GTKLookAndFeel).
protected  void setPreferredLookAndFeelMac()
          Sets the preferred LookAndFeel for this demo to the Mac LookAndFeel (com.sun.java.swing.plaf.mac.MacLookAndFeel).
protected  void setPreferredLookAndFeelMotif()
          Sets the preferred LookAndFeel for this demo to the Motif LookAndFeel (com.sun.java.swing.plaf.motif.MotifLookAndFeel).
protected  void setPreferredLookAndFeelSystem()
          Sets the preferred LookAndFeel for this demo to the system's native LookAndFeel.
protected  void setPreferredLookAndFeelWindows()
          Sets the preferred LookAndFeel for this demo to the Windows LookAndFeel (com.sun.java.swing.plaf.windows.WindowsLookAndFeel).
 void setSystemLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelSystem()
 void setWindowsLookAndFeel()
          Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelWindows()
protected  void show(java.lang.CharSequence text)
          Shows the given text in a JTextPane using a fixed width font.
protected  void show(javax.swing.Icon icon)
          Convenience method for showing a Icon object.
protected  void show(javax.swing.Icon[] icons, java.awt.LayoutManager layoutManager)
          Convenience method for showing an array of Icon objects.
protected  void show(java.awt.Image image)
          Convenience method for showing a Image object.
protected  void show(java.awt.Image[] images, java.awt.LayoutManager layoutManager)
          Convenience method for showing an array of Image objects.
protected  void show(javax.swing.JComponent component)
          Convenience method for showing any kind of JComponent object.
protected  void show(javax.swing.JPopupMenu popup)
           
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.AwtDemoCase
createFrame, getFrameIconImage, getFrameTitle, runOnEventDispatchThread, setFrameIconImage, setFrameTitle, show, show, show, showAsIs
 
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, 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

SwingDemoCase

public SwingDemoCase()

SwingDemoCase

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

executeSetUp

public void executeSetUp()
                  throws java.lang.Exception
Description copied from class: AbstractDemoCase
Called by the DemoCaseRunner to invoke the setUp method. Should not be called from within a demo.

Overrides:
executeSetUp in class AbstractDemoCase
Throws:
java.lang.Exception

show

protected void show(javax.swing.JComponent component)
Convenience method for showing any kind of JComponent object. The frame provided to this object will also be registred as demo window for this democase.


show

protected void show(javax.swing.JPopupMenu popup)

show

protected void show(java.awt.Image image)
Convenience method for showing a Image object. The frame containing the image will also be registered as demo window for this democase.


show

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


show

protected void show(javax.swing.Icon icon)
Convenience method for showing a Icon object. The frame containing the icon will also be registered as demo window for this democase.


show

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


show

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

Overrides:
show in class AwtDemoCase
See Also:
showProportional(CharSequence)

showProportional

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

Overrides:
showProportional in class AwtDemoCase
See Also:
show(CharSequence)

createParentComponent

protected java.awt.Component createParentComponent()
Overrides:
createParentComponent in class AwtDemoCase

createJFrame

protected javax.swing.JFrame createJFrame()
Convenience method for creating a new JFrame object that can be used for demo implementations.

See Also:
show(Image), AwtDemoCase.show(Component)

setFrameIcon

protected void setFrameIcon(javax.swing.Icon icon)
Sets the icon that will be used for the frame when showing this democase.


setSystemLookAndFeel

public void setSystemLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelSystem()


setPreferredLookAndFeelSystem

protected void setPreferredLookAndFeelSystem()
Sets the preferred LookAndFeel for this demo to the system's native LookAndFeel. Note that the LookAndFeel might be overridden by the demo runner.


setCrossPlatformLookAndFeel

public void setCrossPlatformLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelCrossPlatform()


setPreferredLookAndFeelCrossPlatform

protected void setPreferredLookAndFeelCrossPlatform()
Sets the preferred LookAndFeel for this demo to the Java Cross Platform LookAndFeel. Note that the LookAndFeel might be overridden by the demo runner.


setMotifLookAndFeel

public void setMotifLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelMotif()


setPreferredLookAndFeelMotif

protected void setPreferredLookAndFeelMotif()
Sets the preferred LookAndFeel for this demo to the Motif LookAndFeel (com.sun.java.swing.plaf.motif.MotifLookAndFeel). Note that this LookAndFeel might not be supported on some systems. Also note that the LookAndFeel might be overridden by the demo runner.


setWindowsLookAndFeel

public void setWindowsLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelWindows()


setPreferredLookAndFeelWindows

protected void setPreferredLookAndFeelWindows()
Sets the preferred LookAndFeel for this demo to the Windows LookAndFeel (com.sun.java.swing.plaf.windows.WindowsLookAndFeel). Note that this LookAndFeel might not be supported on some systems. Also note that the LookAndFeel might be overridden by the demo runner.


setMacLookAndFeel

public void setMacLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelMac()


setPreferredLookAndFeelMac

protected void setPreferredLookAndFeelMac()
Sets the preferred LookAndFeel for this demo to the Mac LookAndFeel (com.sun.java.swing.plaf.mac.MacLookAndFeel). Note that this LookAndFeel might not be supported on some systems. Also note that the LookAndFeel might be overridden by the demo runner.


setGtkLookAndFeel

public void setGtkLookAndFeel()
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeelGtk()


setPreferredLookAndFeelGtk

protected void setPreferredLookAndFeelGtk()
Sets the preferred LookAndFeel for this demo to the Gtk LookAndFeel (com.sun.java.swing.plaf.gtk.GTKLookAndFeel). Note that this LookAndFeel might not be supported on some systems.


setLookAndFeel

public void setLookAndFeel(java.lang.String lookAndFeelClassName)
Deprecated. As of Jul 21, 2004 (Markus Gebhard), replaced by setPreferredLookAndFeel(String)


setPreferredLookAndFeel

protected void setPreferredLookAndFeel(java.lang.String lookAndFeelClassName)
Sets the preferred LookAndFeel for this demo to the one represented by the given LookAndFeel class name. Note that the LookAndFeel might be overridden by the demo runner.


installLookAndFeel

public static void installLookAndFeel(java.lang.String name,
                                      java.lang.String lookAndFeelClassName)
Installs the given LookAndFeel if it is not yet installed. Does nothing otherwise.


isInstalledLookAndFeel

public static boolean isInstalledLookAndFeel(java.lang.String name)

setConfiguredLookAndFeelClassName

public void setConfiguredLookAndFeelClassName(java.lang.String configuredLookAndFeelClassName)
Sets the configured LookAndFeel class name, that shall be used when showing Swing components. This method should not be called from within a demo implementation. Instead it might be called by a demo runner (e.g. a screen capture) to superceede the preferred LookAndFeel for this demo.


getConfiguredLookAndFeelClassName

public java.lang.String getConfiguredLookAndFeelClassName()


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