Search in sources :

Example 1 with ConvertSubPanel

use of pcgen.gui2.converter.panel.ConvertSubPanel in project pcgen by PCGen.

the class ConvertPanel method runNextPanel.

private void runNextPanel() {
    ConvertSubPanel nextpanel = null;
    do {
        boolean allowPrev = false;
        if (currentPanel >= 0 && currentPanel < queue.size()) {
            allowPrev = queue.get(currentPanel).returnAllowed();
        }
        currentPanel++;
        if (currentPanel < queue.size()) {
            nextpanel = queue.get(currentPanel);
            prepare(nextpanel, allowPrev);
            basePanel.removeAll();
            nextpanel.setupDisplay(basePanel, properties);
            basePanel.repaint();
        } else {
            nextpanel = null;
            showFinishButton();
        }
    } while (nextpanel != null && nextpanel.autoAdvance(properties));
}
Also used : ConvertSubPanel(pcgen.gui2.converter.panel.ConvertSubPanel)

Example 2 with ConvertSubPanel

use of pcgen.gui2.converter.panel.ConvertSubPanel in project pcgen by PCGen.

the class PCGenDataConvert method getConverter.

private static PCGenDataConvert getConverter() {
    PCGenDataConvert frame = new PCGenDataConvert();
    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    List<ConvertSubPanel> panels = new ArrayList<>();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    panels.add(new StartupPanel(gameModeFileLoader, campaignFileLoader));
    final ConvertPanel installPanel = new ConvertPanel(panels);
    frame.addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent wEvent) {
            installPanel.checkExit();
        }
    });
    panels.add(new SourceSelectionPanel());
    panels.add(new GameModePanel(campaignFileLoader));
    panels.add(new CampaignPanel());
    panels.add(new WriteDirectoryPanel());
    panels.add(new SummaryPanel());
    panels.add(new RunConvertPanel(installPanel.getStatusField()));
    frame.getContentPane().add(installPanel);
    frame.pack();
    Utility.centerComponent(frame, false);
    return frame;
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) WriteDirectoryPanel(pcgen.gui2.converter.panel.WriteDirectoryPanel) CampaignPanel(pcgen.gui2.converter.panel.CampaignPanel) ArrayList(java.util.ArrayList) WindowAdapter(java.awt.event.WindowAdapter) RunConvertPanel(pcgen.gui2.converter.panel.RunConvertPanel) SummaryPanel(pcgen.gui2.converter.panel.SummaryPanel) RunConvertPanel(pcgen.gui2.converter.panel.RunConvertPanel) ConvertSubPanel(pcgen.gui2.converter.panel.ConvertSubPanel) WindowEvent(java.awt.event.WindowEvent) GameModePanel(pcgen.gui2.converter.panel.GameModePanel) StartupPanel(pcgen.gui2.converter.panel.StartupPanel) GameModeFileLoader(pcgen.persistence.GameModeFileLoader) SourceSelectionPanel(pcgen.gui2.converter.panel.SourceSelectionPanel)

Aggregations

ConvertSubPanel (pcgen.gui2.converter.panel.ConvertSubPanel)2 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 ArrayList (java.util.ArrayList)1 CampaignPanel (pcgen.gui2.converter.panel.CampaignPanel)1 GameModePanel (pcgen.gui2.converter.panel.GameModePanel)1 RunConvertPanel (pcgen.gui2.converter.panel.RunConvertPanel)1 SourceSelectionPanel (pcgen.gui2.converter.panel.SourceSelectionPanel)1 StartupPanel (pcgen.gui2.converter.panel.StartupPanel)1 SummaryPanel (pcgen.gui2.converter.panel.SummaryPanel)1 WriteDirectoryPanel (pcgen.gui2.converter.panel.WriteDirectoryPanel)1 CampaignFileLoader (pcgen.persistence.CampaignFileLoader)1 GameModeFileLoader (pcgen.persistence.GameModeFileLoader)1