home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.util.ResourceUtil;
- import asp.wizard.def.DefAbstract;
- import asp.wizard.def.DefCollection;
- import asp.wizard.def.DefPage;
- import asp.wizard.def.LayoutGeneratorEvent;
- import asp.wizard.def.LayoutGeneratorListener;
- import java.awt.Component;
- import java.awt.Dialog;
-
- class GenProgressDisplay implements LayoutGeneratorListener {
- private int _pageCount;
- private int _currPageIndex;
- private int _pageIncrement;
- private int _objectCount;
- private int _currObjectIndex;
- private int _objectIncrement;
- // $FF: synthetic field
- static Class class$asp$wizard$WizardManager;
-
- public void genStarted(LayoutGeneratorEvent e) {
- ProgressStatus ps = ProgressStatus.getInstance();
- DefPage firstDefPage = (DefPage)e.getCurrDefAbstract();
- this._pageCount = firstDefPage.getDescendantCount() + 1;
- this._pageIncrement = 100 / this._pageCount;
- this._currPageIndex = 0;
- ps.reset();
- ((Dialog)ps).setTitle(ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WizardManager != null ? class$asp$wizard$WizardManager : (class$asp$wizard$WizardManager = class$("asp.wizard.WizardManager")), "window.title.generate"));
- ((Component)ps).setVisible(true);
- }
-
- public void genEnded(LayoutGeneratorEvent evt) {
- ProgressStatus ps = ProgressStatus.getInstance();
- ps.setValue(100);
- Thread.yield();
- ((Component)ps).setVisible(false);
- }
-
- public void genObjectStarted(LayoutGeneratorEvent e) {
- if (e.getCurrDefAbstract() instanceof DefPage) {
- DefPage currPage = (DefPage)e.getCurrDefAbstract();
- StringBuffer sb = new StringBuffer();
- sb.append(((DefAbstract)currPage).getName());
- sb.append(" (");
- sb.append(this._currPageIndex + 1);
- sb.append("/");
- sb.append(this._pageCount);
- sb.append(")");
- ProgressStatus.getInstance().setText(((DefAbstract)currPage).getName());
- this._objectCount = ((DefCollection)currPage).getElementCount();
- this._currObjectIndex = 0;
- } else if (!(e.getCurrDefAbstract() instanceof DefCollection)) {
- DefAbstract singleObj = e.getCurrDefAbstract();
- DefCollection currPage = singleObj.getParent();
- StringBuffer sb = new StringBuffer();
- if (currPage != null) {
- sb.append(((DefAbstract)currPage).getName());
- sb.append(" (");
- sb.append(this._currPageIndex + 1);
- sb.append("/");
- sb.append(this._pageCount);
- sb.append(")");
- sb.append(" - ");
- }
-
- sb.append(singleObj.getName());
- sb.append(" (");
- sb.append(this._currObjectIndex + 1);
- sb.append("/");
- sb.append(this._objectCount);
- sb.append(")");
- ProgressStatus.getInstance().setText(sb.toString());
- }
-
- }
-
- public void genObjectEnded(LayoutGeneratorEvent e) {
- if (e.getCurrDefAbstract() instanceof DefPage) {
- if (this._pageCount > 0) {
- ProgressStatus.getInstance().setValue(++this._currPageIndex * 100 / this._pageCount);
- }
- } else if (!(e.getCurrDefAbstract() instanceof DefCollection) && this._objectCount > 0 && this._pageCount > 0) {
- ++this._currObjectIndex;
- int value = (this._currPageIndex * this._objectCount * this._pageCount + this._currObjectIndex * this._pageCount) * 100 / (this._pageCount * this._pageCount * this._objectCount);
- ProgressStatus.getInstance().setValue(value);
- }
-
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-