Browse Source

Selected Algorithm is now blue

Kevin Trometer 8 years ago
parent
commit
ac1e4ae9e4
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/ui/view/AlgorithmMenu.java

+ 10 - 0
src/ui/view/AlgorithmMenu.java

@@ -1,5 +1,6 @@
 package ui.view;
 
+import java.awt.Color;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.BufferedReader;
@@ -95,6 +96,10 @@ public class AlgorithmMenu extends JMenu {
 								
 								@Override
 								public void actionPerformed(ActionEvent e) {
+									for (int i = 0; i < mnSelectAlgorithm.getItemCount(); i++) {
+										mnSelectAlgorithm.getItem(i).setForeground(null);
+									}
+									tempItem.setForeground(Color.BLUE);
 									setAlgorithm(algosHash.get(tempItem.getText()), tempItem.getText());
 								}
 							});
@@ -111,9 +116,14 @@ public class AlgorithmMenu extends JMenu {
 		this.add(algoFolderButton);
 		this.add(mnSelectAlgorithm);
 		mnSelectAlgorithm.add(noneItem);
+		noneItem.setForeground(Color.BLUE);
 		noneItem.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {
+				for (int i = 0; i < mnSelectAlgorithm.getItemCount(); i++) {
+					mnSelectAlgorithm.getItem(i).setForeground(null);
+				}
+				noneItem.setForeground(Color.BLUE);
 				controller.setAlgorithm(null);
 			}
 		});