From 1e5b0dc86ddcc619ba533b9b0ba1f6d11296ad0c Mon Sep 17 00:00:00 2001 From: Lukma Date: Fri, 24 Mar 2023 10:27:33 +0100 Subject: [PATCH 1/6] Implemented the new LookupAllByDate button and added the action listener --- .../java/com/stir/cscu9t4practical1/TrainingRecordGUI.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java index cbb891a1..d5f7e88c 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java @@ -27,6 +27,7 @@ public class TrainingRecordGUI extends JFrame implements ActionListener { private JLabel labdist = new JLabel(" Distance (km):"); private JButton addR = new JButton("Add"); private JButton lookUpByDate = new JButton("Look Up"); + private JButton lookUpAllByDate = new JButton("Look Up All"); private TrainingRecord myAthletes = new TrainingRecord(); @@ -68,6 +69,8 @@ public TrainingRecordGUI() { addR.addActionListener(this); add(lookUpByDate); lookUpByDate.addActionListener(this); + add(lookUpAllByDate); + lookUpAllByDate.addActionListener(this); add(outputArea); outputArea.setEditable(false); setSize(720, 200); @@ -88,6 +91,9 @@ public void actionPerformed(ActionEvent event) { if (event.getSource() == lookUpByDate) { message = lookupEntry(); } + if (event.getSource() == lookUpAllByDate) { + message = "This is not yet Implemented"; + } outputArea.setText(message); blankDisplay(); } // actionPerformed From 008d598811d70b52300de282d5e862117bdb3ab9 Mon Sep 17 00:00:00 2001 From: Lukma Date: Fri, 24 Mar 2023 10:44:18 +0100 Subject: [PATCH 2/6] Implemented the new LookupAllByDate button and added the action listener, and also implemented a new method that can return more than one case --- .../com/stir/cscu9t4practical1/TrainingRecord.java | 11 ++++++++++- .../com/stir/cscu9t4practical1/TrainingRecordGUI.java | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java index fafdec9b..16834684 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java @@ -30,7 +30,16 @@ public String lookupEntry (int d, int m, int y) { } return result; } // lookupEntry - + public String lookupAllEntries (int d, int m, int y) { + ListIterator iter = tr.listIterator(); + String result = ""; + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.getDay()==d && current.getMonth()==m && current.getYear()==y) + result += current.getEntry(); + } + return result; + } // Count the number of entries public int getNumberOfEntries(){ return tr.size(); diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java index d5f7e88c..96611f4c 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java @@ -92,7 +92,7 @@ public void actionPerformed(ActionEvent event) { message = lookupEntry(); } if (event.getSource() == lookUpAllByDate) { - message = "This is not yet Implemented"; + message = lookupAllEntries(); } outputArea.setText(message); blankDisplay(); @@ -122,6 +122,14 @@ public String lookupEntry() { String message = myAthletes.lookupEntry(d, m, y); return message; } + public String lookupAllEntries() { + int m = Integer.parseInt(month.getText()); + int d = Integer.parseInt(day.getText()); + int y = Integer.parseInt(year.getText()); + outputArea.setText("looking up record ..."); + String message = myAthletes.lookupAllEntries(d, m, y); + return message; + } public void blankDisplay() { name.setText(""); From 729a86db0ff7fa32892b48231f62fe0636323638 Mon Sep 17 00:00:00 2001 From: Lukma Date: Mon, 27 Mar 2023 13:00:02 +0200 Subject: [PATCH 3/6] Implemented the new SubClasses to include Swim entries, sprint entries, and clycling entries. --- .idea/.gitignore | 8 +++++ .idea/compiler.xml | 13 ++++++++ .idea/encodings.xml | 7 ++++ .idea/jarRepositories.xml | 20 ++++++++++++ .idea/misc.xml | 12 +++++++ .idea/vcs.xml | 6 ++++ .../stir/cscu9t4practical1/CycleEntry.java | 30 ++++++++++++++++++ .../com/stir/cscu9t4practical1/Entry.java | 10 +++--- .../stir/cscu9t4practical1/SprintEntry.java | 29 +++++++++++++++++ .../com/stir/cscu9t4practical1/SwimEntry.java | 18 +++++++++++ .../cscu9t4practical1/CycleEntryTest.java | 4 +-- .../cscu9t4practical1/SprintEntryTest.java | 8 ++--- .../stir/cscu9t4practical1/SwimEntryTest.java | 8 ++--- .../com/stir/cscu9t4practical1/Entry.class | Bin 0 -> 2142 bytes .../cscu9t4practical1/TrainingRecord.class | Bin 0 -> 2519 bytes .../cscu9t4practical1/TrainingRecordGUI.class | Bin 0 -> 5709 bytes 16 files changed, 158 insertions(+), 15 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 src/main/java/com/stir/cscu9t4practical1/CycleEntry.java create mode 100644 src/main/java/com/stir/cscu9t4practical1/SprintEntry.java create mode 100644 src/main/java/com/stir/cscu9t4practical1/SwimEntry.java create mode 100644 target/classes/com/stir/cscu9t4practical1/Entry.class create mode 100644 target/classes/com/stir/cscu9t4practical1/TrainingRecord.class create mode 100644 target/classes/com/stir/cscu9t4practical1/TrainingRecordGUI.class diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..ac1a3dea --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..aa00ffab --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..712ab9d9 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..2738f8ef --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java new file mode 100644 index 00000000..d325cec4 --- /dev/null +++ b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java @@ -0,0 +1,30 @@ +package com.stir.cscu9t4practical1; + +public class CycleEntry extends Entry{ + + + private String terrain; + + + + private String tempo; + public CycleEntry(String n, int d, int m, int y, int h, int min, int s, float dist,String terrain,String tempo) { + super(n, d, m, y, h, min, s, dist); + this.terrain = terrain; + this.tempo = tempo; + } + public String getTerrain() { + return terrain; + } + + public void setTerrain(String terrain) { + this.terrain = terrain; + } + public String getTempo() { + return tempo; + } + + public void setTempo(String tempo) { + this.tempo = tempo; + } +} diff --git a/src/main/java/com/stir/cscu9t4practical1/Entry.java b/src/main/java/com/stir/cscu9t4practical1/Entry.java index 344b9068..6aef49ab 100755 --- a/src/main/java/com/stir/cscu9t4practical1/Entry.java +++ b/src/main/java/com/stir/cscu9t4practical1/Entry.java @@ -3,9 +3,9 @@ import java.util.Calendar; public class Entry { - private String name; - private Calendar dateAndTime; - private float distance; + protected String name; + protected Calendar dateAndTime; + protected float distance; public Entry (String n, int d, int m, int y, int h, int min, int s, float dist) { name = n; @@ -14,7 +14,7 @@ public Entry (String n, int d, int m, int y, int h, int min, int s, float dist) dateAndTime = inst; distance = dist; } //constructor - + public String getName () { return name; } //getName @@ -54,5 +54,5 @@ public String getEntry () { +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; return result; } //getEntry - + } // Entry \ No newline at end of file diff --git a/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java new file mode 100644 index 00000000..291e89ba --- /dev/null +++ b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java @@ -0,0 +1,29 @@ +package com.stir.cscu9t4practical1; + +public class SprintEntry extends Entry{ + + + private int repetitions; + + + + private int recoveryIntervals; + public SprintEntry(String n, int d, int m, int y, int h, int min, int s, float dist,int repetitions,int recoveryIntervals){ + super(n,d,m,y,h,min,s,dist); + this.repetitions = repetitions; + this.recoveryIntervals = recoveryIntervals; + }public int getRepetitions() { + return repetitions; + } + + public void setRepetitions(int repetitions) { + this.repetitions = repetitions; + } + public int getRecovery() { + return recoveryIntervals; + } + + public void setRecovery(int recoveryIntervals) { + this.recoveryIntervals = recoveryIntervals; + } +} diff --git a/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java b/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java new file mode 100644 index 00000000..5ac37f6e --- /dev/null +++ b/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java @@ -0,0 +1,18 @@ +package com.stir.cscu9t4practical1; + +public class SwimEntry extends Entry{ + + private String where; + public SwimEntry(String n, int d, int m, int y, int h, int min, int s, float dist,String where) { + super(n, d, m, y, h, min, s, dist); + this.where = where; + } + public String getWhere() { + return where; + } + + public void setWhere(String where) { + this.where = where; + } + +} diff --git a/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java index de457810..7cc83ff9 100644 --- a/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java @@ -139,7 +139,7 @@ public void testGetDistance() { @Test public void testGetTerrain() { System.out.println("getTerrain"); - Entry instance = new CycleEntry("Alice", 1, 2, 2003, 0, 16, 7, 3, "asphalt", "moderate"); + CycleEntry instance = new CycleEntry("Alice", 1, 2, 2003, 0, 16, 7, 3, "asphalt", "moderate"); String expResult = "asphalt"; String result = instance.getTerrain(); assertEquals(expResult, result); @@ -151,7 +151,7 @@ public void testGetTerrain() { @Test public void testGetTempo() { System.out.println("getTempo"); - Entry instance = new CycleEntry("Alice", 1, 2, 2003, 0, 16, 7, 3, "asphalt", "moderate"); + CycleEntry instance = new CycleEntry("Alice", 1, 2, 2003, 0, 16, 7, 3, "asphalt", "moderate"); String expResult = "moderate"; String result = instance.getTempo(); assertEquals(expResult, result); diff --git a/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java index 00af5583..fc585046 100644 --- a/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java @@ -138,10 +138,10 @@ public void testGetDistance() { @Test public void testGetRepetitions() { System.out.println("getRepetitions"); - Entry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); + SprintEntry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); int expResults = 4; int result = instance.getRepetitions(); - assertEquals(expResult, result); + assertEquals(expResults, result); } /** @@ -150,10 +150,10 @@ public void testGetRepetitions() { @Test public void testGetRecovery() { System.out.println("getRepetitions"); - Entry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); + SprintEntry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); int expResults = 2; int result = instance.getRecovery(); - assertEquals(expResult, result); + assertEquals(expResults, result); } /** diff --git a/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java index 19a4650c..83d62fe5 100644 --- a/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java @@ -140,13 +140,13 @@ public void testGetWhere() { System.out.println("getWhere"); Entry instanceA = new SwimEntry("Alice", 1, 2, 2003, 0, 16, 7, 3,"outdoors"); String expResultA = "outdoors"; - String result = instanceA.getWhere(); - assertEquals(expResultA, result); + String result1 = ((SwimEntry) instanceA).getWhere(); + assertEquals(expResultA, result1); Entry instanceB = new SwimEntry("Alice", 1, 2, 2003, 0, 16, 7, 3,"pool"); String expResultB = "in a pool"; - String result = instanceB.getWhere(); - assertEquals(expResultB, result); + String result2 = ((SwimEntry) instanceB).getWhere(); + assertEquals(expResultB, result2); } /** * Test of getEntry method, of class SwimEntry. diff --git a/target/classes/com/stir/cscu9t4practical1/Entry.class b/target/classes/com/stir/cscu9t4practical1/Entry.class new file mode 100644 index 0000000000000000000000000000000000000000..3e2c623af971cb812a85933bdbfe00cbcfb3b35e GIT binary patch literal 2142 zcmah~Yg5}s6g>-m$U+24c$D&pn?h;~iIavT4W?-mgNs{3+CoXw^bsK|SizPUNzM%a zq(7q5X=e)QDq`lB*AyAoi6rnTp4ukPMG_r3b}^{c-D+`%&)J?PCMWgv}=z~FQ9 zg;{Eu?r!Pf&U4!e1v1Ny>xB0NdJA*gIcUgbp&RIfA&|Gcb}0xQzhnhg=We*T@0(WW zSZ3=+Y1Iw=1A&xlwrzo-`YG~e=sWIiS;qwoWHD&q9Sl)JDRe@oRjQaR+ijS>K;Nz% z*4!X8U5g;2g}DgkjFti#HZX!wIvLpXIajEuU*zz+2FCFo!5U_0-*+2Zj`V0a2};H{ zXr*}Q@GahW#g6ay>N=4v|iXAI2Zia?g)4HfM0v7aiDC*f)+7??vb z3Tx#AorxvBh6MvxaV-K`^EwQlJIcg$12^POh9=e>S1R8$uy`!mv@I#RZLp%T){1!` zMRyG>Ns%TGdT!X1!es-WNTGE2v2FT8Y=ut^e1`i1V{LQKu6V9xhL4=ENlx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f*R$5a4`DCAYNn!_G2D$X&gS13&cPCX<*tB^_2^-g+nCY$P0m4jZ1(y(J3M)8x6pwc=t|+ST zRTNhQDoQGXm25cQU0X^Sb9U)4e$a3aEwcOGO6C}_m)`U;%aY8b6l(Y_9_2jRgfuoI zgHD)?OO})zE@yka26+{k1GZ7AK;Vr|=`o$&x#$wTND< zp@U8^*AaALxt^dC$_)euLO+rz!BEVdL-JE=eY1UI;i#f9z&;)@z{1+kH*b)|cmOML zp>lb-eURgFDT_!t#TkVrN~b*BF-tk+ Date: Mon, 27 Mar 2023 15:47:19 +0200 Subject: [PATCH 4/6] Implemented functionality of subclasses of entry with the addentry method being able to distinguish the type of activity, also implemented a search function that returns all based on a name --- .../stir/cscu9t4practical1/CycleEntry.java | 8 +++ .../com/stir/cscu9t4practical1/Entry.java | 9 +-- .../stir/cscu9t4practical1/SprintEntry.java | 9 ++- .../com/stir/cscu9t4practical1/SwimEntry.java | 8 ++- .../cscu9t4practical1/TrainingRecord.java | 11 +++ .../cscu9t4practical1/TrainingRecordGUI.java | 63 +++++++++++++++++- .../com/stir/cscu9t4practical1/Entry.class | Bin 2142 -> 2140 bytes .../cscu9t4practical1/TrainingRecord.class | Bin 2519 -> 2891 bytes .../cscu9t4practical1/TrainingRecordGUI.class | Bin 5709 -> 7726 bytes 9 files changed, 99 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java index d325cec4..4ef7e6b4 100644 --- a/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java +++ b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java @@ -3,6 +3,7 @@ public class CycleEntry extends Entry{ + private String terrain; @@ -27,4 +28,11 @@ public String getTempo() { public void setTempo(String tempo) { this.tempo = tempo; } + public String getEntry(){ + String result = getName()+ " did a " + getTerrain() +" cycle for " + + getDistance()+ " km in at a tempo of "+ getTempo() +" for " + +getHour()+":"+getMin()+":"+ getSec() + " on " + +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; + return result; + } } diff --git a/src/main/java/com/stir/cscu9t4practical1/Entry.java b/src/main/java/com/stir/cscu9t4practical1/Entry.java index 6aef49ab..7a051c40 100755 --- a/src/main/java/com/stir/cscu9t4practical1/Entry.java +++ b/src/main/java/com/stir/cscu9t4practical1/Entry.java @@ -3,6 +3,7 @@ import java.util.Calendar; public class Entry { + protected String name; protected Calendar dateAndTime; protected float distance; @@ -49,10 +50,10 @@ public float getDistance () { } //getYear public String getEntry () { - String result = getName()+" ran " + getDistance() + " km in " - +getHour()+":"+getMin()+":"+ getSec() + " on " - +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; - return result; + String result = getName()+ " ran "+ getDistance() + " km in " + +getHour()+":"+getMin()+":"+ getSec() + " on " + +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; + return result; } //getEntry } // Entry \ No newline at end of file diff --git a/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java index 291e89ba..17aad3e1 100644 --- a/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java +++ b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java @@ -6,7 +6,6 @@ public class SprintEntry extends Entry{ private int repetitions; - private int recoveryIntervals; public SprintEntry(String n, int d, int m, int y, int h, int min, int s, float dist,int repetitions,int recoveryIntervals){ super(n,d,m,y,h,min,s,dist); @@ -26,4 +25,12 @@ public int getRecovery() { public void setRecovery(int recoveryIntervals) { this.recoveryIntervals = recoveryIntervals; } + + public String getEntry(){ + String result = getName()+ " Sprinted " + getRepetitions() +" repetitions of: " + + getDistance()+ " km in With breaks of "+ getRecovery() +" mins in between " + +getHour()+":"+getMin()+":"+ getSec() + " on " + +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; + return result; + } } diff --git a/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java b/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java index 5ac37f6e..dd8e2c3c 100644 --- a/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java +++ b/src/main/java/com/stir/cscu9t4practical1/SwimEntry.java @@ -14,5 +14,11 @@ public String getWhere() { public void setWhere(String where) { this.where = where; } - + public String getEntry(){ + String result = getName()+ " Swam " + getWhere() +" for " + + getDistance()+ " km in " + +getHour()+":"+getMin()+":"+ getSec() + " on " + +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; + return result; + } } diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java index 16834684..5e7c203d 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java @@ -40,6 +40,17 @@ public String lookupAllEntries (int d, int m, int y) { } return result; } + public String lookupAllEntriesByName(String searchTerm){ + ListIterator iter = tr.listIterator(); + String result = ""; + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.name.equalsIgnoreCase(searchTerm)){ + result += current.getEntry(); + } + } + return result; + } // Count the number of entries public int getNumberOfEntries(){ return tr.size(); diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java index 96611f4c..549f5744 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java @@ -5,6 +5,8 @@ import java.awt.event.*; import java.util.*; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.lang.Number; public class TrainingRecordGUI extends JFrame implements ActionListener { @@ -32,6 +34,13 @@ public class TrainingRecordGUI extends JFrame implements ActionListener { private TrainingRecord myAthletes = new TrainingRecord(); private JTextArea outputArea = new JTextArea(5, 50); + private JTextField whereField = new JTextField(10); + private JTextField repetitionsField = new JTextField(3); + private JTextField recoveryField = new JTextField(3); + + private JTextField tempoField = new JTextField(3); + private JTextField terrainField = new JTextField(10); + private JButton findAllBasedOnName = new JButton("Name Search"); public static void main(String[] args) { TrainingRecordGUI applic = new TrainingRecordGUI(); @@ -65,14 +74,30 @@ public TrainingRecordGUI() { add(labdist); add(dist); dist.setEditable(true); + add(new JLabel("---Swimming---")); + add(new JLabel("Outdoor or Indoor:")); + add(whereField); + add(new JLabel("---Sprinting---")); + add(new JLabel("Repetitions:")); + add(repetitionsField); + add(new JLabel("Recovery Intervals(mins):")); + add(recoveryField); + add(new JLabel("---Cycling---")); + add(new JLabel("Terrain:")); + add(terrainField); + add(new JLabel("Tempo(mph):")); + add(tempoField); add(addR); addR.addActionListener(this); add(lookUpByDate); lookUpByDate.addActionListener(this); add(lookUpAllByDate); lookUpAllByDate.addActionListener(this); + add(findAllBasedOnName); + findAllBasedOnName.addActionListener(this); add(outputArea); outputArea.setEditable(false); + setSize(720, 200); setVisible(true); blankDisplay(); @@ -94,6 +119,9 @@ public void actionPerformed(ActionEvent event) { if (event.getSource() == lookUpAllByDate) { message = lookupAllEntries(); } + if (event.getSource() == findAllBasedOnName){ + message = lookupAllEntriesByName(); + } outputArea.setText(message); blankDisplay(); } // actionPerformed @@ -109,8 +137,27 @@ public String addEntry(String what) { int h = Integer.parseInt(hours.getText()); int mm = Integer.parseInt(mins.getText()); int s = Integer.parseInt(secs.getText()); - Entry e = new Entry(n, d, m, y, h, mm, s, km); - myAthletes.addEntry(e); + String terrain = terrainField.getText(); + String tempo = tempoField.getText(); + String where = whereField.getText(); + String repetitions = repetitionsField.getText(); + String recovery = recoveryField.getText(); + if (!terrain.isEmpty() && !tempo.isEmpty()){ + CycleEntry e = new CycleEntry(n, d, m, y, h, mm, s, km,terrain,tempo); + myAthletes.addEntry(e); + System.out.print("Added as cycle"); + } else if(!where.isEmpty()){ + SwimEntry e = new SwimEntry(n, d, m, y, h, mm, s, km,where); + myAthletes.addEntry(e); + System.out.print("Added as swim"); + } else if (!repetitions.isEmpty() && !recovery.isEmpty() ){ + SprintEntry e = new SprintEntry(n, d, m, y, h, mm, s, km,Integer.parseInt(repetitions),Integer.parseInt(recovery)); + myAthletes.addEntry(e); + System.out.print("Added as sprint"); + } else { + Entry e = new Entry(n, d, m, y, h, mm, s, km); + myAthletes.addEntry(e); + } return message; } @@ -130,6 +177,12 @@ public String lookupAllEntries() { String message = myAthletes.lookupAllEntries(d, m, y); return message; } + public String lookupAllEntriesByName(){ + String searchTerm = name.getText(); + outputArea.setText("looking up record ..."); + String message = myAthletes.lookupAllEntriesByName(searchTerm); + return message; + } public void blankDisplay() { name.setText(""); @@ -140,7 +193,11 @@ public void blankDisplay() { mins.setText(""); secs.setText(""); dist.setText(""); - + recoveryField.setText(""); + terrainField.setText(""); + repetitionsField.setText(""); + tempoField.setText(""); + whereField.setText(""); }// blankDisplay // Fills the input fields on the display for testing purposes only public void fillDisplay(Entry ent) { diff --git a/target/classes/com/stir/cscu9t4practical1/Entry.class b/target/classes/com/stir/cscu9t4practical1/Entry.class index 3e2c623af971cb812a85933bdbfe00cbcfb3b35e..6695db643ce24af4bf561df136476d0895e7501a 100644 GIT binary patch delta 147 zcmca7a7SQ+4hyR^V^Lz>WMh_2K^6vX1|9|m1{MZM1}P9d`7BGMBsY-H!@$YF%fJVO z@(lb8stf`Q+6;n|?OCTWicG%7>cA*5S)9#o979SuQ}9E|6uzXgGNtdpxfx&{Q)9Q3i7cH3o~xQXDP-O=cP0 delta 148 zcmca3a8F=^4hy?1qe4+)p2B29mQFz?25tr(1_lNu21y1f5Iy-cOQa+h0}D``6DY&S zz{?;HBvl#s8MGM$Cfl-3V-%izh1G#ke6lE;3#&9xoy_DoHZMkn$t&3$8C53dvx`n* p*J0EEF(x|!Svo+L4Wq&2HSF=cCO|_?8AKV(7}OZdCrfa+003D78R`H4 diff --git a/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class b/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class index da01014063f7394c0f54a89d424f40eceaf5d7e7..34e71d82f7d44692eea21b5ffa000a0303c92ddc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9}92;x{+pQ254D_tys@D;-J}^P5IIay&08YmMt-w zvm@Ueh8va%v^g1ctyIWFxET5xsiaiI1lMEL_p5v-? zooh&lXn>8(FwFV75w#fMOm0F8Hk(Dy$Y-*O_HmSqs)T1FtSUQ^q^-q7vn(eca+-~B z@c`f1{{{E$qkZ;&p}m=CvqW$Uvb9_bacp7ct#1MD|3}N8E*4sy6>&tdh#e~r?8)Kh z6e?^XWD7N>kfkqdnLki<<7Imx|EEY3HU1csX>t*_cICeTtn_dV From 8899733cf7362ee5d59ec2fb1f4d492213048d3f Mon Sep 17 00:00:00 2001 From: Lukma Date: Mon, 27 Mar 2023 16:03:34 +0200 Subject: [PATCH 5/6] Implemented a function that iterates through the array list of entries to check if given a date and name a record already exists of that kind. --- .../cscu9t4practical1/TrainingRecord.java | 10 +++++ .../cscu9t4practical1/TrainingRecordGUI.java | 41 ++++++++++-------- .../stir/cscu9t4practical1/CycleEntry.class | Bin 0 -> 1941 bytes .../com/stir/cscu9t4practical1/Entry.class | Bin 2140 -> 2142 bytes .../stir/cscu9t4practical1/SprintEntry.class | Bin 0 -> 1909 bytes .../stir/cscu9t4practical1/SwimEntry.class | Bin 0 -> 1650 bytes .../cscu9t4practical1/TrainingRecord.class | Bin 2891 -> 3351 bytes .../cscu9t4practical1/TrainingRecordGUI.class | Bin 7726 -> 7502 bytes 8 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 target/classes/com/stir/cscu9t4practical1/CycleEntry.class create mode 100644 target/classes/com/stir/cscu9t4practical1/SprintEntry.class create mode 100644 target/classes/com/stir/cscu9t4practical1/SwimEntry.class diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java index 5e7c203d..f8927e03 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java @@ -40,6 +40,16 @@ public String lookupAllEntries (int d, int m, int y) { } return result; } + public Boolean CheckIfEntryExists (int d, int m, int y,String name) { + ListIterator iter = tr.listIterator(); + Boolean result = false; + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.getDay()==d && current.getMonth()==m && current.getYear()==y && current.getName().equalsIgnoreCase(name)) + result = true; + } + return result; + } public String lookupAllEntriesByName(String searchTerm){ ListIterator iter = tr.listIterator(); String result = ""; diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java index 549f5744..9e4b99bc 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java @@ -127,8 +127,7 @@ public void actionPerformed(ActionEvent event) { } // actionPerformed public String addEntry(String what) { - String message = "Record added\n"; - System.out.println("Adding "+what+" entry to the records"); + String message = "adding..."; String n = name.getText(); int m = Integer.parseInt(month.getText()); int d = Integer.parseInt(day.getText()); @@ -142,23 +141,29 @@ public String addEntry(String what) { String where = whereField.getText(); String repetitions = repetitionsField.getText(); String recovery = recoveryField.getText(); - if (!terrain.isEmpty() && !tempo.isEmpty()){ - CycleEntry e = new CycleEntry(n, d, m, y, h, mm, s, km,terrain,tempo); - myAthletes.addEntry(e); - System.out.print("Added as cycle"); - } else if(!where.isEmpty()){ - SwimEntry e = new SwimEntry(n, d, m, y, h, mm, s, km,where); - myAthletes.addEntry(e); - System.out.print("Added as swim"); - } else if (!repetitions.isEmpty() && !recovery.isEmpty() ){ - SprintEntry e = new SprintEntry(n, d, m, y, h, mm, s, km,Integer.parseInt(repetitions),Integer.parseInt(recovery)); - myAthletes.addEntry(e); - System.out.print("Added as sprint"); - } else { - Entry e = new Entry(n, d, m, y, h, mm, s, km); - myAthletes.addEntry(e); + if (myAthletes.CheckIfEntryExists(m,d,y,n) == false) { + if (!terrain.isEmpty() && !tempo.isEmpty()) { + CycleEntry e = new CycleEntry(n, d, m, y, h, mm, s, km, terrain, tempo); + myAthletes.addEntry(e); + System.out.print("Added as cycle"); + } else if (!where.isEmpty()) { + SwimEntry e = new SwimEntry(n, d, m, y, h, mm, s, km, where); + myAthletes.addEntry(e); + System.out.print("Added as swim"); + } else if (!repetitions.isEmpty() && !recovery.isEmpty()) { + SprintEntry e = new SprintEntry(n, d, m, y, h, mm, s, km, Integer.parseInt(repetitions), Integer.parseInt(recovery)); + myAthletes.addEntry(e); + System.out.print("Added as sprint"); + } else { + Entry e = new Entry(n, d, m, y, h, mm, s, km); + myAthletes.addEntry(e); + message = "Record added as run"; + } + return message; + }else { + message = "An entry under this name and date already exists"; + return message; } - return message; } public String lookupEntry() { diff --git a/target/classes/com/stir/cscu9t4practical1/CycleEntry.class b/target/classes/com/stir/cscu9t4practical1/CycleEntry.class new file mode 100644 index 0000000000000000000000000000000000000000..d1d5ef2a8a368f86ed022ebf4c35a43fbcd1e633 GIT binary patch literal 1941 zcma)7ZF3V<6n<`-WRtL^FA{3CjSCcMQf-Q&2*C=Z#8%THrWTP;+s)E0O?ET8x6JgP z_%n1y)Zv3az#rxKoZW33O<>5****8%bI*OwYySS{)n5Q^;%O0M7&nkHkws3ya)Mqh z(q33|BIoFqzR?eDM|+Oly+o11cgOQRy{0g~)Ov2euxnl0-> z>=uwm!9dZ(IhYDp-(a_K>~!7KxS`!Jv^`&8X4tscJa1xB3}&_4>jyJZ)i*``iit(p$x(gF^F{QbiEAgKw(E$fVxoE?TDOly^pS~=MI`rZ z1-?EIVa>#<2*tT4t{u)WYoD0-6gL!Rd-kE*2zUYC-YR=^6|wL?$VsW77tJo<92 z^;V@*S5T}P)gf(?dL$OBI$&mcQcsGuG96}@Y?CDrotA(?X@qYAI3Fu9_2Iw|Nd9wh=eX~VP=7k0|8VcQ z>*)GmIiw~UcDLL1v|G<(N8z5bI$p=JElXLBG_&77@vS+E= ze5}B?RE4F{fr~YY@o9|AEYn1oHK0AOkT^fGiM5`87Z! zA_8RN6o_Vo1paFEcTABkkY-8mlggyaq^qPQ(lTk~6|MuVW@8p@763X#1vUTx diff --git a/target/classes/com/stir/cscu9t4practical1/SprintEntry.class b/target/classes/com/stir/cscu9t4practical1/SprintEntry.class new file mode 100644 index 0000000000000000000000000000000000000000..e75e08dd31ac656eb8f60e9055635a73baa3ccc3 GIT binary patch literal 1909 zcma)7?N%FA6x|m>z8IiT0=9f~T4@bI3Ds&Xsi=iUqJb)*)Y@M|a)l|$OxDZ=7jNQ2 z_(RvS>go?4z=!H`pP9kNl6IA>GjnF&bI#rO?0YZ&ym^Xre-wBv9 zhc0;(>u;xig@Suh>fE;CK#SI)aR;hHYSM8Ts#rbMqEK|J)HQrX*HkfLJsjcj-ibSV zwwD7P9=DmDZ&0_UuDY_83q3n>S-23o=ldo!fz#d6=Fo42V`*&X@c`du@SO;;qp;tau{KqnBVW$X&%HfP0^_2aj@N4IaG~z|N5|dD`8M<*|4ZCG?dm?^PkQ1X z>_62_Q|VPbDY5Rf+YQ&~N*22c50xFSUbk#z_Z&vs|8bSbQO9;YTQ-`#A86+&Bup}*Pxh>xu%2O7%jK?s` z`wX-JxpyLuR|nr|DBf@%^Z5zC{z8u9zDIa%yjlos8S*K44G0P{|qC) zMftb+oIr}tVT`lZG)6FoQG80I8&|;{tn!QXP{Cc!A>L<<6)y8wqc<3NpVN~{^Z0_^ zP~?3{FCBUJ=w%{r9UEMU#K|ghktgfOvo>$AWEEw;Wv-#p@5uZ@XMi_)yj1YU6oOV9 zkPuY3k7|;<7Bz{{r5P^xvG#f6#h1`CEHPxHjQ(Ev=xw+*hymw<2AlWP{P>l1@^ zdtRVLwuSf3MIGsC(FYdR&P6-UnHJr$@SzrI6nkNydRkbqP}M@6#ZS_S=Glo&3%9W) zu;e=@vJnQZqn>)IM^2+uvA|aosy&{1Gi|_xq6lnF@R0Ru+)?FFAlC@Htj}EA3*`RL zKa$abbJS1T6LKOBoygPsOqf$Wk2r6&|4*yy0wN%FNiC93;%tc?i|%{+gsyU3_K0kg z1&p&c3X~_Lq0#CZpO0uH<6)nsr4IY(%BH7L&t44LmY!RI%a6iP#VT?Jds6knZain; zn-X@>GV!f$$afsv*CXx)FT)d=O?uj+CND>*FU8NJpfbhO>8=xW`!Zf@hvCU^P#>@K zh~y2!gR_C0p#E$`|H;t{>8ko@w=)+Fr{C{*O4bY5V^4(LIdyzn*w4er=I6w>y@1Sp z{_QZZMUDTGfYk~D88!M&9Lw0m_X0P^@}HEJi5~^7zg?BrC#?Z5PJyouAh_~%AeSSb zM~&-8-2H+gO8hQYH&(BebLD*5D4R=#zaXkB#Xn&F#>)Rl1bqiiEt)?l|sm8uy~*Gb!NOxZ4Jt(ZoHA4ewx7tFV8SKvBgyD zA~7QYq60s?05TvjZM9kb6PHL=NDHK8(kkf&>3z~o()ufG0PT&}co&oO=jr1rE@1&H sDD$aW9ErY}MXxf-qol0UXfWOscJP?r0?{-{ZR~SbBKHJ8po5kF0EGr++W-In literal 0 HcmV?d00001 diff --git a/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class b/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class index 34e71d82f7d44692eea21b5ffa000a0303c92ddc..8bb3478885fd60e0a14107aab3862a3a28c6ad02 100644 GIT binary patch delta 1340 zcmZuwSx*yD6#j0vp~C)<9*i#r zpL{VopZl?zH`2K9^|Q?f4zARpbqzz)CHTa zq8WY#`!uv*zd-gxcrNUVhGS#C*6Hb}9*zkpbK&T$-ajhfDL=lg=O09)ic+*`IDlG$ z$Mi&Bc#3&D(5awHLjc{z8=GHs6V;=k7k$QkTY)zn*%;7p2$cekc;vD!4~}REzR0$J z6UR2Tjq4+mfzkF@V&+o&d?cQT3sjT`0)ce|jwEIxv9ZSgaT3T`2V8wiqv3Qu%e<`O z3a%Z+z}`;9=nQ+udafeqpY0` z$B+gACtO?y4X;w{8{&B;>|8V8pq0hnFn1aezy=&gh+lydIBCX2l)_pWqcR(igLG^% z@g8%pt>R_;DV%16z!`+i$hXQVF=XVWl_h2VE-2WF5}YN<#eJ_8*^3dJV}v}@X~}zf zF-ptM+gdS(aWc(<9})ENEfe%hwkh8veNmod!2T0i3JMi;)Y<5sO3|RpSV=oeCR^O= znQXI|1T7{(i%HO86112EEGF&$Fp<9hG4V?#F-&tEWL1-yd|etTg(_Y`eGQL5gVX*B zO${!u^EC8BB?2obZBV?*GRpH8Q7(<`1&i1$4PW6RJkn_OI+oG?5N?N=O)r=Z1%LX*N=&PvQo5Dy^Hijl1yv E0T)!wUH||9 delta 924 zcmZvaT~8B16o%i~UApadOI1umjgUa1Mrx@@4Stj&AWD@Mk&55wR%O7pouhw1T@=PC<^SDn6s9xM8&d8iRq zXMt(tT}{;Aaad{$W&_#~#7;Lp;@W02Ug|Gkh6;g;xa2D5{j*}y+4S$L%lzXc*@JFe zW|WV1)>CG21y`w%d)K&<=VWo6E0w2>U=}w>8fJ@cVu-a^^h?@?uRz}|?u4NJL|8|M zj^P1??%NFvx}3#8fh1o8|B~$YNb(*@-XqC-Bzcb{RLPb-B02DeC~V$O}6M}@PW T$1U)$;Q=j!t7SaG3Zj1ivn+U^ diff --git a/target/classes/com/stir/cscu9t4practical1/TrainingRecordGUI.class b/target/classes/com/stir/cscu9t4practical1/TrainingRecordGUI.class index 168b935d10324c11907bfded855de1194aa7f613..824b9de058385b4c4df1413454e3d6e78afcbed5 100644 GIT binary patch delta 2792 zcmbVO3vgUj8UDWAP3}H!-ra=F%PmRMq-hdbOG}ahwk2s(l0usrZ7tR%yCmBt8=6Pk zv<^$9(t)W6EWYZCaeR#rEL1lgg3gGFP+LR+5g#BbXni9pC|LZ?-Q5%`qccvDd%ypj z|9Q^$|2KE7e7K|d#F=})24DsETW}GJQ@6RB?ry)`YW78<(RgC0wYAlcLj1_ak8z5y zhGLVOV|yq4_$i*U@U)Ge;hEG;-uA#R@JkEN+ISAXN}cky*YCt>8^6JCiPAO0vB8}^ z*K{Q&$EUmY#wR8xh((P(Jw2&ftM>BMV`C$+NTSn^-{TJ!{%GS*c%CTP5!oGS8;K-_ z+OisieRW26ATlx)BixNmTm5(ef3fga8-K&|sS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@HMRGdEAU|U7KDo56_(aDmq`Isy(O0|?OEK3PWE6P%m(yFplPpQ2uH5Mpd zRu-EnU3pBdqSM*j8krS%l7igqIG(~%JdI1p)GmCR`FsaE`G;&2C+#$fw_v8!OpuXx ivB9WjlA{lo Date: Fri, 31 Mar 2023 11:53:40 +0200 Subject: [PATCH 6/6] Implemented the last couple test for the created methods --- .../stir/cscu9t4practical1/CycleEntry.java | 2 +- .../stir/cscu9t4practical1/SprintEntry.java | 6 ---- .../cscu9t4practical1/TrainingRecord.java | 11 ++++++ .../cscu9t4practical1/TrainingRecordGUI.java | 14 ++++++++ .../cscu9t4practical1/CycleEntryTest.java | 2 +- .../cscu9t4practical1/SprintEntryTest.java | 4 +-- .../stir/cscu9t4practical1/SwimEntryTest.java | 4 +-- .../TrainingRecordGUITest.java | 34 ++++++++++++++++-- .../stir/cscu9t4practical1/CycleEntry.class | Bin 1941 -> 1940 bytes .../stir/cscu9t4practical1/SprintEntry.class | Bin 1909 -> 1719 bytes .../cscu9t4practical1/TrainingRecord.class | Bin 3351 -> 3890 bytes .../cscu9t4practical1/TrainingRecordGUI.class | Bin 7502 -> 7902 bytes 12 files changed, 63 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java index 4ef7e6b4..d36ba80e 100644 --- a/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java +++ b/src/main/java/com/stir/cscu9t4practical1/CycleEntry.java @@ -29,7 +29,7 @@ public void setTempo(String tempo) { this.tempo = tempo; } public String getEntry(){ - String result = getName()+ " did a " + getTerrain() +" cycle for " + + String result = getName()+ " did a " + getTerrain() +" cycle for " + getDistance()+ " km in at a tempo of "+ getTempo() +" for " +getHour()+":"+getMin()+":"+ getSec() + " on " +getDay()+"/"+getMonth()+"/"+getYear()+"\n"; diff --git a/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java index 17aad3e1..cb78f39e 100644 --- a/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java +++ b/src/main/java/com/stir/cscu9t4practical1/SprintEntry.java @@ -15,16 +15,10 @@ public SprintEntry(String n, int d, int m, int y, int h, int min, int s, float d return repetitions; } - public void setRepetitions(int repetitions) { - this.repetitions = repetitions; - } public int getRecovery() { return recoveryIntervals; } - public void setRecovery(int recoveryIntervals) { - this.recoveryIntervals = recoveryIntervals; - } public String getEntry(){ String result = getName()+ " Sprinted " + getRepetitions() +" repetitions of: " + diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java index f8927e03..5dd17bb4 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecord.java @@ -61,6 +61,17 @@ public String lookupAllEntriesByName(String searchTerm){ } return result; } + public String removeAllEntries (int d, int m, int y,String n) { + ListIterator iter = tr.listIterator(); + String result = "No entries under that name and date"; + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.getDay()==d && current.getMonth()==m && current.getYear()==y && current.getName().equalsIgnoreCase(n)) + result = "Entry: "+n+ " on " +d+"/"+m+"/"+y+" was removed successfully"; + iter.remove(); + } + return result; + } // Count the number of entries public int getNumberOfEntries(){ return tr.size(); diff --git a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java index 9e4b99bc..921da7a2 100755 --- a/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java +++ b/src/main/java/com/stir/cscu9t4practical1/TrainingRecordGUI.java @@ -41,6 +41,7 @@ public class TrainingRecordGUI extends JFrame implements ActionListener { private JTextField tempoField = new JTextField(3); private JTextField terrainField = new JTextField(10); private JButton findAllBasedOnName = new JButton("Name Search"); + private JButton removeButton = new JButton("Remove Entry"); public static void main(String[] args) { TrainingRecordGUI applic = new TrainingRecordGUI(); @@ -95,6 +96,8 @@ public TrainingRecordGUI() { lookUpAllByDate.addActionListener(this); add(findAllBasedOnName); findAllBasedOnName.addActionListener(this); + add(removeButton); + removeButton.addActionListener(this); add(outputArea); outputArea.setEditable(false); @@ -121,6 +124,8 @@ public void actionPerformed(ActionEvent event) { } if (event.getSource() == findAllBasedOnName){ message = lookupAllEntriesByName(); + } if (event.getSource() == removeButton){ + message = removeAllEntries(); } outputArea.setText(message); blankDisplay(); @@ -188,6 +193,15 @@ public String lookupAllEntriesByName(){ String message = myAthletes.lookupAllEntriesByName(searchTerm); return message; } + public String removeAllEntries() { + int m = Integer.parseInt(month.getText()); + int d = Integer.parseInt(day.getText()); + int y = Integer.parseInt(year.getText()); + String n = name.getText(); + outputArea.setText("looking up record ..."); + String message = myAthletes.removeAllEntries(d, m, y,n); + return message; + } public void blankDisplay() { name.setText(""); diff --git a/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java index 7cc83ff9..37c2fdab 100644 --- a/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/CycleEntryTest.java @@ -164,7 +164,7 @@ public void testGetTempo() { public void testGetEntry() { System.out.println("getEntry"); Entry instance = new CycleEntry("Alice", 1, 2, 2003, 0, 16, 7, 3, "asphalt", "moderate"); - String expResult = "Alice cycled 3.0 km in 0:16:7 on 1/2/2003 on asphalt at moderate tempo\n"; + String expResult = "Alice did a asphalt cycle for 3.0 km in at a tempo of moderate for 0:16:7 on 1/2/2003\n"; String result = instance.getEntry(); assertEquals(expResult, result); } diff --git a/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java index fc585046..7b2976d9 100644 --- a/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/SprintEntryTest.java @@ -127,7 +127,7 @@ public void testGetSec() { public void testGetDistance() { System.out.println("getDistance"); Entry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); - float expResult = 3.0F; + float expResult = 300F; float result = instance.getDistance(); assertEquals(expResult, result, 0.0); } @@ -163,7 +163,7 @@ public void testGetRecovery() { public void testGetEntry() { System.out.println("getEntry"); Entry instance = new SprintEntry("Alice", 1, 2, 2003, 0, 16, 7, 300, 4, 2); - String expResult = "Alice sprinted 4x300m in 0:16:7 with 2 minutes recovery on 1/2/2003\n"; + String expResult = "Alice Sprinted 4 repetitions of: 300.0 km in With breaks of 2 mins in between 0:16:7 on 1/2/2003\n"; String result = instance.getEntry(); assertEquals(expResult, result); } diff --git a/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java b/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java index 83d62fe5..3b76c15a 100644 --- a/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java +++ b/src/test/java/com/stir/cscu9t4practical1/SwimEntryTest.java @@ -144,7 +144,7 @@ public void testGetWhere() { assertEquals(expResultA, result1); Entry instanceB = new SwimEntry("Alice", 1, 2, 2003, 0, 16, 7, 3,"pool"); - String expResultB = "in a pool"; + String expResultB = "pool"; String result2 = ((SwimEntry) instanceB).getWhere(); assertEquals(expResultB, result2); } @@ -155,7 +155,7 @@ public void testGetWhere() { public void testGetEntry() { System.out.println("getEntry"); Entry instance = new SwimEntry("Alice", 1, 2, 2003, 0, 16, 7, 3,"outdoors"); - String expResult = "Alice swam 3.0 km outdoors in 0:16:7 on 1/2/2003\n"; + String expResult = "Alice Swam outdoors for 3.0 km in 0:16:7 on 1/2/2003\n"; String result = instance.getEntry(); assertEquals(expResult, result); } diff --git a/src/test/java/com/stir/cscu9t4practical1/TrainingRecordGUITest.java b/src/test/java/com/stir/cscu9t4practical1/TrainingRecordGUITest.java index ce2c04db..91fb007b 100644 --- a/src/test/java/com/stir/cscu9t4practical1/TrainingRecordGUITest.java +++ b/src/test/java/com/stir/cscu9t4practical1/TrainingRecordGUITest.java @@ -92,18 +92,48 @@ public void testAddEntry(){ instance.fillDisplay(entry); String message = instance.addEntry("generic"); System.out.println(message); - assertEquals(message,"Record added\n"); + assertEquals(message,"Record added as run"); + } + @Test + public void testLookupAllEntries(){ + TrainingRecordGUI instance = new TrainingRecordGUI(); + Entry entry = new Entry("Alice", 1, 2, 2003, 0, 16, 7, 3); + instance.fillDisplay(entry); + String expected = "Alice ran 3.0 km in 0:16:7 on 1/2/2003\n"; + String message = instance.addEntry("generic"); + message = instance.lookupAllEntries(); + assertEquals(message,expected); } /** * Test to see if all display requirements have been met */ @Test + public void testRemoveAllEntries(){ + TrainingRecordGUI instance = new TrainingRecordGUI(); + Entry entry = new Entry("Alice", 1, 2, 2003, 0, 16, 7, 3); + instance.fillDisplay(entry); + instance.addEntry("generic"); + String result = instance.removeAllEntries(); + String expected = "Entry: Alice on 1/2/2003 was removed successfully"; + assertEquals(result,expected); + } + @Test + public void testLookupAllEntriesByName(){ + TrainingRecordGUI instance = new TrainingRecordGUI(); + Entry entry = new Entry("Alice", 1, 2, 2003, 0, 16, 7, 3); + instance.fillDisplay(entry); + instance.addEntry("generic"); + String result = instance.lookupAllEntriesByName(); + String expected = "Alice ran 3.0 km in 0:16:7 on 1/2/2003\n"; + assertEquals(result,expected); + } + @Test public void testButtonsPresentInGUI() throws IllegalAccessException, IllegalArgumentException{ System.out.println("Check if you have added the buttons"); TrainingRecordGUI instance = new TrainingRecordGUI(); Class instanceClass = instance.getClass(); - String[] expectedFields = {"findAllByDate","lookUpByDate"}; // add RemoveEntry when it is ready + String[] expectedFields = {"lookUpAllByDate","lookUpByDate","findAllBasedOnName","removeButton"}; // add RemoveEntry when it is ready Field fields[] = instanceClass.getDeclaredFields(); int found = 0; for (Field field : fields) { diff --git a/target/classes/com/stir/cscu9t4practical1/CycleEntry.class b/target/classes/com/stir/cscu9t4practical1/CycleEntry.class index d1d5ef2a8a368f86ed022ebf4c35a43fbcd1e633..043b4309a80391c909b88a5e8eccdaff6acfd454 100644 GIT binary patch delta 21 ccmbQrKZSpT9}9;Aqe4n%ibCS%a27je079_^v;Y7A delta 22 dcmbQjKb3!j9}A}=qe4n%ibA5o<}emJW&lU+1=Rom diff --git a/target/classes/com/stir/cscu9t4practical1/SprintEntry.class b/target/classes/com/stir/cscu9t4practical1/SprintEntry.class index e75e08dd31ac656eb8f60e9055635a73baa3ccc3..0c717bba415f7fb89ae06163033b39502b571200 100644 GIT binary patch delta 176 zcmWMexeCHS6r9bji7qh^EMmMmu~HBV4{W3HHpc50{GM0)34&rFSXfyJ;>U=k;w$E4 zn2&Qw>&NeU1JK0wq@M5pt|K%d+72)qR&eMAqK2TZib9G N7MwJ@7%Obx{{elk9wGn$ delta 379 zcmZ{eyGjF56h+sanM`z&j07d1!SO)~9WV%jFT~Er#Al+3Pp}A6Ok>0Z!SA>~VH-pQ z3o9!jVB?Pnw&HP2A)*{E_w3EytaG1vcb(^theu$JleW__3T`uORl@B;_bjr1tfj8L0z(YWdcY!qaD#r*Eu+vTr+< zt%4O+QOpW$8AAqaKYvHEEt?@1fD^m@Bp6^`bnZLF0*j&~Pl_~3za;#6E>4INKhaGn z*8XN>elv!olmCa&_r;J|*IBz<_2^}UETarFMv?I!t?4eeD0c=dNynrl_ZV!jDSwYR QTk`g(igIMDamX=)pJoIy^8f$< diff --git a/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class b/target/classes/com/stir/cscu9t4practical1/TrainingRecord.class index 8bb3478885fd60e0a14107aab3862a3a28c6ad02..a5efea7c438bec4e48be1f30d93bab732ce4e182 100644 GIT binary patch delta 1444 zcmZvbTW=dh7>3`m*Is+=#BCE*nA*`cC@D!$Eu=z`D1|fj|442?K4LwbLA~=pDKRJdt*Au}H=I%m`_k)OX9e}}IhChd=G(CWA zIEfYh3)JDNm~0|{UyU~wvjIa$VOaU^ROfWxU&c4E$_Rl|XsXCFiQ}Rc+(_){$@~j2 zF@{l`rdOQjvW_g{3|fqkcWd0qI%Rm=MOkeI>o`l&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cscu9t4practical1/TrainingRecordGUI.class b/target/classes/com/stir/cscu9t4practical1/TrainingRecordGUI.class index 824b9de058385b4c4df1413454e3d6e78afcbed5..ceaf64df9553489f09af56a86676ac6b0adc954c 100644 GIT binary patch literal 7902 zcmb_h3w%^png4$?lgwmtNkT$M1Eihu2uXMZDupruN&*QDO?U+;fztM7=8_DVN1O*C zMQLfV)rzZV>!WoQ?Mi+3VM%CF`*791*4EmsYqxI2N42}|uDk2H>!Q~GIrrX40%>%A zyZlJb_d4gE?|Hs+^2{F|{W^dZa+@C>!NN!?(U{4`(v6W!B)2lVY#?n$vayI6U)s1m zZN`$ZWbZaBl1fK6>}U@{;4@HwLP6mw^0I3L-n#mo0R#l4u6)Rz5JV8gei&-P6hZlZ z^MHA&8#lJ4&4eYWtm{zZ#<)phS2j&vQ~gdqN(Ix$$#1s~X4_&`JQ_p^rm7{& zxtF^3`kh7G)HDN?m`*}cuX>SQH2y4U23ZH3Umck1XsbscKQ7$%c ziC%5UGSiB1se##Aq%W0AXB1_wfq7aa5ld>qd;@iwkg+0~&|qMJCPZVItRIWcH$aEk zW5ok#q$NX}xa)8b3sJ1rzRbYeu#C#Y&7LH68?TI>*A&2V?l`pG915!`R~T67PKgH4 zB=Cnil{%Wc+Q1r@n+Ra7`eZj%)65nF>s;ng0Ih23RZ30G-C*DMm4pQDr;tk zflkFN;6@W%c(dYmQGdX2Cl~qw38W)Zeu8ox05}KhU($s9jR1*XvcsuRn&l` zW*KqPb_}!(tv9n)0KI}@M=I1Dk1NTTf&EId)RrXG7WN}9sQ6o#_QkENl@ToH__G&k@`Dp9$Js`Oc5~V?gGeK%vf=>UQP=LI#X$o@xRGB><+1}g zEhwlOZzp#Jog42k@Jwg#+hEE`KDGkNAM25wc%DQT98 z16Fz{&v}=D+w^K#D>0DDlizLNJ&J5(t+c8zni0Tz=>e4pj36@|(TVsz1An1BP`)pg zj4Jz^87sOusiXq<09V*%CHTouYciYGx%@!`AJWcEYla;Ie%$4RRHHeVZETCD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