本文整理汇总了Java中org.netbeans.spi.wizard.Wizard类的典型用法代码示例。如果您正苦于以下问题:Java Wizard类的具体用法?Java Wizard怎么用?Java Wizard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Wizard类属于org.netbeans.spi.wizard包,在下文中一共展示了Wizard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLoadSavedGameButton
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
private JRadioButton createLoadSavedGameButton(final WizardController controller, final Map settings) {
JRadioButton b = new JRadioButton(Resources.getString("WizardSupport.LoadSavedGame")); //$NON-NLS-1$
b.addActionListener(new ActionListener() {
@SuppressWarnings("unchecked")
public void actionPerformed(ActionEvent e) {
settings.put(WizardSupport.ACTION_KEY, LOAD_GAME_ACTION);
Wizard wiz = new BranchingWizard(new LoadSavedGamePanels(), POST_LOAD_GAME_WIZARD).createWizard();
settings.put(POST_INITIAL_STEPS_WIZARD, wiz);
controller.setForwardNavigationMode(WizardController.MODE_CAN_CONTINUE);
controller.setProblem(null);
}
});
return b;
}
示例2: createPlayOfflineButton
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
private JRadioButton createPlayOfflineButton(final WizardController controller, final Map settings) {
JRadioButton b = new JRadioButton(Resources.getString("WizardSupport.PlayOffline")); //$NON-NLS-1$
b.addActionListener(new ActionListener() {
@SuppressWarnings("unchecked")
public void actionPerformed(ActionEvent e) {
GameModule.getGameModule().getGameState().setup(false);
settings.put(WizardSupport.ACTION_KEY, PLAY_OFFLINE_ACTION);
final WizardPanelProvider panels = createPlayOfflinePanels();
if (panels == null) {
controller.setForwardNavigationMode(WizardController.MODE_CAN_FINISH);
}
else {
Wizard wiz = new BranchingWizard(panels, POST_PLAY_OFFLINE_WIZARD).createWizard();
settings.put(POST_INITIAL_STEPS_WIZARD, wiz);
controller.setForwardNavigationMode(WizardController.MODE_CAN_CONTINUE);
}
}
});
return b;
}
示例3: allowNext
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowNext(String string, Map map, Wizard wizard) {
int type = ATTACK_TYPE;
if (jDefenseButton.isSelected()) {
type = DEFENSE_TYPE;
} else if (jRefillButton.isSelected()) {
type = REFILL_TYPE;
} else if (jRetimeButton.isSelected()) {
type = RETIME_TYPE;
}
TAPAttackInfoPanel.getSingleton().setVisible(type == ATTACK_TYPE);
map.put(TYPE, type);
return WizardPanelNavResult.PROCEED;
}
示例4: allowNext
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowNext(String string, Map map, Wizard wizard) {
if (jLoadButton.isSelected()) {
if (!ResourceDistributorFinishPanel.getSingleton().loadTransports()) {
JOptionPaneHelper.showWarningBox(ResourceDistributorWelcomePanel.this, "Keine gespeicherten Transporte gefunden.\nBitte starte eine neue Berechnung.", "Warnung");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
}
int type = BALANCE_DISTRIBUTION;
if (jFillButton.isSelected()) {
type = FILL_DISTRIBUTION;
} else if (jLoadButton.isSelected()) {
type = LOAD_DISTRIBUTION;
}
ResourceDistributorDataReadPanel.getSingleton().setup(type);
map.put(TYPE, type);
return WizardPanelNavResult.PROCEED;
}
示例5: allowNext
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowNext(String string, Map map, Wizard wizard) {
if (calculator == null) {
setProblem("Noch keine Berechnung durchgeführt");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
if (calculator != null && calculator.isRunning()) {
setProblem("Berechnung läuft...");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
if (!transportsAlreadyTransferred) {
ResourceDistributorFinishPanel.getSingleton().setup();
transportsAlreadyTransferred = true;
} else {
ResourceDistributorFinishPanel.getSingleton().focusSubmit();
}
return WizardPanelNavResult.PROCEED;
}
示例6: InstructionsPanel
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
public InstructionsPanel (Wizard wiz) {
this (null, wiz);
Font f = UIManager.getFont ("Tree.font"); //NOI18N
if (f != null) {
setFont (f);
}
}
示例7: getPreferredSize
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
public Dimension getPreferredSize() {
Font f = getFont() != null ? getFont() :
UIManager.getFont("controlFont"); //NOI18N
Graphics g = getGraphics();
if (g == null) {
g = new BufferedImage (1, 1, BufferedImage.TYPE_INT_ARGB).getGraphics();
}
f = f.deriveFont (Font.BOLD);
FontMetrics fm = g.getFontMetrics(f);
Insets ins = getInsets();
int h = fm.getHeight();
String[] steps = wizard.getAllSteps();
int w = Integer.MIN_VALUE;
for (int i=0; i < steps.length; i++) {
String desc = i + ". " + (Wizard.UNDETERMINED_STEP.equals(steps[i]) ?
NbBridge.getString ("org/netbeans/modules/wizard/Bundle", //NOI18N
InstructionsPanel.class, "elipsis") : //NOI18N
wizard.getStepDescription(steps[i]));
if (desc != null) {
w = Math.max (w, fm.stringWidth(desc) + MARGIN);
}
}
if (Integer.MIN_VALUE == w) {
w = 250;
}
h = ((h + 3) * steps.length);
minSize.width = w;
minSize.height = h;
if (img != null) {
w = Math.max (w, img.getWidth());
h = Math.max(h, img.getHeight());
}
h = h + ins.top + ins.bottom;
//Make sure we can grow but not shrink
w = Math.max (w, historicWidth);
historicWidth = w;
return new Dimension (w, h);
}
示例8: install
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
public void install (Container c, Object layoutConstraint, Wizard awizard,
Action helpAction, Map initialProperties, WizardResultReceiver receiver) {
JPanel pnl = createOuterPanel (awizard, new Rectangle(), helpAction, initialProperties);
if (layoutConstraint != null) {
c.add (pnl, layoutConstraint);
} else {
c.add (pnl);
}
this.receiver = receiver;
}
示例9: checkLegalNavMode
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
static void checkLegalNavMode(int i)
{
switch (i)
{
case Wizard.MODE_CAN_CONTINUE:
case Wizard.MODE_CAN_CONTINUE_OR_FINISH:
case Wizard.MODE_CAN_FINISH:
return;
default:
throw new IllegalArgumentException("Illegal forward " + // NOI18N
"navigation mode: " + i); // NOI18N
}
}
示例10: getWizardForStep
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
protected Wizard getWizardForStep(String step, Map settings) {
if (TAPWelcomePanel.getStep().equals(step)) {
if (TAPWelcomePanel.ATTACK_TYPE.equals(settings.get(TAPWelcomePanel.TYPE))) {
return ATTACK_PATH;
} else if (TAPWelcomePanel.DEFENSE_TYPE.equals(settings.get(TAPWelcomePanel.TYPE))) {
return DEFENSE_PATH;
} else if (TAPWelcomePanel.REFILL_TYPE.equals(settings.get(TAPWelcomePanel.TYPE))) {
return REFILL_PATH;
} else if (TAPWelcomePanel.RETIME_TYPE.equals(settings.get(TAPWelcomePanel.TYPE))) {
return RETIME_PATH;
}
}
return null;
}
示例11: allowNext
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowNext(String string, Map map, Wizard wizard) {
if (getModel().getRowCount() == 0) {
setProblem("Keine Einträge vorhanden");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
ResourceDistributorSettingsPanel.getSingleton().setup();
ResourceDistributorCalculationPanel.getSingleton().setup(!ResourceDistributorWelcomePanel.BALANCE_DISTRIBUTION.equals(map.get(ResourceDistributorWelcomePanel.TYPE)));
return WizardPanelNavResult.PROCEED;
}
示例12: allowNext
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowNext(String string, Map map, Wizard wizard) {
boolean hasReceiver = false;
boolean hasSender = false;
if (getModel().getRowCount() == 0) {
setProblem("Keine Dörfer vorhanden");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
for (VillageMerchantInfo info : getAllElements()) {
if (info.getDirection().equals(VillageMerchantInfo.Direction.BOTH)) {
hasSender = true;
hasReceiver = true;
} else if (info.getDirection().equals(VillageMerchantInfo.Direction.OUTGOING)) {
hasSender = true;
} else if (info.getDirection().equals(VillageMerchantInfo.Direction.INCOMING)) {
hasReceiver = true;
}
if (hasSender && hasReceiver) {
break;
}
}
if (!hasSender) {
setProblem("Keine Lieferanten angegeben");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
if (!hasReceiver) {
setProblem("Keine Empfänger angegeben");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
ResourceDistributorCalculationPanel.getSingleton().setup(ResourceDistributorWelcomePanel.FILL_DISTRIBUTION.equals(getWizardDataMap().get(ResourceDistributorWelcomePanel.TYPE)));
return WizardPanelNavResult.PROCEED;
}
示例13: getWizardForStep
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
protected Wizard getWizardForStep(String step, Map settings) {
if (ResourceDistributorWelcomePanel.getStep().equals(step)) {
if (ResourceDistributorWelcomePanel.BALANCE_DISTRIBUTION.equals(settings.get(ResourceDistributorWelcomePanel.TYPE))) {
return BALANCE_TYPE_PATH;
} else if (ResourceDistributorWelcomePanel.FILL_DISTRIBUTION.equals(settings.get(ResourceDistributorWelcomePanel.TYPE))) {
return FILL_TYPE_PATH;
} else if (ResourceDistributorWelcomePanel.LOAD_DISTRIBUTION.equals(settings.get(ResourceDistributorWelcomePanel.TYPE))) {
return DATA_LOAD_PATH;
}
}
return null;
}
示例14: allowBack
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowBack(String string, Map map, Wizard wizard) {
if (calculator != null && calculator.isRunning()) {
setProblem("Berechnung läuft...");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
return WizardPanelNavResult.PROCEED;
}
示例15: allowFinish
import org.netbeans.spi.wizard.Wizard; //导入依赖的package包/类
@Override
public WizardPanelNavResult allowFinish(String string, Map map, Wizard wizard) {
if (calculator != null && calculator.isRunning()) {
setProblem("Berechnung läuft...");
return WizardPanelNavResult.REMAIN_ON_PAGE;
}
return WizardPanelNavResult.PROCEED;
}