Skip to content

Package: MainViewTreeArea

MainViewTreeArea

nameinstructionbranchcomplexitylinemethod
MainViewTreeArea(MainView)
M: 54 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
configJScrollPane()
M: 56 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
configJTree()
M: 21 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getItemForGraphicalConfig()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPopSaveAssignment()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPopupForGraphicalConfig()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSaveMenuItem()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTree()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package gui.view;
2:
3: import java.awt.Color;
4:
5: import javax.swing.JMenuItem;
6: import javax.swing.JPopupMenu;
7: import javax.swing.JScrollPane;
8: import javax.swing.JTree;
9: import javax.swing.SpringLayout;
10: import javax.swing.border.BevelBorder;
11:
12: /**
13: * The tree area of the mainview.
14: *
15: * @author Phil
16: *
17: */
18: public class MainViewTreeArea {
19:         /**
20:          * The mainview.
21:          */
22:         private final MainView mainView;
23:         /**
24:          * the tree scrollpane.
25:          */
26:         private final JScrollPane scrollPTree;
27:         /**
28:          * the tree.
29:          */
30:         private final JTree tree;
31:         /**
32:          * the popup-menu for assignmentfile-leafs.
33:          */
34:         private final JPopupMenu popSaveAssignment;
35:
36:         /**
37:          * the popup-menu for menuForGraphicalConfig.
38:          */
39:         private final JPopupMenu popForGraphicalConfig;
40:
41:         /**
42:          * the saveMenuItem for pop.
43:          */
44:         private final JMenuItem saveMenuItem;
45:         /**
46:          * the itemForGraphicalConfig for menuForGraphicalConfig.
47:          */
48:         private final JMenuItem itemForGraphicalConfig;
49:
50:         /**
51:          *
52:          * @param mainView
53:          * The mainview to set.
54:          */
55:         public MainViewTreeArea(final MainView mainView) {
56:                 this.mainView = mainView;
57:
58:                 this.scrollPTree = new JScrollPane();
59:
60:                 this.configJScrollPane();
61:
62:                 this.tree = new JTree();
63:                 this.configJTree();
64:
65:                 this.saveMenuItem = new JMenuItem(basic.GuiConstants.SAVEASSIGNBTNTEXT);
66:                 this.popSaveAssignment = new JPopupMenu();
67:                 this.popSaveAssignment.add(this.saveMenuItem);
68:
69:                 this.itemForGraphicalConfig = new JMenuItem(basic.GuiConstants.OPENGRAPHICALCONFIGTEXT);
70:                 this.popForGraphicalConfig = new JPopupMenu();
71:                 this.popForGraphicalConfig.add(this.itemForGraphicalConfig);
72:         }
73:
74:         /**
75:          * method for set padding, width and height of JScrollPane.
76:          */
77:         private void configJScrollPane() {
78:                 this.mainView.getSlLeftTreePanel().putConstraint(SpringLayout.NORTH, this.scrollPTree, 0,
79:                                 SpringLayout.NORTH, this.mainView.getLeftTreePanel());
80:                 this.mainView.getSlLeftTreePanel().putConstraint(SpringLayout.EAST, this.scrollPTree, 0,
81:                                 SpringLayout.EAST, this.mainView.getLeftTreePanel());
82:                 this.mainView.getSlLeftTreePanel().putConstraint(SpringLayout.SOUTH, this.scrollPTree, 0,
83:                                 SpringLayout.SOUTH, this.mainView.getLeftTreePanel());
84:                 this.mainView.getSlLeftTreePanel().putConstraint(SpringLayout.WEST, this.scrollPTree, 0,
85:                                 SpringLayout.WEST, this.mainView.getLeftTreePanel());
86:
87:                 this.mainView.getLeftTreePanel().add(this.scrollPTree);
88:         }
89:
90:         /**
91:          * method for set the design of the border of JTree.
92:          */
93:         private void configJTree() {
94:                 this.tree.setLargeModel(true);
95:                 this.scrollPTree.setViewportView(this.tree);
96:                 this.tree.setBorder(new BevelBorder(BevelBorder.RAISED, Color.DARK_GRAY, Color.GRAY,
97:                                 Color.LIGHT_GRAY, Color.WHITE));
98:         }
99:
100:         /**
101:          * @return the tree
102:          */
103:         public JTree getTree() {
104:                 return this.tree;
105:         }
106:
107:         /**
108:          * @return the pop
109:          */
110:         public JPopupMenu getPopSaveAssignment() {
111:                 return this.popSaveAssignment;
112:         }
113:
114:         /**
115:          * @return the saveMenuItem
116:          */
117:         public JMenuItem getSaveMenuItem() {
118:                 return this.saveMenuItem;
119:         }
120:
121:         /**
122:          * @return the menuForGraphicalConfig
123:          */
124:         public JPopupMenu getPopupForGraphicalConfig() {
125:                 return popForGraphicalConfig;
126:         }
127:
128:         /**
129:          * @return the itemForGraphicalConfig
130:          */
131:         public JMenuItem getItemForGraphicalConfig() {
132:                 return itemForGraphicalConfig;
133:         }
134: }