Skip to content

Commit

Permalink
i_992 Add ContestInformationPane to PluginLoadPane
Browse files Browse the repository at this point in the history
The ContestInformationPane was missing from the PluginLoadPane.  This made it impossible to load that pane from the DevelopementPane (for example).
CI: PluginPane: add meaningful text for the label on the pane instead of having it show, "JLabel".
  • Loading branch information
johnbrvc committed Jul 20, 2024
1 parent 89fb95a commit 7dec7d4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
26 changes: 15 additions & 11 deletions src/edu/csus/ecs/pc2/ui/PluginLoadPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

/**
* Pane to allow user to choose and open/start plugin window or pane.
*
*
* @author [email protected]
*/

public class PluginLoadPane extends JPanePlugin {

/**
*
*
*/
private static final long serialVersionUID = -1303011559658754807L;

Expand All @@ -47,7 +47,7 @@ public void setParentTabbedPane(JTabbedPane parentTabbedPane) {

/**
* This method initializes
*
*
*/
public PluginLoadPane() {
super();
Expand All @@ -56,7 +56,7 @@ public PluginLoadPane() {

/**
* This method initializes this
*
*
*/
private void initialize() {
this.setLayout(null);
Expand All @@ -74,7 +74,7 @@ public String getPluginTitle() {

/**
* This method initializes pluginComboBox
*
*
* @return javax.swing.JComboBox
*/
private JComboBox<PluginWrapper> getPluginComboBox() {
Expand All @@ -87,7 +87,7 @@ private JComboBox<PluginWrapper> getPluginComboBox() {

/**
* This method initializes openNewPluginButton
*
*
* @return javax.swing.JButton
*/
private JButton getOpenNewPluginButton() {
Expand All @@ -96,6 +96,7 @@ private JButton getOpenNewPluginButton() {
openNewPluginButton.setBounds(new Rectangle(41, 147, 134, 36));
openNewPluginButton.setText("Add Tab");
openNewPluginButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
addNewTab();
}
Expand All @@ -119,7 +120,7 @@ protected void addNewTab() {

/**
* This method initializes addPluginInNewWindow
*
*
* @return javax.swing.JButton
*/
private JButton getAddPluginInNewWindow() {
Expand All @@ -128,6 +129,7 @@ private JButton getAddPluginInNewWindow() {
addPluginInNewWindow.setBounds(new Rectangle(317, 147, 182, 36));
addPluginInNewWindow.setText("Open in new Window");
addPluginInNewWindow.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
addNewPluginWindow();
}
Expand All @@ -144,7 +146,7 @@ protected void addNewPluginWindow() {
}

/**
*
*
* @author [email protected]
* @version $Id$
*/
Expand Down Expand Up @@ -177,7 +179,7 @@ public void setContestAndController(IInternalContest inContest, IInternalControl

private JPanePlugin[] getPluginList() {
Vector<JPanePlugin> plugins = new Vector<JPanePlugin>();

plugins.add(new AccountsPane());
plugins.add(new AccountsTablePane());
plugins.add(new AutoJudgesPane());
Expand All @@ -187,6 +189,7 @@ private JPanePlugin[] getPluginList() {
plugins.add(new ConnectionsPane());
plugins.add(new ConnectionsTablePane());
plugins.add(new ContestClockPane());
plugins.add(new ContestInformationPane());
plugins.add(new ContestScheduledStartClockPane());
plugins.add(new ContestTimesPane());
plugins.add(new EventFeedServerPane());
Expand Down Expand Up @@ -216,10 +219,10 @@ private JPanePlugin[] getPluginList() {
plugins.add(new ViewPropertiesPane());
plugins.add(new NSAStandingsPane());
plugins.add(new QuickJudgePane());

plugins.add(new ResultsComparePane());

JPanePlugin[] pluginList = (JPanePlugin[]) plugins.toArray(new JPanePlugin[plugins.size()]);
JPanePlugin[] pluginList = plugins.toArray(new JPanePlugin[plugins.size()]);

Arrays.sort(pluginList, new JPluginPaneNameComparator());

Expand All @@ -229,6 +232,7 @@ private JPanePlugin[] getPluginList() {
private void loadPluginList() {

SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
pluginComboBox.removeAllItems();
for (JPanePlugin plugin : getPluginList()) {
Expand Down
20 changes: 11 additions & 9 deletions src/edu/csus/ecs/pc2/ui/PluginPane.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 1989-2019 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
// Copyright (C) 1989-2024 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
package edu.csus.ecs.pc2.ui;

import java.awt.BorderLayout;
Expand All @@ -14,7 +14,7 @@

/**
* Pane for Plugin Frame (tabbed panes).
*
*
* @author [email protected]
* @version $Id$
*/
Expand All @@ -23,7 +23,7 @@
public class PluginPane extends JPanePlugin {

/**
*
*
*/
private static final long serialVersionUID = 4327701084703859112L;

Expand All @@ -35,7 +35,7 @@ public class PluginPane extends JPanePlugin {

/**
* This method initializes
*
*
*/
public PluginPane() {
super();
Expand All @@ -44,7 +44,7 @@ public PluginPane() {

/**
* This method initializes this
*
*
*/
private void initialize() {
this.setLayout(new BorderLayout());
Expand All @@ -56,13 +56,15 @@ private void initialize() {

}

@Override
public String getPluginTitle() {
return "Plugin View";
}

@Override
public void setContestAndController(IInternalContest inContest, IInternalController inController) {
super.setContestAndController(inContest, inController);

PluginLoadPane pluginLoadPane = new PluginLoadPane();
pluginLoadPane.setParentFrame(getParentFrame());
pluginLoadPane.setParentTabbedPane(getPluginTabbedPane());
Expand All @@ -72,7 +74,7 @@ public void setContestAndController(IInternalContest inContest, IInternalControl

/**
* This method initializes pluginTabbedPane
*
*
* @return javax.swing.JTabbedPane
*/
private JTabbedPane getPluginTabbedPane() {
Expand All @@ -84,13 +86,13 @@ private JTabbedPane getPluginTabbedPane() {

/**
* This method initializes infoPane
*
*
* @return javax.swing.JPanel
*/
private JPanel getInfoPane() {
if (infoPane == null) {
infoLabel = new JLabel();
infoLabel.setText("JLabel");
infoLabel.setText("Dynamically Load Plugins");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER);
infoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
infoPane = new JPanel();
Expand Down

0 comments on commit 7dec7d4

Please sign in to comment.