Skip to content

Commit c7b3401

Browse files
authored
Merge pull request #211 from junhaotan/master
Remove unused code
2 parents f01eb7b + f4e1288 commit c7b3401

File tree

5 files changed

+0
-110
lines changed

5 files changed

+0
-110
lines changed

src/main/java/seedu/address/logic/parser/ParserUtil.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -213,38 +213,6 @@ public static ProductQuantity parseProductQuantity(String quantity) throws Parse
213213
return new ProductQuantity(trimmedQuantity);
214214
}
215215

216-
/**
217-
* Parses a {@code String customer} into an {@code Customer}.
218-
* Leading and trailing whitespaces will be trimmed.
219-
*
220-
* @throws ParseException if the given {@code customer} is invalid.
221-
*/
222-
public static String parseCustomer(String customer) throws ParseException {
223-
requireNonNull(customer);
224-
String trimmedCustomer = customer.trim();
225-
// if (!Sales.isValidSales(trimmedSales)) {
226-
// throw new ParseException(Quantity.MESSAGE_CONSTRAINTS);
227-
// }
228-
// return new Sales(trimmedSales);
229-
return trimmedCustomer;
230-
}
231-
232-
/**
233-
* Parses a {@code String product} into an {@code product}.
234-
* Leading and trailing whitespaces will be trimmed.
235-
*
236-
* @throws ParseException if the given {@code product} is invalid.
237-
*/
238-
public static String parseProduct(String product) throws ParseException {
239-
requireNonNull(product);
240-
String trimmedProduct = product.trim();
241-
// if (!Sales.isValidSales(trimmedSales)) {
242-
// throw new ParseException(Quantity.MESSAGE_CONSTRAINTS);
243-
// }
244-
// return new Sales(trimmedSales);
245-
return trimmedProduct;
246-
}
247-
248216
/**
249217
* Parses a {@code String product} into an {@code product}.
250218
* Leading and trailing whitespaces will be trimmed.

src/main/java/seedu/address/ui/HelpWindow.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import java.util.logging.Logger;
55

66
import javafx.fxml.FXML;
7-
import javafx.scene.control.Button;
8-
import javafx.scene.input.Clipboard;
9-
import javafx.scene.input.ClipboardContent;
107
import javafx.scene.media.MediaException;
118
import javafx.scene.web.WebView;
129
import javafx.stage.Stage;
@@ -22,9 +19,6 @@ public class HelpWindow extends UiPart<Stage> {
2219
private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
2320
private static final String FXML = "HelpWindow.fxml";
2421

25-
@FXML
26-
private Button copyButton;
27-
2822
@FXML
2923
private WebView webView;
3024

@@ -83,28 +77,11 @@ public boolean isShowing() {
8377
return getRoot().isShowing();
8478
}
8579

86-
/**
87-
* Hides the help window.
88-
*/
89-
public void hide() {
90-
getRoot().hide();
91-
}
92-
9380
/**
9481
* Focuses on the help window.
9582
*/
9683
public void focus() {
9784
getRoot().requestFocus();
9885
}
9986

100-
/**
101-
* Copies the URL to the user guide to the clipboard.
102-
*/
103-
@FXML
104-
private void copyUrl() {
105-
final Clipboard clipboard = Clipboard.getSystemClipboard();
106-
final ClipboardContent url = new ClipboardContent();
107-
url.putString(USERGUIDE_URL);
108-
clipboard.setContent(url);
109-
}
11087
}

src/main/java/seedu/address/ui/MainWindow.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
import java.util.logging.Logger;
44

55
import javafx.application.Platform;
6-
import javafx.event.ActionEvent;
76
import javafx.fxml.FXML;
87
import javafx.geometry.Pos;
98
import javafx.scene.chart.XYChart;
109
import javafx.scene.control.Label;
11-
import javafx.scene.control.MenuItem;
12-
import javafx.scene.control.TextInputControl;
13-
import javafx.scene.input.KeyCombination;
14-
import javafx.scene.input.KeyEvent;
1510
import javafx.scene.layout.HBox;
1611
import javafx.scene.layout.Priority;
1712
import javafx.scene.layout.StackPane;
@@ -83,7 +78,6 @@ public MainWindow(Stage primaryStage, Logic logic) {
8378

8479
// Configure the UI
8580
setWindowDefaultSize(logic.getGuiSettings());
86-
setAccelerators();
8781

8882
helpWindow = new HelpWindow();
8983
notificationWindow = new NotificationWindow();
@@ -94,39 +88,6 @@ public Stage getPrimaryStage() {
9488
return primaryStage;
9589
}
9690

97-
private void setAccelerators() {
98-
// setAccelerator(helpMenuItem, KeyCombination.valueOf("F1"));
99-
}
100-
101-
/**
102-
* Sets the accelerator of a MenuItem.
103-
* @param keyCombination the KeyCombination value of the accelerator
104-
*/
105-
private void setAccelerator(MenuItem menuItem, KeyCombination keyCombination) {
106-
menuItem.setAccelerator(keyCombination);
107-
108-
/*
109-
* TODO: the code below can be removed once the bug reported here
110-
* https://bugs.openjdk.java.net/browse/JDK-8131666
111-
* is fixed in later version of SDK.
112-
*
113-
* According to the bug report, TextInputControl (TextField, TextArea) will
114-
* consume function-key events. Because CommandBox contains a TextField, and
115-
* ResultDisplay contains a TextArea, thus some accelerators (e.g F1) will
116-
* not work when the focus is in them because the key event is consumed by
117-
* the TextInputControl(s).
118-
*
119-
* For now, we add following event filter to capture such key events and open
120-
* help window purposely so to support accelerators even when focus is
121-
* in CommandBox or ResultDisplay.
122-
*/
123-
getRoot().addEventFilter(KeyEvent.KEY_PRESSED, event -> {
124-
if (event.getTarget() instanceof TextInputControl && keyCombination.match(event)) {
125-
menuItem.getOnAction().handle(new ActionEvent());
126-
event.consume();
127-
}
128-
});
129-
}
13091

13192
/**
13293
* Fills up all the placeholders of this window.

src/main/java/seedu/address/ui/NotificationWindow.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ public boolean isShowing() {
7070
return getRoot().isShowing();
7171
}
7272

73-
/**
74-
* Hides the notification window.
75-
*/
76-
public void hide() {
77-
getRoot().hide();
78-
}
79-
8073
/**
8174
* Focuses on the notification window.
8275
*/

src/main/java/seedu/address/ui/PlotWindow.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,4 @@ public boolean isShowing() {
7777
public void focus() {
7878
getRoot().requestFocus();
7979
}
80-
81-
82-
/**
83-
* Hides the plot window.
84-
*/
85-
public void hide() {
86-
getRoot().hide();
87-
}
88-
8980
}

0 commit comments

Comments
 (0)