All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.panels.TextImagePanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----com.sun.wizards.core.WizardComponent
                                   |
                                   +----com.sun.wizards.core.WizardLeaf
                                           |
                                           +----com.sun.wizards.panels.TextImagePanel

public class TextImagePanel
extends WizardLeaf
The TextImage panel is capable of displaying text (which flows within the width of the panel), as well as images. The objects to be displayed can be assigned to this object, serialized into a file, deserialized from the file, and then displayed.


Graphic of a TextImagePanel


Here is the code for this wizard, which consists of a single panel:


 import com.sun.wizards.core.*;
 import com.sun.wizards.builder.ArchiveWriter;
 import com.sun.wizards.panels.*;
 import SimpleComponent;
 public class SimpleWizardBuilder extends ArchiveWriter
 {
   public SimpleWizardBuilder()
    {
     super();
     this.archiveName = "simpleWizard";
   }
 protected void createClientTree()
   {
     super.createClientTree();
     WizardState wizardState = getWizardState();
     // Create the client panel.
     TextImagePanel samplePanel = new TextImagePanel(wizardState, 
                "Sample Panel Header");
     samplePanel.addImage("sample", 1);
     samplePanel.addText("This is sample text which should flow into 
       the panel and align itself properly if we have built it right. 
       The Network is the Computer.", 0, 2);
     root.addChild(samplePanel);
   }
 protected void setResources()
   {
     super.setResources();
     addResource("Images", wizardRuntimePath, "sample");
   }
 public static void main(String[] args)
   {
     SimpleWizardBuilder simpleWizardBuilder = new SimpleWizardBuilder();
     simpleWizardBuilder.writeArchive();
   }
}

Note that this wizard assumes the "sample" image is located in the base wizard classpath.


Variable Index

 o textPanel
This panel is the container for the text labels and images. Deprecated.

Constructor Index

 o TextImagePanel()
Creates a default text image panel with no text and no image.
 o TextImagePanel(String, Route, WizardTreeManager)
Creates a TextImagePanel with the specified name, the specified route and wizard manager.
 o TextImagePanel(WizardState, String)
Creates a default text image panel with the specified name.

Method Index

 o addImage(String, int)
Add an image to this panel.
 o addRuntimeResources(Vector)
Get the runtime classes required by this panel.
 o addText(String, int, int)
Add a text label to this panel.
 o consoleInteraction()
for Console only (TTY) mode
 o createUI()
Create the user interface for the TextImagePanel.
 o deserialize(DataInput)
Deserialize this panel from the specified input stream.
 o getTextPanel()
Retrieve the container for the panel content.
 o serialize(DataOutput)
Serialize this panel to the specified output stream.

Variables

 o textPanel
 protected InsetsPanel textPanel
Note: textPanel is deprecated.

This panel is the container for the text labels and images.

Constructors

 o TextImagePanel
 public TextImagePanel()
Creates a default text image panel with no text and no image.

 o TextImagePanel
 public TextImagePanel(WizardState wizardState,
                       String name)
Creates a default text image panel with the specified name.

Parameters:
wizardState - The buildtime WizardState.
name - The name for this TextImagePanel.
 o TextImagePanel
 public TextImagePanel(String name,
                       Route route,
                       WizardTreeManager wizardManager)
Creates a TextImagePanel with the specified name, the specified route and wizard manager.

Parameters:
name - The name for this TextImagePanel.
route - The route to the appropriate server side object.
wizardManager - The wizardManager responsible for this component.

Methods

 o getTextPanel
 protected InsetsPanel getTextPanel()
Retrieve the container for the panel content.

 o addText
 public void addText(String text,
                     int alignment,
                     int verticalPosition)
Add a text label to this panel.

Parameters:
text - The text to be added to the panel.
alignment - The alignment of the text to be added to this panel.
verticalPosition - The vertical position for the text label.
 o addImage
 public void addImage(String imageName,
                      int verticalPosition)
Add an image to this panel.

Parameters:
imageName - The name of the image to be added to the panel.
verticalPosition - The vertical position for the image.
 o createUI
 public void createUI()
Create the user interface for the TextImagePanel.

Overrides:
createUI in class WizardLeaf
 o consoleInteraction
 public void consoleInteraction()
for Console only (TTY) mode

Overrides:
consoleInteraction in class WizardComponent
 o serialize
 protected void serialize(DataOutput out)
Serialize this panel to the specified output stream.

Parameters:
out - The output stream to which this panel will be serialized.
Overrides:
serialize in class WizardComponent
 o deserialize
 protected void deserialize(DataInput in)
Deserialize this panel from the specified input stream.

Parameters:
in - The input stream from which this panel will be deserialized.
Overrides:
deserialize in class WizardComponent
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Get the runtime classes required by this panel.

Parameters:
resourceVector - The vector containing all runtime resources for this wizard.
Overrides:
addRuntimeResources in class WizardLeaf

All Packages  Class Hierarchy  This Package  Previous  Next  Index