當前位置: 首頁>>代碼示例>>Java>>正文


Java Wizard類代碼示例

本文整理匯總了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;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:15,代碼來源:WizardSupport.java

示例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;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:21,代碼來源:WizardSupport.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:18,代碼來源:TAPWelcomePanel.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:20,代碼來源:ResourceDistributorWelcomePanel.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:20,代碼來源:ResourceDistributorCalculationPanel.java

示例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);
    }
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:8,代碼來源:InstructionsPanel.java

示例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);
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:41,代碼來源:InstructionsPanel.java

示例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;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:11,代碼來源:WizardDisplayerImpl.java

示例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
    }
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:14,代碼來源:WizardDisplayerImpl.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:16,代碼來源:TacticsPlanerBranchController.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:13,代碼來源:ResourceDistributorDataReadPanel.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:36,代碼來源:ResourceDistributorSettingsPanel.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:14,代碼來源:ResourceDistributorBranchController.java

示例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;

}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:10,代碼來源:ResourceDistributorCalculationPanel.java

示例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;
}
 
開發者ID:Torridity,項目名稱:dsworkbench,代碼行數:10,代碼來源:ResourceDistributorCalculationPanel.java


注:本文中的org.netbeans.spi.wizard.Wizard類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。