MCPcopy Create free account
hub / github.com/PCGen/pcgen / ConvertPanel

Method ConvertPanel

code/src/java/pcgen/gui2/converter/ConvertPanel.java:73–138  ·  view source on GitHub ↗
(List<ConvertSubPanel> bq)

Source from the content-addressed store, hash-verified

71 private final JLabel statusLabel;
72
73 public ConvertPanel(List<ConvertSubPanel> bq)
74 {
75 super(new BorderLayout());
76 statusLabel = new JLabel();
77 TaskStrategyListener tsl = (source, string) -> statusLabel.setText(string);
78 TaskStrategyMessage.addTaskStrategyListener(tsl);
79
80 properties = new ObjectCache();
81 Box buttonBox = Box.createHorizontalBox();
82 prevButton = new JButton("< Previous");
83 prevButton.setMnemonic('P');
84 prevButton.addActionListener(new PreviousButtonListener());
85 prevButton.setEnabled(false); // FUTURE Need to reenable this
86 buttonBox.add(prevButton);
87 nextButton = new JButton("Next >");
88 nextButton.setMnemonic('N');
89 pl = new ProgressListener()
90 {
91 @Override
92 public void progressAllowed(ProgressEvent pe)
93 {
94 if (pe.getID() == ProgressEvent.AUTO_ADVANCE)
95 {
96 proceedToNextPanel();
97 }
98 else
99 {
100 nextButton.setEnabled(true);
101 }
102 }
103
104 @Override
105 public void progressNotAllowed(ProgressEvent pe)
106 {
107 nextButton.setEnabled(false);
108 }
109 };
110 nextButton.addActionListener(arg0 -> proceedToNextPanel());
111 buttonBox.add(nextButton);
112 cancelButton = new JButton("Cancel");
113 cancelButton.addActionListener(arg0 -> checkExit());
114 buttonBox.add(cancelButton);
115 finishButton = new JButton("Finish");
116 finishButton.addActionListener(arg0 -> {
117 PCGenDataConvert.savePrefs();
118 GracefulExit.exit(0);
119 });
120 finishButton.setVisible(false);
121 buttonBox.add(finishButton);
122 basePanel.setPreferredSize(new Dimension(800, 500));
123 JScrollPane jsp = new JScrollPane(basePanel);
124 jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
125 jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
126 add(jsp);
127 JPanel buttonLayout = new JPanel(new GridBagLayout());
128 GridBagConstraints gbc = new GridBagConstraints();
129 Utility.buildRelativeConstraints(gbc, 1, 1, 1.0, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
130 gbc.insets = new Insets(0, 10, 5, 10);

Callers

nothing calls this directly

Calls 11

proceedToNextPanelMethod · 0.95
checkExitMethod · 0.95
savePrefsMethod · 0.95
exitMethod · 0.95
runNextPanelMethod · 0.95
addMethod · 0.65
setVisibleMethod · 0.65
setTextMethod · 0.45
addActionListenerMethod · 0.45

Tested by

no test coverage detected