|
@@ -33,7 +33,6 @@ import javax.swing.JList;
|
33
|
33
|
import javax.swing.JPanel;
|
34
|
34
|
import javax.swing.JScrollPane;
|
35
|
35
|
import javax.swing.ListSelectionModel;
|
36
|
|
-import javax.swing.SwingUtilities;
|
37
|
36
|
import javax.swing.UIManager;
|
38
|
37
|
import javax.swing.event.ListSelectionEvent;
|
39
|
38
|
import javax.swing.event.ListSelectionListener;
|
|
@@ -43,9 +42,9 @@ import javax.swing.text.html.HTMLEditorKit;
|
43
|
42
|
import net.miginfocom.swing.MigLayout;
|
44
|
43
|
|
45
|
44
|
/**
|
46
|
|
- * License panel.
|
|
45
|
+ * Licences panel.
|
47
|
46
|
*/
|
48
|
|
-public final class LicensePanel extends JPanel implements ListSelectionListener {
|
|
47
|
+public final class LicencesPanel extends JPanel implements ListSelectionListener {
|
49
|
48
|
|
50
|
49
|
/**
|
51
|
50
|
* A version number for this class. It should be changed whenever the class
|
|
@@ -53,19 +52,19 @@ public final class LicensePanel extends JPanel implements ListSelectionListener
|
53
|
52
|
* objects being unserialized with the new class).
|
54
|
53
|
*/
|
55
|
54
|
private static final long serialVersionUID = 3;
|
56
|
|
- /** License scroll pane. */
|
|
55
|
+ /** Licence scroll pane. */
|
57
|
56
|
private JScrollPane scrollPane;
|
58
|
|
- /** License list model */
|
59
|
|
- private GenericListModel<License> listModel;
|
60
|
|
- /** License textpane. */
|
61
|
|
- private JEditorPane license;
|
62
|
|
- /** License list. */
|
|
57
|
+ /** Licence list model */
|
|
58
|
+ private GenericListModel<Licence> listModel;
|
|
59
|
+ /** Licence textpane. */
|
|
60
|
+ private JEditorPane licence;
|
|
61
|
+ /** Licence list. */
|
63
|
62
|
private JList list;
|
64
|
63
|
/** Selected index. */
|
65
|
64
|
private int selectedIndex;
|
66
|
65
|
|
67
|
|
- /** Creates a new instance of LicensePanel. */
|
68
|
|
- public LicensePanel() {
|
|
66
|
+ /** Creates a new instance of LicencesPanel. */
|
|
67
|
+ public LicencesPanel() {
|
69
|
68
|
super();
|
70
|
69
|
|
71
|
70
|
initComponents();
|
|
@@ -94,19 +93,19 @@ public final class LicensePanel extends JPanel implements ListSelectionListener
|
94
|
93
|
/** Initialises the components. */
|
95
|
94
|
private void initComponents() {
|
96
|
95
|
setOpaque(UIUtilities.getTabbedPaneOpaque());
|
97
|
|
- listModel = new GenericListModel<License>();
|
|
96
|
+ listModel = new GenericListModel<Licence>();
|
98
|
97
|
list = new JList(listModel);
|
99
|
98
|
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
100
|
99
|
new ListScroller(list);
|
101
|
|
- new LicenseLoader(listModel).execute();
|
102
|
|
- license = new JEditorPane();
|
103
|
|
- license.setEditorKit(new HTMLEditorKit());
|
|
100
|
+ new LicenceLoader(listModel).execute();
|
|
101
|
+ licence = new JEditorPane();
|
|
102
|
+ licence.setEditorKit(new HTMLEditorKit());
|
104
|
103
|
final Font font = UIManager.getFont("Label.font");
|
105
|
|
- ((HTMLDocument) license.getDocument()).getStyleSheet().addRule("body " +
|
|
104
|
+ ((HTMLDocument) licence.getDocument()).getStyleSheet().addRule("body " +
|
106
|
105
|
"{ font-family: " + font.getFamily() + "; " + "font-size: " +
|
107
|
106
|
font.getSize() + "pt; }");
|
108
|
|
- license.setEditable(false);
|
109
|
|
- scrollPane = new JScrollPane(license);
|
|
107
|
+ licence.setEditable(false);
|
|
108
|
+ scrollPane = new JScrollPane(licence);
|
110
|
109
|
}
|
111
|
110
|
|
112
|
111
|
/** {@inheritDoc} */
|
|
@@ -116,7 +115,7 @@ public final class LicensePanel extends JPanel implements ListSelectionListener
|
116
|
115
|
if (list.getSelectedIndex() == -1) {
|
117
|
116
|
list.setSelectedIndex(selectedIndex);
|
118
|
117
|
} else {
|
119
|
|
- license.setText(listModel.get(list.getSelectedIndex()).getBody());
|
|
118
|
+ licence.setText(listModel.get(list.getSelectedIndex()).getBody());
|
120
|
119
|
UIUtilities.resetScrollPane(scrollPane);
|
121
|
120
|
}
|
122
|
121
|
selectedIndex = list.getSelectedIndex();
|