Example #1
0
  public static PCGenDataConvert getConverter(CDOMObject pc) throws InterruptedException {
    PCGenDataConvert frame = new PCGenDataConvert();
    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    List<ConvertSubPanel> panels = new ArrayList<ConvertSubPanel>();
    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()));
    panels.add(new MessagePanel("PCGen Data Conversion Complete!", ProgressEvent.NOT_ALLOWED));

    frame.getContentPane().add(installPanel);
    frame.pack();
    Utility.centerFrame(frame, false);
    return frame;
  }
Example #2
0
  public void initialize() {
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    getContentPane().setLayout(gridbag);
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new Insets(2, 2, 2, 2);

    int col = 0;
    Utility.buildConstraints(c, col, 0, 1, 1, 100, 20);
    JLabel label =
        new JLabel(LanguageBundle.getFormattedString("in_SolverView_Perspective")); // $NON-NLS-1$
    gridbag.setConstraints(label, c);
    getContentPane().add(label);

    Utility.buildConstraints(c, col++, 1, 1, 1, 0, 20);
    gridbag.setConstraints(identifierChooser, c);
    getContentPane().add(identifierChooser);

    Utility.buildConstraints(c, col++, 1, 1, 1, 0, 20);
    gridbag.setConstraints(scopeChooser, c);
    getContentPane().add(scopeChooser);

    Utility.buildConstraints(c, col++, 1, 1, 1, 0, 20);
    gridbag.setConstraints(objectChooser, c);
    getContentPane().add(objectChooser);

    Utility.buildConstraints(c, col++, 1, 1, 1, 0, 20);
    label =
        new JLabel(
            LanguageBundle.getFormattedString("in_SolverView_VarName") // $NON-NLS-1$
            );
    gridbag.setConstraints(label, c);
    getContentPane().add(label);

    Utility.buildConstraints(c, col++, 1, 1, 1, 0, 20);
    gridbag.setConstraints(varName, c);
    getContentPane().add(varName);

    tableModel = new SolverTableModel();
    viewTable = new JTable(tableModel);

    viewTable.getColumnModel().getColumn(0).setPreferredWidth(25);
    viewTable.getColumnModel().getColumn(1).setPreferredWidth(50);
    viewTable.getColumnModel().getColumn(2).setPreferredWidth(25);
    viewTable.getColumnModel().getColumn(3).setPreferredWidth(50);

    Utility.buildConstraints(c, 0, 2, col, 1, 0, 1000);
    JScrollPane pane = new JScrollPane(viewTable);
    viewTable.setFillsViewportHeight(true);
    pane.setPreferredSize(new Dimension(500, 300));
    gridbag.setConstraints(pane, c);
    getContentPane().add(pane);

    setTitle("Core Variable Debug View");
    getContentPane().setSize(500, 400);
    pack();
    Utility.centerFrame(this, true);
  }