source: src/main/java/genius/gui/uncertainty/SteppingSliderExample.java@ 126

Last change on this file since 126 was 126, checked in by Aron Hammond, 6 years ago

Added function to calculate opposition to MultiLateralAnalysis.java

Moved code to add RLBOA listeners to RLBOAUtils is misc package

Added input for strategyParameters to SessionPanel (gui)

!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files

Our own package:

  • Added opponents and strategies that are mentioned in the report
  • Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
  • States extend from AbstractState
File size: 1.5 KB
Line 
1package genius.gui.uncertainty;
2import javax.swing.BoxLayout;
3import javax.swing.JFrame;
4import javax.swing.JLabel;
5import javax.swing.SwingUtilities;
6import javax.swing.event.ChangeEvent;
7import javax.swing.event.ChangeListener;
8
9public class SteppingSliderExample
10{
11
12 public static void createAndShowGUI()
13 {
14 JFrame frame = new JFrame("SteppingSlider");
15 frame.setSize(500, 120);
16 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
17 final SteppingSlider steppingSlider = new SteppingSlider(10, 20, 50, 100);
18 final String labelPrefix = "Slider value: ";
19 final JLabel output = new JLabel(labelPrefix + steppingSlider.getDomainValue());
20 steppingSlider.addChangeListener(new ChangeListener()
21 {
22 @Override
23 public void stateChanged(ChangeEvent evt)
24 {
25 output.setText(labelPrefix + steppingSlider.getDomainValue());
26 }
27 });
28 frame.getContentPane().setLayout(
29 new BoxLayout(frame.getContentPane(),
30 BoxLayout.Y_AXIS));
31 frame.getContentPane().add(steppingSlider);
32 frame.getContentPane().add(output);
33 frame.setVisible(true);
34 }
35
36 public static void main(String[] args) throws Exception
37 {
38 SwingUtilities.invokeLater(new Runnable()
39 {
40 public void run()
41 {
42 createAndShowGUI();
43 }
44 });
45 }
46}
Note: See TracBrowser for help on using the repository browser.