001: /*
002: * WizardProcessModel.java
003: *
004: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: *
020: */
021:
022: package org.underworldlabs.swing.wizard;
023:
024: import java.util.List;
025: import javax.swing.JPanel;
026:
027: /* ----------------------------------------------------------
028: * CVS NOTE: Changes to the CVS repository prior to the
029: * release of version 3.0.0beta1 has meant a
030: * resetting of CVS revision numbers.
031: * ----------------------------------------------------------
032: */
033:
034: /**
035: * Defines the model for a wizard process.
036: *
037: * @author Takis Diakoumis
038: * @version $Revision: 1.4 $
039: * @date $Date: 2006/05/14 06:56:07 $
040: */
041: public interface WizardProcessModel {
042:
043: /**
044: * Returns the descriptive values for the wizard steps.
045: *
046: * @return the descriptive steps
047: */
048: public String[] getSteps();
049:
050: /**
051: * Increments the current index.
052: */
053: public boolean next();
054:
055: /**
056: * Decrements the current index.
057: */
058: public boolean previous();
059:
060: /**
061: * Returns the step text at the specified index.
062: *
063: * @param index - the index
064: */
065: public String getStep(int index);
066:
067: /**
068: * Returns the title text at the specified index.
069: *
070: * @param index - the index
071: */
072: public String getTitle(int index);
073:
074: /**
075: * Returns the titles for each panel.
076: *
077: * @return the panel titles
078: */
079: public String[] getTitles();
080:
081: /**
082: * Returns the next panel in the wizard and increments the
083: * selected index.
084: *
085: * @return the next panel
086: */
087: public JPanel getNextPanel();
088:
089: /**
090: * Returns the previous panel in the wizard and decrements the
091: * selected index.
092: *
093: * @return the previous panel
094: */
095: public JPanel getPreviousPanel();
096:
097: /**
098: * Returns whether there is a valid panel to be selected next.
099: *
100: * @return true | false
101: */
102: public boolean hasNext();
103:
104: /**
105: * Returns whether there is a valid panel to be selected previous.
106: *
107: * @return true | false
108: */
109: public boolean hasPrevious();
110:
111: /**
112: * Returns the current index in the model.
113: *
114: * @return the currently selected index
115: */
116: public int getSelectedIndex();
117:
118: /**
119: * Returns the index of the specified panel in this model.
120: *
121: * @param panel - the panel
122: * @return the panel index
123: */
124: public int getIndexOf(JPanel panel);
125:
126: /**
127: * Returns the panel at the specified index.
128: *
129: * @param index - the panel to be retrieved
130: */
131: public JPanel getPanelAt(int index);
132:
133: /**
134: * Adds the specified panel to the end of the model.
135: *
136: * @param panel - the panel to be added
137: */
138: public void addPanel(JPanel panel);
139:
140: /**
141: * Returns the number of panel components in this model.
142: *
143: * @return the panel count
144: */
145: public int getPanelCount();
146:
147: /**
148: * Returns a list of panels making up this model.
149: *
150: * @return the panels collection
151: */
152: public List<JPanel> getPanels();
153:
154: /**
155: * Sets the list of panels making up this model.
156: *
157: * @param panels - the panels
158: */
159: public void setPanels(List<JPanel> panels);
160:
161: }
|