home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
WizardPanel.java
< prev
next >
Wrap
Text File
|
1998-10-04
|
5KB
|
215 lines
package com.symantec.itools.frameworks.wizard;
import java.awt.*;
import java.util.Vector;
import com.sun.java.swing.JPanel;
/**
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public class WizardPanel
extends JPanel
implements WizardPage,
WizardSummaryPage
{
/**
* @since VCafe 3.0
*/
protected WizardController controller;
protected WizardPanel()
{
}
protected WizardPanel(WizardController c)
{
controller = c;
}
/**
* @param c TODO
* @since VCafe 3.0
*/
public void setWizardController(WizardController c)
{
controller = c;
}
/**
* @since VCafe 3.0
*/
public WizardController getWizardController()
{
return controller;
}
/**
* @since VCafe 3.0
*/
public String getPanelTitle()
{
return null;
}
/**
* @param currentCursor TODO
* @since VCafe 3.0
*/
public synchronized void setAllCursors(Cursor currentCursor)
{
Wizard wiz = null;
if (controller != null)
{
wiz = controller.getWizard();
if (wiz != null)
{
wiz.setCursor(currentCursor);
setAllContainedCursors(wiz, currentCursor);
Component parent = wiz.getParentFrame();
if (parent != null)
parent.setCursor(currentCursor);
}
}
}
/**
* @param outerContainer TODO
* @param currentCursor TODO
* @since VCafe 3.0
*/
private void setAllContainedCursors(Container outerContainer, Cursor currentCursor)
{
Component[] allComponents = getAllComponents(outerContainer);
for (int i = 0; i < allComponents.length; i++)
{
allComponents[i].setCursor(currentCursor);
}
}
/**
* @param parent TODO
* @since VCafe 3.0
*/
private synchronized Component[] getAllComponents(Container parent)
{
Vector holdComponents = new Vector();
Component[] ret = null;
if (parent != null)
{
// set current container
Container current = parent;
int vectorPos = -1;
while (current != null)
{
// Add all the containers components to the holdComponents vector
Component[] c = current.getComponents();
if (c != null)
{
for (int i = 0; i < c.length; i++)
{
holdComponents.addElement(c[i]);
}
}
// increment the position pointer within the vector and reset current container to null
vectorPos++;
current = null;
while (holdComponents.size() > vectorPos)
{
// walk through existing vector searching for next container
Component temp = (Component) holdComponents.elementAt(vectorPos);
if (temp instanceof Container)
{
// when the container is found, break
current = (Container) temp;
break;
}
else
{
// keep looking
vectorPos++;
}
}
}
// build component array when all components have been found
if (holdComponents.size() > 0)
{
int count = holdComponents.size();
ret = new Component[count];
holdComponents.copyInto(ret);
}
}
return ret;
}
/**
* @since VCafe 3.0
*/
public void entering()
{
}
/**
* @since VCafe 3.0
*/
public boolean exiting()
{
return (true);
}
/**
* @since VCafe 3.0
*/
public void finish()
{
}
/**
* @since VCafe 3.0
*/
public void cancel()
{
}
/**
* @param dataName TODO
* @since VCafe 3.0
*/
public Object getData(String dataName)
{
return (null);
}
/**
* @since VCafe 3.0
*/
public Summary getSummary()
{
return (null);
}
/**
* @since VCafe 3.0
*/
public WizardSummary getWizardSummary()
{
return (null);
}
}