Browse Source

Adds UserStudy Feedback: + & - icons to TreeView for showing/hiding

Andreas T. Meyer-Berg 5 years ago
parent
commit
735f51bea2

+ 8 - 0
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreePanel.java

@@ -9,12 +9,14 @@ import java.util.LinkedList;
 import java.util.Observable;
 import java.util.Observer;
 
+import javax.swing.ImageIcon;
 import javax.swing.JFrame;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
 import javax.swing.JTree;
 import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
 import javax.swing.event.TreeExpansionEvent;
 import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
@@ -32,6 +34,7 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Link;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Port;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.configuration.NetworkTreeNodeStatus;
+import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
 
 /**
  * Network Tree Panel which visualizes the Network as a Tree
@@ -250,6 +253,11 @@ public class NetworkTreePanel extends JScrollPane implements Observer {
 				super.windowClosing(e);
 			}
 		});
+		
+		//Adds + - as icons for expanding and collapsing the tree
+		UIManager.put("Tree.expandedIcon",  new ImageIcon(Utility.loadFile("images/treeMinus.gif")));
+		UIManager.put("Tree.collapsedIcon", new ImageIcon(Utility.loadFile("images/treePlus.gif")));
+		
 		update(null, null);
 	}
 

+ 1 - 1
src/main/resources/images/imageSources.txt

@@ -1 +1 @@
-smartHome_icon.png from https://pixabay.com/en/icon-smart-home-house-technology-3317456/ under https://pixabay.com/en/service/license/
+smartHome_icon.png from https://pixabay.com/en/icon-smart-home-house-technology-3317456/ under https://pixabay.com/en/service/license/

BIN
src/main/resources/images/treeMinus.gif


BIN
src/main/resources/images/treePlus.gif