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.
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.
-
textPanel
- This panel is the container for the text labels
and images.
Deprecated.
-
TextImagePanel()
- Creates a default text image panel with no text
and no image.
-
TextImagePanel(String, Route, WizardTreeManager)
- Creates a TextImagePanel with the specified name, the specified
route and wizard manager.
-
TextImagePanel(WizardState, String)
- Creates a default text image panel with the specified
name.
-
addImage(String, int)
- Add an image to this panel.
-
addRuntimeResources(Vector)
- Get the runtime classes required by this panel.
-
addText(String, int, int)
- Add a text label to this panel.
-
consoleInteraction()
- for Console only (TTY) mode
-
createUI()
- Create the user interface for the TextImagePanel.
-
deserialize(DataInput)
- Deserialize this panel from the specified input stream.
-
getTextPanel()
- Retrieve the container for the panel content.
-
serialize(DataOutput)
- Serialize this panel to the specified output stream.
textPanel
protected InsetsPanel textPanel
- Note: textPanel is deprecated.
- This panel is the container for the text labels
and images.
TextImagePanel
public TextImagePanel()
- Creates a default text image panel with no text
and no image.
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.
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.
getTextPanel
protected InsetsPanel getTextPanel()
- Retrieve the container for the panel content.
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.
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.
createUI
public void createUI()
- Create the user interface for the TextImagePanel.
- Overrides:
- createUI in class WizardLeaf
consoleInteraction
public void consoleInteraction()
- for Console only (TTY) mode
- Overrides:
- consoleInteraction in class WizardComponent
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
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
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