Skip to content

Commit

Permalink
Merge pull request #18 from TitanRobotics/feature/layout
Browse files Browse the repository at this point in the history
Layout: Now MiG layout
  • Loading branch information
esloan committed Apr 2, 2013
2 parents 2f6a749 + fa9722f commit 2317a58
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 37 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added build/.DS_Store
Binary file not shown.
Binary file added build/classes/.DS_Store
Binary file not shown.
Binary file added build/classes/org/.DS_Store
Binary file not shown.
Binary file added build/classes/org/usfirst/.DS_Store
Binary file not shown.
Binary file added build/generated-sources/.DS_Store
Binary file not shown.
Binary file added dist/.DS_Store
Binary file not shown.
Binary file added dist/lib/.DS_Store
Binary file not shown.
Binary file modified nbproject/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion nbproject/private/private.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\IMSA Student\\AppData\\Roaming\\NetBeans\\7.3\\build.properties
user.properties.file=/Users/Emma/Library/Application Support/NetBeans/7.2.1/build.properties
4 changes: 3 additions & 1 deletion nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ dist.jar=${dist.dir}/Scouting.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.miglayout-4.0-swing.jar-1=miglayout-4.0-swing.jar
file.reference.opencsv-2.3.jar=opencsv-2.3.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.opencsv-2.3.jar}
${file.reference.opencsv-2.3.jar}:\
${file.reference.miglayout-4.0-swing.jar-1}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
Expand Down
Binary file modified src/.DS_Store
Binary file not shown.
Binary file added src/org/.DS_Store
Binary file not shown.
Binary file added src/org/usfirst/.DS_Store
Binary file not shown.
70 changes: 35 additions & 35 deletions src/org/usfirst/frc2022/ScoutingGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import net.miginfocom.swing.MigLayout;

public class ScoutingGUI extends JFrame
implements ActionListener{
Expand Down Expand Up @@ -62,7 +63,6 @@ private int integer(String str){

JLabel sweetSpot = new JLabel("Sweet Spot Location:");
JTextField sSpot = new JTextField(15);
JLabel space = new JLabel(" ");
JLabel notesLabel = new JLabel("Notes:");
JTextField notes = new JTextField(30);

Expand All @@ -77,10 +77,10 @@ private int integer(String str){
JLabel auto_2 = new JLabel(" 1(2) Pointer shots Made ");
JLabel autoPickup = new JLabel("Autonomous disks picked up");
//JLabel tele = new JLabel("Tele-OP");
JLabel teleAttempt = new JLabel(" Tele-Op Shots Attempted ");
JLabel tele_3 = new JLabel(" 3 Pointer shots Made ");
JLabel tele_2 = new JLabel(" 2 Pointer shots Made ");
JLabel tele_1 = new JLabel(" 1 Pointer shots Made ");
JLabel teleAttempt = new JLabel("Tele-Op Shots Attempted");
JLabel tele_3 = new JLabel("3 Pointer shots Made");
JLabel tele_2 = new JLabel("2 Pointer shots Made");
JLabel tele_1 = new JLabel("1 Pointer shots Made");

JLabel pyramid = new JLabel(" Pyramid shots Made ");

Expand All @@ -105,14 +105,14 @@ private int integer(String str){
final JFileChooser fc = new JFileChooser();
JButton save = new JButton("Save Results");

JPanel jp = new JPanel();
JPanel jp = new JPanel(new MigLayout("fill"));

public ScoutingGUI()throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException{

//Create the window
setTitle("Scouter 2013");
setVisible(true);
setSize(440, 700);
setSize(520, 700);
setResizable(true);
setDefaultCloseOperation(3);

Expand All @@ -124,17 +124,17 @@ public ScoutingGUI()throws ClassNotFoundException, InstantiationException, Illeg
}

//Add GUI elements to JPanel
this.jp.add(matchInfo);
this.jp.add(matchInfo,"split 6");
this.jp.add(teamNumber);
this.jp.add(matchNumber);
this.jp.add(color);
this.jp.add(blue);
this.jp.add(red);
this.jp.add(sweetSpot);
this.jp.add(sSpot);
this.jp.add(this.FeederPickup);
this.jp.add(red, "wrap");
this.jp.add(sweetSpot,"split 2");
this.jp.add(sSpot, "wrap");
this.jp.add(this.FeederPickup,"split 3");
this.jp.add(this.FloorPickup);
this.jp.add(this.BothPickup);
this.jp.add(this.BothPickup, "wrap");

//Add action listeners to previous GUI elements

Expand All @@ -154,45 +154,46 @@ public void actionPerformed(ActionEvent e) {
//Add identical buttons and their respective labels/action listeners

for (int i = 0; i<12; i++){
this.jp.add(this.subtract[i], "split 4"); // -1
this.jp.add(this.label[i]); // 0
this.jp.add(this.add[i]); // +1

if (i == 0){
this.jp.add(autoAttempt);
this.jp.add(autoAttempt, "wrap");
}
else if (i == 1){
this.jp.add(auto6);
this.jp.add(auto6, "wrap");
}
else if (i == 2){
this.jp.add(auto4);
this.jp.add(auto4,"wrap");
}
else if (i == 3){
this.jp.add(auto_2);
this.jp.add(auto_2,"wrap");
}
else if (i == 4){
this.jp.add(autoPickup);
this.jp.add(autoPickup,"wrap");
}
else if (i == 5){
this.jp.add(teleAttempt);
this.jp.add(teleAttempt,"wrap");
}
else if (i == 6){
this.jp.add(tele_3);
this.jp.add(tele_3,"wrap");
}
else if (i == 7){
this.jp.add(tele_2);
this.jp.add(tele_2,"wrap");
}
else if (i==8){
this.jp.add(tele_1);
this.jp.add(tele_1,"wrap");
}
else if (i==9){
this.jp.add(pyramid);
this.jp.add(pyramid,"wrap");
}
else if (i==10){
this.jp.add(fouls);
this.jp.add(fouls,"wrap");
}
else{
this.jp.add(tfouls);
this.jp.add(tfouls,"wrap");
}
this.jp.add(this.subtract[i]); // -1
this.jp.add(this.label[i]); // 0
this.jp.add(this.add[i]); // +1

final int j = i; //appease the inner class

Expand All @@ -218,18 +219,17 @@ public void actionPerformed(ActionEvent e) {

//Add final GUI elements

this.jp.add(this.climb);
this.jp.add(this.climb,"split 5");
this.jp.add(this.climbPoints);
this.jp.add(this.climb1);
this.jp.add(this.climb2);
this.jp.add(this.climb3);
this.jp.add(this.DefenseGood);
this.jp.add(this.climb3,"wrap");
this.jp.add(this.DefenseGood,"split 4");
this.jp.add(this.DefenseMeh);
this.jp.add(this.DefenseBad);
this.jp.add(this.DefenseNo);
this.jp.add(space);
this.jp.add(notesLabel);
this.jp.add(notes);
this.jp.add(this.DefenseNo,"wrap");
this.jp.add(notesLabel,"split 2");
this.jp.add(notes,"wrap");
this.jp.add(this.save);

//Add action listeners to previous GUI elements
Expand Down

0 comments on commit 2317a58

Please sign in to comment.