[18093] | 1 | package org.greenstone.gsdl3_extension.mat;
|
---|
| 2 |
|
---|
| 3 | import java.awt.*;
|
---|
| 4 | import java.awt.event.*;
|
---|
| 5 | import java.awt.Dimension;
|
---|
| 6 | import java.awt.Component;
|
---|
| 7 | import javax.swing.*;
|
---|
| 8 |
|
---|
| 9 | import java.util.ArrayList;
|
---|
| 10 | import java.util.Arrays;
|
---|
| 11 | import java.util.Collection;
|
---|
| 12 | import java.util.HashMap;
|
---|
| 13 | import java.util.Iterator;
|
---|
| 14 | import java.util.Set;
|
---|
| 15 |
|
---|
| 16 | public class SummaryPanel extends JPanel {
|
---|
| 17 |
|
---|
| 18 | MetadataStats ms_stats;
|
---|
| 19 | DataMaker data_Maker ;
|
---|
| 20 | ArrayList metadataNameList;
|
---|
| 21 |
|
---|
| 22 | final int label_width = 320;
|
---|
| 23 | final int label_width1 = 200;
|
---|
| 24 | final int label_height = 30;
|
---|
| 25 | final int label_x_1 = 30;
|
---|
| 26 | final int label_x_2 = 325;
|
---|
| 27 | final int label_font_size = 16;
|
---|
| 28 |
|
---|
| 29 | private int totalMetadataItem = 0;
|
---|
| 30 | private int totalDocument = 0;
|
---|
| 31 | private int totalMetadataElement = 0;
|
---|
| 32 |
|
---|
| 33 | private HashMap jListDataModel = new HashMap();
|
---|
| 34 |
|
---|
| 35 | public SummaryPanel(MetadataStats arg1) {
|
---|
| 36 |
|
---|
| 37 | ms_stats = arg1;
|
---|
| 38 | data_Maker = new DataMaker(ms_stats);
|
---|
| 39 | metadataNameList = arg1.metadataNameList;
|
---|
| 40 | totalDocument = data_Maker.getTotalDocNumber();
|
---|
| 41 | calculateTotalMetadataItem();
|
---|
| 42 |
|
---|
| 43 | try {
|
---|
| 44 | jbInit();
|
---|
| 45 | } catch (Exception ex) {
|
---|
| 46 | ex.printStackTrace();
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | private void calculateTotalMetadataItem(){
|
---|
| 51 |
|
---|
| 52 | HashMap setMap = ms_stats.getMetadataSetMap();
|
---|
| 53 | Collection c = setMap.values();
|
---|
| 54 | Iterator i = c.iterator();
|
---|
| 55 |
|
---|
| 56 | while(i.hasNext()){
|
---|
| 57 | MetadataSet mt = (MetadataSet) i.next();
|
---|
| 58 | totalMetadataElement = totalMetadataElement + mt.getIndexsList().size();
|
---|
| 59 | }
|
---|
| 60 | totalMetadataItem = totalMetadataElement *totalDocument;
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | private void jbInit() throws Exception {
|
---|
| 64 |
|
---|
| 65 | JTabbedPane tabbedPane = new JTabbedPane();
|
---|
| 66 | data_Maker.setTotalDocNumber();
|
---|
| 67 |
|
---|
| 68 | elements = new String [metadataNameList.size()];
|
---|
| 69 |
|
---|
| 70 | for(int i = 0; i<elements.length; i++){
|
---|
| 71 | elements[i] = (String)metadataNameList.get(i);
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | Arrays.sort(elements);
|
---|
| 75 | jComboBox1 = new JComboBox(elements);
|
---|
| 76 | jComboBox2 = new JComboBox(sortOptions);
|
---|
| 77 |
|
---|
| 78 | HashMap mdsMap = ms_stats.getMetadataSetMap();
|
---|
| 79 | MDS_list = new String[mdsMap.size()];
|
---|
| 80 | int counter = 0;
|
---|
| 81 | Set set_key = mdsMap.keySet();
|
---|
| 82 | Iterator i = set_key.iterator();
|
---|
| 83 |
|
---|
| 84 | while(i.hasNext()){
|
---|
| 85 | MDS_list[counter] = (String) i.next();
|
---|
| 86 | counter++;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | jComboBox3 = new JComboBox(MDS_list);
|
---|
| 90 |
|
---|
| 91 | JComponent panel1 = new JPanel();
|
---|
| 92 | panel1.setLayout(new AbsoluteLayout());
|
---|
| 93 |
|
---|
| 94 | jLabel27.setText("Number of Documents : ");
|
---|
| 95 | jLabel27.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 96 |
|
---|
| 97 | jLabel28.setText("Number of Metadata Set : ");
|
---|
| 98 | jLabel28.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 99 |
|
---|
| 100 | jLabel29.setText("Overall Completeness : ");
|
---|
| 101 | jLabel29.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 102 |
|
---|
| 103 | jLabel30.setText("Date of Build : ");
|
---|
| 104 | jLabel30.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 105 |
|
---|
| 106 | jLabel35.setText(" ");
|
---|
| 107 | jLabel35.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 108 | jLabel35.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 109 |
|
---|
| 110 | jLabel36.setText(" ");
|
---|
| 111 | jLabel36.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 112 | jLabel36.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 113 |
|
---|
| 114 | jLabel37.setText(" ");
|
---|
| 115 | jLabel37.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 116 | jLabel37.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 117 |
|
---|
| 118 | jLabel38.setText(" ");
|
---|
| 119 | jLabel38.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 120 | jLabel38.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 121 |
|
---|
| 122 | jLabel39.setText("Hide Empty Metadata Element");
|
---|
| 123 | jLabel39.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 124 |
|
---|
| 125 | jLabel40.setText("Hide Completed Metadata Element ");
|
---|
| 126 | jLabel40.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 127 |
|
---|
| 128 | jLabel41.setText("Hide Document with empty metadata element set");
|
---|
| 129 | jLabel41.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 130 |
|
---|
| 131 | jLabel42.setText("Hide Document with completed metadata element set");
|
---|
| 132 | jLabel42.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 133 |
|
---|
| 134 | jButton1.setText("Indexes");
|
---|
| 135 | jButton1.setPreferredSize(new Dimension(150,20));
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | ActionListener doIt1 = new ActionListener() {
|
---|
| 139 | public void actionPerformed(ActionEvent ae) {
|
---|
| 140 | jButton1_actionPerformed(ae);
|
---|
| 141 | }
|
---|
| 142 | };
|
---|
| 143 |
|
---|
| 144 | ActionListener cursorDoIt1 = CursorController.createListener(this, doIt1);
|
---|
| 145 | jButton1.addActionListener(cursorDoIt1);
|
---|
| 146 |
|
---|
| 147 | jLabel31.setText("Metadata Set completeness");
|
---|
| 148 | jLabel31.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 149 |
|
---|
| 150 | jButton8.setText("Table");
|
---|
| 151 | jButton8.setPreferredSize(new Dimension(150,20));
|
---|
| 152 | jButton8.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 153 |
|
---|
| 154 | ActionListener doIt8 = new ActionListener() {
|
---|
| 155 | public void actionPerformed(ActionEvent ae) {
|
---|
| 156 | jButton8_actionPerformed(ae);
|
---|
| 157 | }
|
---|
| 158 | };
|
---|
| 159 |
|
---|
| 160 | ActionListener cursorDoIt8 = CursorController.createListener(this, doIt8);
|
---|
| 161 | jButton8.addActionListener(cursorDoIt8);
|
---|
| 162 |
|
---|
| 163 | jButton9.setText("Customise");
|
---|
| 164 | jButton9.setPreferredSize(new Dimension(200,20));
|
---|
| 165 | jButton9.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 166 |
|
---|
| 167 | ActionListener doIt9 = new ActionListener() {
|
---|
| 168 | public void actionPerformed(ActionEvent ae) {
|
---|
| 169 | jButton9_actionPerformed(ae);
|
---|
| 170 | }
|
---|
| 171 | };
|
---|
| 172 |
|
---|
| 173 | ActionListener cursorDoIt9 = CursorController.createListener(this, doIt9);
|
---|
| 174 | jButton9.addActionListener(cursorDoIt9);
|
---|
| 175 |
|
---|
| 176 | jList1 = new JList();
|
---|
| 177 | jCheckBox1 = new JCheckBox();
|
---|
| 178 | jCheckBox2 = new JCheckBox();
|
---|
| 179 | jCheckBox3 = new JCheckBox();
|
---|
| 180 | jCheckBox4 = new JCheckBox();
|
---|
| 181 |
|
---|
| 182 | jList1.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 183 |
|
---|
| 184 | JPanel panel4 = new JPanel();
|
---|
| 185 | panel4.setLayout(new AbsoluteLayout());
|
---|
| 186 | panel4.setBorder(BorderFactory.createLineBorder(Color.black));
|
---|
| 187 | panel4.add(jLabel39,new AbsoluteConstraints(35,5,400,label_height));
|
---|
| 188 | panel4.add(jLabel40,new AbsoluteConstraints(35,40,400,label_height));
|
---|
| 189 | panel4.add(jLabel41,new AbsoluteConstraints(35,75,400,label_height));
|
---|
| 190 | panel4.add(jLabel42,new AbsoluteConstraints(35,110,400,label_height));
|
---|
| 191 |
|
---|
| 192 | panel4.add(jCheckBox1,new AbsoluteConstraints(10,7,20,20));
|
---|
| 193 | panel4.add(jCheckBox2,new AbsoluteConstraints(10,42,20,20));
|
---|
| 194 | panel4.add(jCheckBox3,new AbsoluteConstraints(10,77,20,20));
|
---|
| 195 | panel4.add(jCheckBox4,new AbsoluteConstraints(10,112,20,20));
|
---|
| 196 |
|
---|
| 197 | panel1.add(jButton1,new AbsoluteConstraints(50,650,100,30));
|
---|
| 198 | panel1.add(jButton9,new AbsoluteConstraints(270,650,100,30));
|
---|
| 199 | panel1.add(jLabel27, new AbsoluteConstraints(label_x_1, 20, label_width, label_height));
|
---|
| 200 | panel1.add(jLabel28, new AbsoluteConstraints(label_x_1, 55, label_width, label_height));
|
---|
| 201 | panel1.add(jLabel29, new AbsoluteConstraints(label_x_1, 90, label_width, label_height));
|
---|
| 202 |
|
---|
| 203 | panel1.add(jLabel31, new AbsoluteConstraints(label_x_1, 160, label_width, label_height));
|
---|
| 204 | panel1.add(jLabel35, new AbsoluteConstraints(label_x_2, 20, label_width1, label_height));
|
---|
| 205 | panel1.add(jLabel36, new AbsoluteConstraints(label_x_2, 55, label_width1, label_height));
|
---|
| 206 | panel1.add(jLabel37, new AbsoluteConstraints(label_x_2, 90, label_width1, label_height));
|
---|
| 207 | panel1.add(new JScrollPane(jList1), new AbsoluteConstraints(label_x_1, 200, 480, 200));
|
---|
| 208 | panel1.add(panel4, new AbsoluteConstraints(label_x_1, 410, 480, 150));
|
---|
| 209 |
|
---|
| 210 |
|
---|
| 211 | //------------------------SECOND PANEL ---------------------------
|
---|
| 212 | jComboBox1.addItemListener(new SummaryPanel_jComboBox1_itemAdapter(this));
|
---|
| 213 | jComboBox1.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 214 |
|
---|
| 215 | jComboBox2.addItemListener(new SummaryPanel_jComboBox2_itemAdapter(this));
|
---|
| 216 | jComboBox2.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 217 |
|
---|
| 218 | JComponent panel2 = new JPanel();
|
---|
| 219 | panel2.setLayout(new AbsoluteLayout());
|
---|
| 220 |
|
---|
| 221 | jLabel1.setText("Metadata : ");
|
---|
| 222 | jLabel1.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 223 |
|
---|
| 224 | jLabel2.setText("Unique Value : ");
|
---|
| 225 | jLabel2.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 226 |
|
---|
| 227 | jLabel3.setText(" ");
|
---|
| 228 | jLabel3.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 229 |
|
---|
| 230 | jLabel4.setText("Total times element used :");
|
---|
| 231 | jLabel4.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 232 |
|
---|
| 233 | jLabel5.setText(" ");
|
---|
| 234 | jLabel5.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 235 |
|
---|
| 236 | jLabel6.setText("No. of records containing element :");
|
---|
| 237 | jLabel6.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 238 |
|
---|
| 239 | jLabel7.setText(" ");
|
---|
| 240 | jLabel7.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 241 |
|
---|
| 242 | jLabel8.setText("Completeness %:");
|
---|
| 243 | jLabel8.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 244 |
|
---|
| 245 | jLabel9.setText(" ");
|
---|
| 246 | jLabel9.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 247 |
|
---|
| 248 | jLabel10.setText("Median : ");
|
---|
| 249 | jLabel10.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 250 |
|
---|
| 251 | jLabel11.setText(" ");
|
---|
| 252 | jLabel11.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 253 |
|
---|
| 254 | jLabel12.setText("Smallest number : ");
|
---|
| 255 | jLabel12.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 256 |
|
---|
| 257 | jLabel13.setText(" ");
|
---|
| 258 | jLabel13.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 259 |
|
---|
| 260 | jLabel14.setText("Largest number : ");
|
---|
| 261 | jLabel14.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 262 |
|
---|
| 263 | jLabel15.setText(" ");
|
---|
| 264 | jLabel15.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 265 |
|
---|
| 266 | jLabel16.setText("Average : ");
|
---|
| 267 | jLabel16.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 268 |
|
---|
| 269 | jLabel17.setText(" ");
|
---|
| 270 | jLabel17.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 271 |
|
---|
| 272 | jLabel18.setText("Mode : ");
|
---|
| 273 | jLabel18.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 274 |
|
---|
| 275 | jLabel19.setText(" ");
|
---|
| 276 | jLabel19.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 277 |
|
---|
| 278 | jLabel20.setText("Mode Frequency : ");
|
---|
| 279 | jLabel20.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 280 |
|
---|
| 281 | jLabel21.setText(" ");
|
---|
| 282 | jLabel21.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 283 |
|
---|
| 284 | jLabel22.setText("Choose a sorting method : ");
|
---|
| 285 | jLabel22.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 286 |
|
---|
| 287 | jLabel23.setText("First Five :");
|
---|
| 288 | jLabel23.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 289 |
|
---|
| 290 | jLabel24.setText(" ");
|
---|
| 291 | jLabel24.setBorder(BorderFactory.createLineBorder(Color.black));
|
---|
| 292 |
|
---|
| 293 | jLabel25.setText("Last Five :");
|
---|
| 294 | jLabel25.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 295 |
|
---|
| 296 | jLabel26.setText(" ");
|
---|
| 297 | jLabel26.setBorder(BorderFactory.createLineBorder(Color.black));
|
---|
| 298 |
|
---|
| 299 | jTextPane1.setSize(new Dimension(150,200));
|
---|
| 300 | jTextPane1.setOpaque(false);
|
---|
| 301 | jTextPane1.setAutoscrolls(true);
|
---|
| 302 |
|
---|
| 303 |
|
---|
| 304 | jTextPane2.setSize(new Dimension(150,200));
|
---|
| 305 | jTextPane2.setAutoscrolls(true);
|
---|
| 306 | jTextPane2.setOpaque(false);
|
---|
| 307 |
|
---|
| 308 | jButton2.setText("Uniques v Frequency");
|
---|
| 309 | jButton2.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 310 | ActionListener doIt2 = new ActionListener() {
|
---|
| 311 | public void actionPerformed(ActionEvent ae) {
|
---|
| 312 | jButton2_actionPerformed(ae);
|
---|
| 313 | }
|
---|
| 314 | };
|
---|
| 315 |
|
---|
| 316 | ActionListener cursorDoIt2 = CursorController.createListener(this, doIt2);
|
---|
| 317 | jButton2.addActionListener(cursorDoIt2);
|
---|
| 318 |
|
---|
| 319 | jButton3.setText("Documents v Frequency");
|
---|
| 320 | jButton3.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 321 | ActionListener doIt3 = new ActionListener() {
|
---|
| 322 | public void actionPerformed(ActionEvent ae) {
|
---|
| 323 | jButton3_actionPerformed(ae);
|
---|
| 324 | }
|
---|
| 325 | };
|
---|
| 326 |
|
---|
| 327 | ActionListener cursorDoIt3 = CursorController.createListener(this, doIt3);
|
---|
| 328 | jButton3.addActionListener(cursorDoIt3);
|
---|
| 329 |
|
---|
| 330 | panel2.add(jLabel1, new AbsoluteConstraints(label_x_1, 20, label_width, label_height));
|
---|
| 331 | panel2.add(jComboBox1, new AbsoluteConstraints(label_x_2, 20, label_width1, label_height));
|
---|
| 332 | panel2.add(jLabel2, new AbsoluteConstraints(label_x_1, 50, label_width, label_height));
|
---|
| 333 | panel2.add(jLabel3, new AbsoluteConstraints(label_x_2, 50, label_width1, label_height));
|
---|
| 334 | panel2.add(jLabel4, new AbsoluteConstraints(label_x_1, 80, label_width, label_height));
|
---|
| 335 | panel2.add(jLabel5, new AbsoluteConstraints(label_x_2, 80, label_width1, label_height));
|
---|
| 336 | panel2.add(jLabel6, new AbsoluteConstraints(label_x_1, 110, label_width, label_height));
|
---|
| 337 | panel2.add(jLabel7, new AbsoluteConstraints(label_x_2, 110, label_width1, label_height));
|
---|
| 338 | panel2.add(jLabel8, new AbsoluteConstraints(label_x_1, 140, label_width, label_height));
|
---|
| 339 | panel2.add(jLabel9, new AbsoluteConstraints(label_x_2, 140, label_width1, label_height));
|
---|
| 340 | panel2.add(jLabel10, new AbsoluteConstraints(label_x_1, 170, label_width, label_height));
|
---|
| 341 | panel2.add(jLabel11, new AbsoluteConstraints(label_x_2, 170, label_width1, label_height));
|
---|
| 342 | panel2.add(jLabel12, new AbsoluteConstraints(label_x_1, 200, label_width, label_height));
|
---|
| 343 | panel2.add(jLabel13, new AbsoluteConstraints(label_x_2, 200, label_width1, label_height));
|
---|
| 344 | panel2.add(jLabel14, new AbsoluteConstraints(label_x_1, 230, label_width, label_height));
|
---|
| 345 | panel2.add(jLabel15, new AbsoluteConstraints(label_x_2, 230, label_width1, label_height));
|
---|
| 346 | panel2.add(jLabel16, new AbsoluteConstraints(label_x_1, 260, label_width, label_height));
|
---|
| 347 | panel2.add(jLabel17, new AbsoluteConstraints(label_x_2, 260, label_width1, label_height));
|
---|
| 348 | panel2.add(jLabel18, new AbsoluteConstraints(label_x_1, 290, label_width, label_height));
|
---|
| 349 | panel2.add(jLabel19, new AbsoluteConstraints(label_x_2, 290, label_width1, label_height));
|
---|
| 350 | panel2.add(jLabel20, new AbsoluteConstraints(label_x_1, 320, label_width, label_height));
|
---|
| 351 | panel2.add(jLabel21, new AbsoluteConstraints(label_x_2, 320, label_width1, label_height));
|
---|
| 352 | panel2.add(jLabel22, new AbsoluteConstraints(label_x_1, 350, label_width, label_height));
|
---|
| 353 | panel2.add(jComboBox2, new AbsoluteConstraints(label_x_2, 350, label_width1, label_height));
|
---|
| 354 |
|
---|
| 355 | ////////////////////////////////////////////// first & last five
|
---|
| 356 |
|
---|
| 357 | panel2.add(jLabel23, new AbsoluteConstraints(label_x_1, 390, label_width, 30));
|
---|
| 358 | panel2.add(jTextPane1, new AbsoluteConstraints(label_x_2, 390, 200, 125));
|
---|
| 359 |
|
---|
| 360 | panel2.add(jLabel25, new AbsoluteConstraints(label_x_1, 525, label_width, 30));
|
---|
| 361 | panel2.add(jTextPane2, new AbsoluteConstraints(label_x_2, 525, 200, 125));
|
---|
| 362 |
|
---|
| 363 | panel2.add(jButton2, new AbsoluteConstraints(label_x_1, 660, 185, 30));
|
---|
| 364 | panel2.add(jButton3, new AbsoluteConstraints(label_x_2, 660, 185, 30));
|
---|
| 365 |
|
---|
| 366 | //////----------------------------THIRD panel
|
---|
| 367 |
|
---|
| 368 | jComboBox3.addItemListener(new SummaryPanel_jComboBox3_itemAdapter(this));
|
---|
| 369 | jLabel32.setText("Metadata Set: ");
|
---|
| 370 | jLabel32.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 371 |
|
---|
| 372 | jLabel33.setText("Indexes");
|
---|
| 373 | jLabel33.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 374 |
|
---|
| 375 | jLabel34.setText("Completeness");
|
---|
| 376 | jLabel34.setFont(new java.awt.Font("Sans-serif", Font.BOLD, label_font_size));
|
---|
| 377 |
|
---|
| 378 | jButton7.setText("Statistics");
|
---|
| 379 | jButton7.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 380 | ActionListener doIt7 = new ActionListener() {
|
---|
| 381 | public void actionPerformed(ActionEvent ae) {
|
---|
| 382 | jButton7_actionPerformed(ae);
|
---|
| 383 | }
|
---|
| 384 | };
|
---|
| 385 |
|
---|
| 386 | ActionListener cursorDoIt7 = CursorController.createListener(this, doIt7);
|
---|
| 387 | jButton7.addActionListener(cursorDoIt7);
|
---|
| 388 |
|
---|
| 389 | jButton6.setText("Indexes");
|
---|
| 390 | jButton6.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 391 | ActionListener doIt6 = new ActionListener() {
|
---|
| 392 | public void actionPerformed(ActionEvent ae) {
|
---|
| 393 | jButton6_actionPerformed(ae);
|
---|
| 394 | }
|
---|
| 395 | };
|
---|
| 396 |
|
---|
| 397 | ActionListener cursorDoIt6 = CursorController.createListener(this, doIt6);
|
---|
| 398 | jButton6.addActionListener(cursorDoIt6);
|
---|
| 399 |
|
---|
| 400 | jComboBox3.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 401 |
|
---|
| 402 | jList2 = new JList();
|
---|
| 403 | jList2.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 16));
|
---|
| 404 |
|
---|
| 405 | jLabel43.setText("Hide Empty Metadata Element");
|
---|
| 406 | jLabel43.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 407 |
|
---|
| 408 | jLabel44.setText("Hide Completed Metadata Element ");
|
---|
| 409 | jLabel44.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 410 |
|
---|
| 411 | jLabel45.setText("Hide Document with empty metadata element set");
|
---|
| 412 | jLabel45.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 413 |
|
---|
| 414 | jLabel46.setText("Hide Document with completed metadata element set");
|
---|
| 415 | jLabel46.setFont(new java.awt.Font("Sans-serif", Font.BOLD, 12));
|
---|
| 416 |
|
---|
| 417 | jButton10.setText("Customise");
|
---|
| 418 | jButton10.setPreferredSize(new Dimension(150,20));
|
---|
| 419 | jButton10.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
|
---|
| 420 |
|
---|
| 421 | ActionListener doIt10 = new ActionListener() {
|
---|
| 422 | public void actionPerformed(ActionEvent ae) {
|
---|
| 423 | jButton10_actionPerformed(ae);
|
---|
| 424 | }
|
---|
| 425 | };
|
---|
| 426 |
|
---|
| 427 | ActionListener cursorDoIt10 = CursorController.createListener(this, doIt10);
|
---|
| 428 | jButton10.addActionListener(cursorDoIt10);
|
---|
| 429 |
|
---|
| 430 | JComponent panel3 = new JPanel();
|
---|
| 431 | panel3.setLayout(new AbsoluteLayout());
|
---|
| 432 | panel3.add(jLabel32, new AbsoluteConstraints(label_x_1, 20, label_width1, label_height));
|
---|
| 433 | panel3.add(jComboBox3, new AbsoluteConstraints(label_x_2, 20, label_width1, label_height));
|
---|
| 434 | panel3.add(jLabel33, new AbsoluteConstraints(label_x_1, 80, label_width, label_height));
|
---|
| 435 | panel3.add(jLabel34, new AbsoluteConstraints(250, 80, label_width1, label_height));
|
---|
| 436 | panel3.add(new JScrollPane(jList2), new AbsoluteConstraints(label_x_1, 120, 480, 280));
|
---|
| 437 |
|
---|
| 438 | panel3.add(jButton6,new AbsoluteConstraints(50,650,100,30));
|
---|
| 439 | panel3.add(jButton10,new AbsoluteConstraints(270,650,100,30));
|
---|
| 440 |
|
---|
| 441 | JPanel panel5 = new JPanel();
|
---|
| 442 | panel5.setLayout(new AbsoluteLayout());
|
---|
| 443 | panel5.setBorder(BorderFactory.createLineBorder(Color.black));
|
---|
| 444 |
|
---|
| 445 | panel5.add(jLabel43,new AbsoluteConstraints(35,5,400,label_height));
|
---|
| 446 | panel5.add(jLabel44,new AbsoluteConstraints(35,40,400,label_height));
|
---|
| 447 | panel5.add(jLabel45,new AbsoluteConstraints(35,75,400,label_height));
|
---|
| 448 | panel5.add(jLabel46,new AbsoluteConstraints(35,110,400,label_height));
|
---|
| 449 |
|
---|
| 450 | panel5.add(jCheckBox5,new AbsoluteConstraints(10,7,20,20));
|
---|
| 451 | panel5.add(jCheckBox6,new AbsoluteConstraints(10,42,20,20));
|
---|
| 452 | panel5.add(jCheckBox7,new AbsoluteConstraints(10,77,20,20));
|
---|
| 453 | panel5.add(jCheckBox8,new AbsoluteConstraints(10,112,20,20));
|
---|
| 454 |
|
---|
| 455 | panel3.add(panel5, new AbsoluteConstraints(label_x_1, 410, 480, 150));
|
---|
| 456 |
|
---|
| 457 | //Add the tabbed pane to this panel.
|
---|
| 458 | add(tabbedPane);
|
---|
| 459 |
|
---|
| 460 | tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
---|
| 461 |
|
---|
| 462 | //Add the tabbed pane to this panel.
|
---|
| 463 | add(tabbedPane);
|
---|
| 464 |
|
---|
| 465 | //The following line enables to use scrolling tabs.
|
---|
| 466 | tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
---|
| 467 | tabbedPane.addTab("Overall Statistics", panel1);
|
---|
| 468 | tabbedPane.addTab("Element Information", panel2);
|
---|
| 469 | tabbedPane.addTab("Metadata Set", panel3);
|
---|
| 470 |
|
---|
| 471 | tabbedPane.setPreferredSize(new Dimension(550, 740));
|
---|
| 472 | this.setPreferredSize(new Dimension(570, 740));
|
---|
| 473 | //Add the tabbed pane to this panel.
|
---|
| 474 | tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
---|
| 475 |
|
---|
| 476 | overallPageUpdate();
|
---|
| 477 | updateSingleMetadataSetPage();
|
---|
| 478 | }
|
---|
| 479 |
|
---|
| 480 |
|
---|
| 481 | protected JComponent makeTextPanel(String text) {
|
---|
| 482 | JPanel panel = new JPanel(false);
|
---|
| 483 | JLabel filler = new JLabel(text);
|
---|
| 484 | filler.setHorizontalAlignment(JLabel.CENTER);
|
---|
| 485 | panel.setLayout(new GridLayout(1, 1));
|
---|
| 486 | panel.add(filler);
|
---|
| 487 | return panel;
|
---|
| 488 | }
|
---|
| 489 |
|
---|
| 490 | // Variable declaration
|
---|
| 491 | JTabbedPane tabbedPane = new JTabbedPane();
|
---|
| 492 | JTable jTable1 = new JTable();
|
---|
| 493 |
|
---|
| 494 | String[] columnNames = {"Element","Total times element used","No. of record \ncontaining element", "Mean","Median","Unique Value","Min","Max","Avg","Mode","Mode frequency"};
|
---|
| 495 | String[] sortOptions = {"ASCII","Frequency-based"};
|
---|
| 496 |
|
---|
| 497 | JLabel jLabel1 = new JLabel();
|
---|
| 498 | JLabel jLabel2 = new JLabel();
|
---|
| 499 | JLabel jLabel3 = new JLabel();
|
---|
| 500 | JLabel jLabel4 = new JLabel();
|
---|
| 501 | JLabel jLabel5 = new JLabel();
|
---|
| 502 | JLabel jLabel6 = new JLabel();
|
---|
| 503 | JLabel jLabel7 = new JLabel();
|
---|
| 504 | JLabel jLabel8 = new JLabel();
|
---|
| 505 | JLabel jLabel9 = new JLabel();
|
---|
| 506 | JLabel jLabel10 = new JLabel();
|
---|
| 507 | JLabel jLabel11 = new JLabel();
|
---|
| 508 | JLabel jLabel12 = new JLabel();
|
---|
| 509 | JLabel jLabel13 = new JLabel();
|
---|
| 510 | JLabel jLabel14 = new JLabel();
|
---|
| 511 | JLabel jLabel15 = new JLabel();
|
---|
| 512 | JLabel jLabel16 = new JLabel();
|
---|
| 513 | JLabel jLabel17 = new JLabel();
|
---|
| 514 | JLabel jLabel18 = new JLabel();
|
---|
| 515 | JLabel jLabel19 = new JLabel();
|
---|
| 516 | JLabel jLabel20 = new JLabel();
|
---|
| 517 | JLabel jLabel21 = new JLabel();
|
---|
| 518 | JLabel jLabel22 = new JLabel();
|
---|
| 519 | JLabel jLabel23 = new JLabel();
|
---|
| 520 | JLabel jLabel24 = new JLabel();
|
---|
| 521 | JLabel jLabel25 = new JLabel();
|
---|
| 522 | JLabel jLabel26 = new JLabel();
|
---|
| 523 |
|
---|
| 524 | /////////////////////////// -- more
|
---|
| 525 | JLabel jLabel27 = new JLabel();//left panel1
|
---|
| 526 | JLabel jLabel28 = new JLabel();
|
---|
| 527 | JLabel jLabel29 = new JLabel();
|
---|
| 528 | JLabel jLabel30 = new JLabel();
|
---|
| 529 | JLabel jLabel31 = new JLabel();
|
---|
| 530 |
|
---|
| 531 | JLabel jLabel35 = new JLabel(); //right
|
---|
| 532 | JLabel jLabel36 = new JLabel();
|
---|
| 533 | JLabel jLabel37 = new JLabel();
|
---|
| 534 | JLabel jLabel38 = new JLabel();
|
---|
| 535 | JButton jButton8 = new JButton();
|
---|
| 536 | JButton jButton9 = new JButton();
|
---|
| 537 |
|
---|
| 538 | JCheckBox jCheckBox1 = new JCheckBox();
|
---|
| 539 | JCheckBox jCheckBox2 = new JCheckBox();
|
---|
| 540 | JCheckBox jCheckBox3 = new JCheckBox();
|
---|
| 541 | JCheckBox jCheckBox4 = new JCheckBox();
|
---|
| 542 |
|
---|
| 543 | JLabel jLabel39 = new JLabel();
|
---|
| 544 | JLabel jLabel40 = new JLabel();
|
---|
| 545 | JLabel jLabel41 = new JLabel();
|
---|
| 546 | JLabel jLabel42 = new JLabel();
|
---|
| 547 | JButton jButton11 = new JButton();
|
---|
| 548 |
|
---|
| 549 | JLabel jLabel32 = new JLabel();//panel3
|
---|
| 550 | JLabel jLabel33 = new JLabel();
|
---|
| 551 | JLabel jLabel34 = new JLabel();
|
---|
| 552 | JButton jButton6 = new JButton();
|
---|
| 553 | JButton jButton7 = new JButton();
|
---|
| 554 |
|
---|
| 555 | JCheckBox jCheckBox5 = new JCheckBox();
|
---|
| 556 | JCheckBox jCheckBox6 = new JCheckBox();
|
---|
| 557 | JCheckBox jCheckBox7 = new JCheckBox();
|
---|
| 558 | JCheckBox jCheckBox8 = new JCheckBox();
|
---|
| 559 |
|
---|
| 560 | JLabel jLabel43 = new JLabel();
|
---|
| 561 | JLabel jLabel44 = new JLabel();
|
---|
| 562 | JLabel jLabel45 = new JLabel();
|
---|
| 563 | JLabel jLabel46 = new JLabel();
|
---|
| 564 | JButton jButton10 = new JButton();
|
---|
| 565 |
|
---|
| 566 | ///////////////////////////////--more ends
|
---|
| 567 | JButton jButton1 = new JButton();
|
---|
| 568 | JButton jButton2 = new JButton();
|
---|
| 569 | JButton jButton3 = new JButton();
|
---|
| 570 | JButton jButton4 = new JButton();
|
---|
| 571 | JButton jButton5 = new JButton();
|
---|
| 572 | JTextPane jTextPane1 = new JTextPane();
|
---|
| 573 | JTextPane jTextPane2 = new JTextPane();
|
---|
| 574 |
|
---|
| 575 | JTextArea jTextArea1 = new JTextArea();
|
---|
| 576 | JTextArea jTextArea2 = new JTextArea();
|
---|
| 577 | Color cl =Color.black;
|
---|
| 578 | String[] elements;
|
---|
| 579 | String[] MDS_list;
|
---|
| 580 |
|
---|
| 581 | JComboBox jComboBox1;
|
---|
| 582 | JComboBox jComboBox2;
|
---|
| 583 | JComboBox jComboBox3;
|
---|
| 584 |
|
---|
| 585 | JList jList1;
|
---|
| 586 | JList jList2;
|
---|
| 587 |
|
---|
| 588 | public void jComboBox1_itemStateChanged(ItemEvent e) {
|
---|
| 589 | jLabel21.setText(data_Maker.getTotalDocNumber()+"");
|
---|
| 590 | update(jComboBox1.getSelectedItem().toString(),jComboBox2.getSelectedItem().toString());
|
---|
| 591 | FirstAndLastFive(jComboBox1.getSelectedItem().toString(),jComboBox2.getSelectedItem().toString());
|
---|
| 592 | }
|
---|
| 593 |
|
---|
| 594 | public void jComboBox2_itemStateChanged(ItemEvent e) {
|
---|
| 595 | FirstAndLastFive(jComboBox1.getSelectedItem().toString(),jComboBox2.getSelectedItem().toString());
|
---|
| 596 | }
|
---|
| 597 |
|
---|
| 598 | public void jComboBox3_itemStateChanged(ItemEvent e) {
|
---|
| 599 | updateSingleMetadataSetPage();
|
---|
| 600 | }
|
---|
| 601 |
|
---|
| 602 | private void updateSingleMetadataSetPage(){
|
---|
| 603 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 604 | dm.setTotalDocNumber();
|
---|
| 605 |
|
---|
| 606 | String mdsIndexesName = jComboBox3.getSelectedItem().toString();
|
---|
| 607 | HashMap hp = ms_stats.getMetadataSetMap();
|
---|
| 608 | MetadataSet msx = (MetadataSet)hp.get(mdsIndexesName);
|
---|
| 609 | ArrayList nameList = msx.getIndexsList();
|
---|
| 610 | String[][] MetadataData = new String[nameList.size()][2];
|
---|
| 611 |
|
---|
| 612 | for(int i = 0; i<nameList.size(); i++){
|
---|
| 613 | MetadataData[i][0] = (String)nameList.get(i);
|
---|
| 614 | MetadataData[i][1] = new String(dm.Mean((String)nameList.get(i))+" %");
|
---|
| 615 |
|
---|
| 616 | if(MetadataData[i][1].indexOf(".")==2){
|
---|
| 617 | MetadataData[i][1] = " "+MetadataData[i][1];
|
---|
| 618 | }
|
---|
| 619 | else if(MetadataData[i][1].indexOf(".")==1){
|
---|
| 620 | MetadataData[i][1] = " "+MetadataData[i][1];
|
---|
| 621 | }
|
---|
| 622 | }
|
---|
| 623 |
|
---|
| 624 | jList2.setListData(MetadataData);
|
---|
| 625 | jList2.setCellRenderer(new MyCellRenderer());
|
---|
| 626 | jListDataModel.put("jList2",MetadataData);
|
---|
| 627 |
|
---|
| 628 | }
|
---|
| 629 |
|
---|
| 630 | private void FirstAndLastFive(String element_name, String sort){
|
---|
| 631 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 632 | dm.setTotalDocNumber();
|
---|
| 633 |
|
---|
| 634 | String[] temp = dm.getSortList(element_name,sort);
|
---|
| 635 | String[] temp2 = {" "," "," "," "," "};
|
---|
| 636 | int length = 0;
|
---|
| 637 | if(temp.length>=5){length=5;}
|
---|
| 638 | else if(temp.length<5){length = temp.length;}
|
---|
| 639 |
|
---|
| 640 | for(int i =0; i<length; i++){
|
---|
| 641 | temp2[i] = temp[i];
|
---|
| 642 | }
|
---|
| 643 |
|
---|
| 644 | jTextPane1.setText("");
|
---|
| 645 | jTextPane1.setText("1. "+temp2[0]+"\n2. "+temp2[1]+"\n3. "+temp2[2]+"\n4. "+temp2[3]+"\n5. "+temp2[4]);
|
---|
| 646 |
|
---|
| 647 | // Last five value
|
---|
| 648 | String[] temp3 = {" "," "," "," "," "};
|
---|
| 649 | length = 0;
|
---|
| 650 | int start = temp.length;
|
---|
| 651 |
|
---|
| 652 | if(temp.length>=5){
|
---|
| 653 | length= 5;
|
---|
| 654 | }
|
---|
| 655 | else if(temp.length<5){
|
---|
| 656 | length = temp.length;
|
---|
| 657 | }
|
---|
| 658 |
|
---|
| 659 | for(int i = 0; i<length; i++){
|
---|
| 660 | temp3[i] = temp[start-1];
|
---|
| 661 | start--;
|
---|
| 662 | }
|
---|
| 663 |
|
---|
| 664 | jTextPane2.setText("");
|
---|
| 665 | jTextPane2.setText("1. "+temp3[0]+"\n2. "+temp3[1]+"\n3. "+temp3[2]+"\n4. "+temp3[3]+"\n5. "+temp3[4]);
|
---|
| 666 |
|
---|
| 667 | }
|
---|
| 668 |
|
---|
| 669 | private void overallPageUpdate(){
|
---|
| 670 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 671 |
|
---|
| 672 | jTextArea2.setText("");
|
---|
| 673 | ArrayList wholeList = new ArrayList();
|
---|
| 674 | HashMap hp = ms_stats.getMetadataSetMap();
|
---|
| 675 | Collection c = hp.values();
|
---|
| 676 | Iterator i = c.iterator();
|
---|
| 677 | int counter = 0;
|
---|
| 678 | String[][] MetadataData = new String[c.size()][2];
|
---|
| 679 |
|
---|
| 680 | while(i.hasNext()){
|
---|
| 681 | MetadataSet mds = (MetadataSet)i.next();
|
---|
| 682 | wholeList.add(mds);
|
---|
| 683 | ArrayList newMDS = new ArrayList();
|
---|
| 684 | newMDS.add(mds);
|
---|
| 685 | MetadataData[counter][0] = mds.getName();
|
---|
| 686 | MetadataData[counter][1] = dm.getSingleMetadataSetCompleteness(newMDS)+" %";
|
---|
| 687 | counter++;
|
---|
| 688 | }
|
---|
| 689 |
|
---|
| 690 | jLabel35.setText(dm.getTotalDocNumber()+"");
|
---|
| 691 | jLabel36.setText(ms_stats.getMetadataSetMap().size()+"");
|
---|
| 692 | jLabel37.setText(dm.getSingleMetadataSetCompleteness(wholeList)+" %");
|
---|
| 693 |
|
---|
| 694 | jList1.setListData(MetadataData);
|
---|
| 695 | jList1.setCellRenderer(new MyCellRenderer());
|
---|
| 696 | jListDataModel.put("jList1",MetadataData);
|
---|
| 697 | }
|
---|
| 698 |
|
---|
| 699 | static class MyCellRenderer extends JPanel implements ListCellRenderer{
|
---|
| 700 | JLabel left, middle, right;
|
---|
| 701 | MyCellRenderer() {
|
---|
| 702 | setLayout(new GridLayout(1, 2));
|
---|
| 703 | left = new JLabel();
|
---|
| 704 |
|
---|
| 705 | right = new JLabel();
|
---|
| 706 | left.setOpaque(true);
|
---|
| 707 |
|
---|
| 708 | right.setOpaque(true);
|
---|
| 709 | add(left);
|
---|
| 710 | add(right);
|
---|
| 711 | }
|
---|
| 712 |
|
---|
| 713 | public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
|
---|
| 714 | String leftData = ((String[])value)[0];
|
---|
| 715 | String rightData = ((String[])value)[1];
|
---|
| 716 | left.setText(leftData);
|
---|
| 717 | right.setText(rightData);
|
---|
| 718 |
|
---|
| 719 | if(isSelected){
|
---|
| 720 | left.setBackground(list.getSelectionBackground());
|
---|
| 721 | left.setForeground(list.getSelectionForeground());
|
---|
| 722 | right.setBackground(list.getSelectionBackground());
|
---|
| 723 | right.setForeground(list.getSelectionForeground());
|
---|
| 724 | }
|
---|
| 725 |
|
---|
| 726 | else{
|
---|
| 727 | left.setBackground(list.getBackground());
|
---|
| 728 | left.setForeground(list.getForeground());
|
---|
| 729 | right.setBackground(list.getBackground());
|
---|
| 730 | right.setForeground(list.getForeground());
|
---|
| 731 | }
|
---|
| 732 |
|
---|
| 733 | setEnabled(list.isEnabled());
|
---|
| 734 | setFont(list.getFont());
|
---|
| 735 | return this;
|
---|
| 736 | }
|
---|
| 737 | }
|
---|
| 738 |
|
---|
| 739 | private void update(String element_name, String sort){
|
---|
| 740 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 741 | dm.setTotalDocNumber();
|
---|
| 742 |
|
---|
| 743 | jLabel3.setText(dm.getDistinctNumber(element_name)+"");
|
---|
| 744 | jLabel5.setText(dm.getFrequency(element_name)+"");
|
---|
| 745 | jLabel7.setText(dm.getDocumentUsedElement(element_name)+"");
|
---|
| 746 | jLabel9.setText(dm.Mean(element_name)+"");
|
---|
| 747 | jLabel11.setText(dm.Median(element_name)+"");
|
---|
| 748 | jLabel13.setText(dm.getMinRange(element_name)+"");
|
---|
| 749 | jLabel15.setText(dm.getMaxRange(element_name)+"");
|
---|
| 750 | jLabel17.setText(dm.Average(element_name)+"");
|
---|
| 751 | jLabel19.setText(dm.getMode(element_name)+"");
|
---|
| 752 | jLabel21.setText(dm.ModeFrequency(element_name)+"");
|
---|
| 753 | }
|
---|
| 754 |
|
---|
| 755 | public void jButton1_actionPerformed(ActionEvent actionevent) {
|
---|
| 756 |
|
---|
| 757 | ArrayList alist = new ArrayList();
|
---|
| 758 |
|
---|
| 759 | for(int a = 0; a<elements.length; a++){
|
---|
| 760 | alist.add(data_Maker.getMetadataRows(elements[a]));
|
---|
| 761 | }
|
---|
| 762 |
|
---|
| 763 | String[] ids = data_Maker.getDocumentIDs("archivedir");
|
---|
| 764 | new DrawSymbolAxis("Total Document: "+totalDocument +" Total Element:"+totalMetadataElement + " Total Metadata Item:"+totalMetadataItem,elements,ids,alist);
|
---|
| 765 | }
|
---|
| 766 |
|
---|
| 767 |
|
---|
| 768 | public void jButton2_actionPerformed(ActionEvent actionevent) {
|
---|
| 769 |
|
---|
| 770 | String item = jComboBox1.getSelectedItem().toString();
|
---|
| 771 | new DrawXYChart("",item,data_Maker.getDistinctValueMap(item),1);
|
---|
| 772 | }
|
---|
| 773 |
|
---|
| 774 | public void jButton3_actionPerformed(ActionEvent actionevent) {
|
---|
| 775 | String item = jComboBox1.getSelectedItem().toString();
|
---|
| 776 | new DrawXYChart("",item,data_Maker.getDocFrequencyMap(item),2);
|
---|
| 777 | }
|
---|
| 778 |
|
---|
| 779 | public void jButton6_actionPerformed(ActionEvent actionevent) {
|
---|
| 780 |
|
---|
| 781 | String mdsName = jComboBox3.getSelectedItem().toString();
|
---|
| 782 | HashMap hp = ms_stats.getMetadataSetMap();
|
---|
| 783 | MetadataSet msx = (MetadataSet)hp.get(mdsName);
|
---|
| 784 | ArrayList al = msx.getIndexsList();
|
---|
| 785 | String[] tempx = new String[al.size()];
|
---|
| 786 |
|
---|
| 787 | for(int a = 0; a<al.size(); a++){
|
---|
| 788 | tempx[a] = (String)al.get(a);
|
---|
| 789 | }
|
---|
| 790 |
|
---|
| 791 | ArrayList alist = new ArrayList();
|
---|
| 792 |
|
---|
| 793 | for(int a = 0; a<tempx.length; a++){
|
---|
| 794 | alist.add(data_Maker.getMetadataRows(tempx[a]));
|
---|
| 795 | }
|
---|
| 796 |
|
---|
| 797 | String[] ids = data_Maker.getDocumentIDs("archivedir");
|
---|
| 798 | int totalDoc = ids.length;
|
---|
| 799 | int totalElement = tempx.length;
|
---|
| 800 | int totalItem = totalDoc * totalElement;
|
---|
| 801 | new DrawSymbolAxis("Total Document: "+ totalDoc +" Total Element:"+totalElement + " Total Metadata Item:"+totalItem,tempx,ids,alist);
|
---|
| 802 | }
|
---|
| 803 |
|
---|
| 804 | public void jButton7_actionPerformed(ActionEvent actionevent) {
|
---|
| 805 |
|
---|
| 806 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 807 | String mdsName = jComboBox3.getSelectedItem().toString();
|
---|
| 808 | HashMap hp = ms_stats.getMetadataSetMap();
|
---|
| 809 | MetadataSet mds = (MetadataSet)hp.get(mdsName);
|
---|
| 810 | ArrayList alist = mds.getIndexsList();
|
---|
| 811 | Object[][] dataset = dm.getMetadataInfo(mds);
|
---|
| 812 | new MetadataTable(columnNames,dataset);
|
---|
| 813 | }
|
---|
| 814 |
|
---|
| 815 | public void jButton8_actionPerformed(ActionEvent actionevent) {
|
---|
| 816 |
|
---|
| 817 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 818 | Object[][] dataset = dm.AllInformation();
|
---|
| 819 | new MetadataTable(columnNames,dataset);
|
---|
| 820 | }
|
---|
| 821 |
|
---|
| 822 | public void jButton9_actionPerformed(ActionEvent actionevent) {
|
---|
| 823 |
|
---|
| 824 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 825 | String[] metaDataElementName = (String[])elements.clone();
|
---|
| 826 | String[] ids = data_Maker.getDocumentIDs("archivedir");
|
---|
| 827 | ArrayList alist = new ArrayList();
|
---|
| 828 |
|
---|
| 829 | for(int a = 0; a<elements.length; a++){
|
---|
| 830 | alist.add(data_Maker.getMetadataRows(elements[a]));
|
---|
| 831 | }
|
---|
| 832 |
|
---|
| 833 | int totalDocx = ids.length;
|
---|
| 834 | int totalElementx = elements.length;
|
---|
| 835 | int totalItemx = totalDocx * totalElementx;
|
---|
| 836 |
|
---|
| 837 | if(jCheckBox1.isSelected() == false && jCheckBox2.isSelected() == false && jCheckBox3.isSelected() == false && jCheckBox4.isSelected() == false){
|
---|
| 838 | new DrawSymbolAxis("Total Document: "+ totalDocx +" Total Element:"+totalElementx + " Total Metadata Item:"+totalItemx,elements,ids,alist);
|
---|
| 839 | }
|
---|
| 840 |
|
---|
| 841 | else{
|
---|
| 842 | ArrayList nameList = new ArrayList();
|
---|
| 843 |
|
---|
| 844 | if(jCheckBox1.isSelected() == true){
|
---|
| 845 | alist = new ArrayList();
|
---|
| 846 | nameList = new ArrayList();
|
---|
| 847 |
|
---|
| 848 | for(int i = 0; i< metaDataElementName.length; i++){
|
---|
| 849 | if(!dm.IsElementEmpty(metaDataElementName[i])){
|
---|
| 850 | alist.add(data_Maker.getMetadataRows(metaDataElementName[i]));
|
---|
| 851 | nameList.add(metaDataElementName[i]);
|
---|
| 852 | }
|
---|
| 853 | }
|
---|
| 854 |
|
---|
| 855 | metaDataElementName = new String[nameList.size()];
|
---|
| 856 | for(int i = 0; i< nameList.size(); i++){
|
---|
| 857 | metaDataElementName[i] = nameList.get(i).toString();
|
---|
| 858 | }
|
---|
| 859 | }
|
---|
| 860 |
|
---|
| 861 | if(jCheckBox2.isSelected() == true){
|
---|
| 862 | alist = new ArrayList();
|
---|
| 863 | nameList = new ArrayList();
|
---|
| 864 |
|
---|
| 865 | for(int i = 0; i< metaDataElementName.length; i++){
|
---|
| 866 | if(!dm.IsElementFull(metaDataElementName[i])){
|
---|
| 867 | alist.add(data_Maker.getMetadataRows(metaDataElementName[i]));
|
---|
| 868 | nameList.add(metaDataElementName[i]);
|
---|
| 869 | }
|
---|
| 870 | }
|
---|
| 871 | metaDataElementName = new String[nameList.size()];
|
---|
| 872 | for(int i = 0; i< nameList.size(); i++){
|
---|
| 873 | metaDataElementName[i] = nameList.get(i).toString();
|
---|
| 874 | }
|
---|
| 875 | }
|
---|
| 876 |
|
---|
| 877 | if(jCheckBox3.isSelected() == true){
|
---|
| 878 | alist = data_Maker.removeDocument(alist, ids, 0);
|
---|
| 879 | ArrayList idList = data_Maker.getRemovedID();
|
---|
| 880 | ArrayList newIDList = new ArrayList();
|
---|
| 881 |
|
---|
| 882 | for(int i = 0; i< ids.length; i++){
|
---|
| 883 | if(!idList.contains(ids[i])){
|
---|
| 884 | newIDList.add(ids[i]);
|
---|
| 885 | }
|
---|
| 886 | }
|
---|
| 887 | ids = new String[newIDList.size()];
|
---|
| 888 |
|
---|
| 889 | for(int i = 0; i<newIDList.size(); i++){
|
---|
| 890 | ids[i] = newIDList.get(i).toString();
|
---|
| 891 | }
|
---|
| 892 | }
|
---|
| 893 |
|
---|
| 894 | if(jCheckBox4.isSelected() == true){
|
---|
| 895 | alist = data_Maker.removeDocument(alist, ids ,1);
|
---|
| 896 | ArrayList idList = data_Maker.getRemovedID();
|
---|
| 897 | ArrayList newIDList = new ArrayList();
|
---|
| 898 |
|
---|
| 899 | for(int i = 0; i< ids.length; i++){
|
---|
| 900 | if(!idList.contains(ids[i])){
|
---|
| 901 | newIDList.add(ids[i]);
|
---|
| 902 | }
|
---|
| 903 | }
|
---|
| 904 |
|
---|
| 905 | ids = new String[newIDList.size()];
|
---|
| 906 | for(int i = 0; i<newIDList.size(); i++){
|
---|
| 907 | ids[i] = newIDList.get(i).toString();
|
---|
| 908 | }
|
---|
| 909 | }
|
---|
| 910 |
|
---|
| 911 |
|
---|
| 912 | totalDocx = ids.length;
|
---|
| 913 | totalElementx = metaDataElementName.length;
|
---|
| 914 | totalItemx = totalDocx * totalElementx;
|
---|
| 915 | new DrawSymbolAxis("Total Document: "+ totalDocx +" Total Element:"+totalElementx + " Total Metadata Item:"+totalItemx,metaDataElementName,ids,alist);
|
---|
| 916 | }
|
---|
| 917 | }
|
---|
| 918 |
|
---|
| 919 |
|
---|
| 920 | public void jButton10_actionPerformed(ActionEvent actionevent) {
|
---|
| 921 |
|
---|
| 922 | DataMaker dm = new DataMaker(ms_stats);
|
---|
| 923 | String elemenetName = jComboBox3.getSelectedItem().toString();
|
---|
| 924 |
|
---|
| 925 | System.out.println(elemenetName);
|
---|
| 926 |
|
---|
| 927 | HashMap elementMap = ms_stats.getMetadataSetMap();
|
---|
| 928 | MetadataSet elementSet = (MetadataSet)elementMap.get(elemenetName);
|
---|
| 929 |
|
---|
| 930 | ArrayList alist2 = elementSet.getIndexsList();
|
---|
| 931 | String[] metaDataElementName = new String[alist2.size()];
|
---|
| 932 |
|
---|
| 933 | for(int i = 0; i< alist2.size(); i++){
|
---|
| 934 | metaDataElementName[i] = alist2.get(i).toString();
|
---|
| 935 |
|
---|
| 936 | }
|
---|
| 937 |
|
---|
| 938 | String[] ids = data_Maker.getDocumentIDs("archivedir");
|
---|
| 939 | ArrayList alist = new ArrayList();
|
---|
| 940 |
|
---|
| 941 | for(int a = 0; a<metaDataElementName.length; a++){
|
---|
| 942 | alist.add(data_Maker.getMetadataRows(metaDataElementName[a]));
|
---|
| 943 |
|
---|
| 944 | }
|
---|
| 945 |
|
---|
| 946 | if(jList2.getSelectedIndices().length>0){
|
---|
| 947 | alist.clear();
|
---|
| 948 | int[] location = jList2.getSelectedIndices();
|
---|
| 949 | String[][] list = (String[][])jListDataModel.get("jList2");
|
---|
| 950 | metaDataElementName = new String[location.length];
|
---|
| 951 |
|
---|
| 952 | for(int i = 0; i< location.length; i++){
|
---|
| 953 | int x = location[i];
|
---|
| 954 | metaDataElementName[i] = list[x][0];
|
---|
| 955 | alist.add(data_Maker.getMetadataRows(metaDataElementName[i]));
|
---|
| 956 |
|
---|
| 957 | }
|
---|
| 958 | ids = data_Maker.getDocumentIDs("archivedir");
|
---|
| 959 | }
|
---|
| 960 |
|
---|
| 961 | int totalDocx = ids.length;
|
---|
| 962 | int totalElementx = metaDataElementName.length;
|
---|
| 963 | int totalItemx = totalDocx * totalElementx;
|
---|
| 964 |
|
---|
| 965 | if(jCheckBox5.isSelected() == false && jCheckBox6.isSelected() == false && jCheckBox7.isSelected() == false && jCheckBox8.isSelected() == false){
|
---|
| 966 | new DrawSymbolAxis("Total Document: "+ totalDocx +" Total Element:"+totalElementx + " Total Metadata Item:"+totalItemx,metaDataElementName,ids,alist);
|
---|
| 967 | }
|
---|
| 968 |
|
---|
| 969 | else{
|
---|
| 970 |
|
---|
| 971 | ArrayList nameList = new ArrayList();
|
---|
| 972 |
|
---|
| 973 | if(jCheckBox5.isSelected() == true){
|
---|
| 974 | alist = new ArrayList();
|
---|
| 975 | nameList = new ArrayList();
|
---|
| 976 |
|
---|
| 977 | for(int i = 0; i< metaDataElementName.length; i++){
|
---|
| 978 | if(!dm.IsElementEmpty(metaDataElementName[i])){
|
---|
| 979 | alist.add(data_Maker.getMetadataRows(metaDataElementName[i]));
|
---|
| 980 | nameList.add(metaDataElementName[i]);
|
---|
| 981 | }
|
---|
| 982 | }
|
---|
| 983 |
|
---|
| 984 | metaDataElementName = new String[nameList.size()];
|
---|
| 985 |
|
---|
| 986 | for(int i = 0; i< nameList.size(); i++){
|
---|
| 987 | metaDataElementName[i] = nameList.get(i).toString();
|
---|
| 988 | }
|
---|
| 989 | }
|
---|
| 990 |
|
---|
| 991 | if(jCheckBox6.isSelected() == true){
|
---|
| 992 | alist = new ArrayList();
|
---|
| 993 | nameList = new ArrayList();
|
---|
| 994 |
|
---|
| 995 | for(int i = 0; i< metaDataElementName.length; i++){
|
---|
| 996 | if(!dm.IsElementFull(metaDataElementName[i])){
|
---|
| 997 | alist.add(data_Maker.getMetadataRows(metaDataElementName[i]));
|
---|
| 998 | nameList.add(metaDataElementName[i]);
|
---|
| 999 | }
|
---|
| 1000 | }
|
---|
| 1001 | metaDataElementName = new String[nameList.size()];
|
---|
| 1002 |
|
---|
| 1003 | for(int i = 0; i< nameList.size(); i++){
|
---|
| 1004 | metaDataElementName[i] = nameList.get(i).toString();
|
---|
| 1005 | }
|
---|
| 1006 | }
|
---|
| 1007 |
|
---|
| 1008 | if(jCheckBox7.isSelected() == true){
|
---|
| 1009 | alist = data_Maker.removeDocument(alist, ids , 0);
|
---|
| 1010 | ArrayList idList = data_Maker.getRemovedID();
|
---|
| 1011 | ArrayList newIDList = new ArrayList();
|
---|
| 1012 |
|
---|
| 1013 | for(int i = 0; i< ids.length; i++){
|
---|
| 1014 | if(!idList.contains(ids[i])){
|
---|
| 1015 | newIDList.add(ids[i]);
|
---|
| 1016 | }
|
---|
| 1017 | }
|
---|
| 1018 | ids = new String[newIDList.size()];
|
---|
| 1019 |
|
---|
| 1020 | for(int i = 0; i<newIDList.size(); i++){
|
---|
| 1021 | ids[i] = newIDList.get(i).toString();
|
---|
| 1022 | }
|
---|
| 1023 | }
|
---|
| 1024 |
|
---|
| 1025 | if(jCheckBox8.isSelected() == true){
|
---|
| 1026 | alist = data_Maker.removeDocument(alist, ids , 1);
|
---|
| 1027 | ArrayList idList = data_Maker.getRemovedID();
|
---|
| 1028 | ArrayList newIDList = new ArrayList();
|
---|
| 1029 |
|
---|
| 1030 | for(int i = 0; i< ids.length; i++){
|
---|
| 1031 | if(!idList.contains(ids[i])){
|
---|
| 1032 | newIDList.add(ids[i]);
|
---|
| 1033 | }
|
---|
| 1034 | }
|
---|
| 1035 | ids = new String[newIDList.size()];
|
---|
| 1036 |
|
---|
| 1037 | for(int i = 0; i<newIDList.size(); i++){
|
---|
| 1038 | ids[i] = newIDList.get(i).toString();
|
---|
| 1039 | }
|
---|
| 1040 | }
|
---|
| 1041 |
|
---|
| 1042 | totalDocx = ids.length;
|
---|
| 1043 | totalElementx = metaDataElementName.length;
|
---|
| 1044 | totalItemx = totalDocx * totalElementx;
|
---|
| 1045 |
|
---|
| 1046 | new DrawSymbolAxis("Total Document: "+ totalDocx +" Total Element:"+totalElementx + " Total Metadata Item:"+totalItemx,metaDataElementName,ids,alist);
|
---|
| 1047 | }
|
---|
| 1048 | }
|
---|
| 1049 | }
|
---|
| 1050 |
|
---|
| 1051 |
|
---|
| 1052 | class SummaryPanel_jComboBox1_itemAdapter implements ItemListener {
|
---|
| 1053 | private SummaryPanel adaptee;
|
---|
| 1054 | SummaryPanel_jComboBox1_itemAdapter(SummaryPanel adaptee) {
|
---|
| 1055 | this.adaptee = adaptee;
|
---|
| 1056 | }
|
---|
| 1057 |
|
---|
| 1058 | public void itemStateChanged(ItemEvent e) {
|
---|
| 1059 | adaptee.jComboBox1_itemStateChanged(e);
|
---|
| 1060 | }
|
---|
| 1061 | }
|
---|
| 1062 |
|
---|
| 1063 | class SummaryPanel_jComboBox2_itemAdapter implements ItemListener {
|
---|
| 1064 | private SummaryPanel adaptee;
|
---|
| 1065 | SummaryPanel_jComboBox2_itemAdapter(SummaryPanel adaptee) {
|
---|
| 1066 | this.adaptee = adaptee;
|
---|
| 1067 | }
|
---|
| 1068 |
|
---|
| 1069 | public void itemStateChanged(ItemEvent e) {
|
---|
| 1070 | adaptee.jComboBox2_itemStateChanged(e);
|
---|
| 1071 | }
|
---|
| 1072 | }
|
---|
| 1073 |
|
---|
| 1074 | class SummaryPanel_jComboBox3_itemAdapter implements ItemListener {
|
---|
| 1075 | private SummaryPanel adaptee;
|
---|
| 1076 | SummaryPanel_jComboBox3_itemAdapter(SummaryPanel adaptee) {
|
---|
| 1077 | this.adaptee = adaptee;
|
---|
| 1078 | }
|
---|
| 1079 |
|
---|
| 1080 | public void itemStateChanged(ItemEvent e) {
|
---|
| 1081 | adaptee.jComboBox3_itemStateChanged(e);
|
---|
| 1082 | }
|
---|
| 1083 | }
|
---|
| 1084 |
|
---|
| 1085 | class SummaryPanel_jButton1_Adapter implements ActionListener {
|
---|
| 1086 | private SummaryPanel adaptee;
|
---|
| 1087 | SummaryPanel_jButton1_Adapter(SummaryPanel adaptee) {
|
---|
| 1088 | this.adaptee = adaptee;
|
---|
| 1089 | }
|
---|
| 1090 |
|
---|
| 1091 | public void actionPerformed(ActionEvent e) {
|
---|
| 1092 | adaptee.jButton1_actionPerformed(e);
|
---|
| 1093 | }
|
---|
| 1094 | }
|
---|
| 1095 |
|
---|
| 1096 | class SummaryPanel_jButton2_Adapter implements ActionListener {
|
---|
| 1097 | private SummaryPanel adaptee;
|
---|
| 1098 | SummaryPanel_jButton2_Adapter(SummaryPanel adaptee) {
|
---|
| 1099 | this.adaptee = adaptee;
|
---|
| 1100 | }
|
---|
| 1101 |
|
---|
| 1102 | public void actionPerformed(ActionEvent e) {
|
---|
| 1103 | adaptee.jButton2_actionPerformed(e);
|
---|
| 1104 | }
|
---|
| 1105 | }
|
---|
| 1106 |
|
---|
| 1107 | class SummaryPanel_jButton3_Adapter implements ActionListener {
|
---|
| 1108 | private SummaryPanel adaptee;
|
---|
| 1109 | SummaryPanel_jButton3_Adapter(SummaryPanel adaptee) {
|
---|
| 1110 | this.adaptee = adaptee;
|
---|
| 1111 | }
|
---|
| 1112 |
|
---|
| 1113 | public void actionPerformed(ActionEvent e) {
|
---|
| 1114 | adaptee.jButton3_actionPerformed(e);
|
---|
| 1115 | }
|
---|
| 1116 | }
|
---|
| 1117 |
|
---|
| 1118 | class SummaryPanel_jButton6_Adapter implements ActionListener {
|
---|
| 1119 | private SummaryPanel adaptee;
|
---|
| 1120 | SummaryPanel_jButton6_Adapter(SummaryPanel adaptee) {
|
---|
| 1121 | this.adaptee = adaptee;
|
---|
| 1122 | }
|
---|
| 1123 |
|
---|
| 1124 | public void actionPerformed(ActionEvent e) {
|
---|
| 1125 | adaptee.jButton6_actionPerformed(e);
|
---|
| 1126 | }
|
---|
| 1127 | }
|
---|
| 1128 |
|
---|
| 1129 | class SummaryPanel_jButton7_Adapter implements ActionListener {
|
---|
| 1130 | private SummaryPanel adaptee;
|
---|
| 1131 | SummaryPanel_jButton7_Adapter(SummaryPanel adaptee) {
|
---|
| 1132 | this.adaptee = adaptee;
|
---|
| 1133 | }
|
---|
| 1134 |
|
---|
| 1135 | public void actionPerformed(ActionEvent e) {
|
---|
| 1136 | adaptee.jButton7_actionPerformed(e);
|
---|
| 1137 | }
|
---|
| 1138 | }
|
---|
| 1139 |
|
---|
| 1140 | class SummaryPanel_jButton8_Adapter implements ActionListener {
|
---|
| 1141 | private SummaryPanel adaptee;
|
---|
| 1142 | SummaryPanel_jButton8_Adapter(SummaryPanel adaptee) {
|
---|
| 1143 | this.adaptee = adaptee;
|
---|
| 1144 | }
|
---|
| 1145 |
|
---|
| 1146 | public void actionPerformed(ActionEvent e) {
|
---|
| 1147 | adaptee.jButton8_actionPerformed(e);
|
---|
| 1148 | }
|
---|
| 1149 | }
|
---|
| 1150 |
|
---|
| 1151 | class SummaryPanel_jButton9_Adapter implements ActionListener {
|
---|
| 1152 | private SummaryPanel adaptee;
|
---|
| 1153 | SummaryPanel_jButton9_Adapter(SummaryPanel adaptee) {
|
---|
| 1154 | this.adaptee = adaptee;
|
---|
| 1155 | }
|
---|
| 1156 |
|
---|
| 1157 | public void actionPerformed(ActionEvent e) {
|
---|
| 1158 | adaptee.jButton9_actionPerformed(e);
|
---|
| 1159 | }
|
---|
| 1160 | }
|
---|
| 1161 |
|
---|
| 1162 | class SummaryPanel_jButton10_Adapter implements ActionListener {
|
---|
| 1163 | private SummaryPanel adaptee;
|
---|
| 1164 | SummaryPanel_jButton10_Adapter(SummaryPanel adaptee) {
|
---|
| 1165 | this.adaptee = adaptee;
|
---|
| 1166 | }
|
---|
| 1167 |
|
---|
| 1168 | public void actionPerformed(ActionEvent e) {
|
---|
| 1169 | adaptee.jButton10_actionPerformed(e);
|
---|
| 1170 | }
|
---|
| 1171 | }
|
---|
| 1172 |
|
---|
| 1173 | /*
|
---|
| 1174 | class SummaryPanel_jButton11_Adapter implements ActionListener {
|
---|
| 1175 | private SummaryPanel adaptee;
|
---|
| 1176 | SummaryPanel_jButton11_Adapter(SummaryPanel adaptee) {
|
---|
| 1177 | this.adaptee = adaptee;
|
---|
| 1178 | }
|
---|
| 1179 |
|
---|
| 1180 | public void actionPerformed(ActionEvent e) {
|
---|
| 1181 | adaptee.jButton11_actionPerformed(e);
|
---|
| 1182 | }
|
---|
| 1183 | }
|
---|
| 1184 | */ |
---|