AccessLogPanel(PreferencesExt p) { super(p, true); logTable = new AccessLogTable(startDateField, endDateField, p, dnsCache); logTable.addPropertyChangeListener( new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if (e.getPropertyName().equals("UrlDump")) { String path = (String) e.getNewValue(); gotoUrlDump(path); } } }); AbstractAction allAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { resetLogs(); } }; BAMutil.setActionProperties(allAction, "Refresh", "show All Logs", false, 'A', -1); BAMutil.addActionToContainer(topPanel, allAction); AbstractAction dnsAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { showDNS(); } }; BAMutil.setActionProperties(dnsAction, "Dataset", "lookup DNS", false, 'D', -1); BAMutil.addActionToContainer(topPanel, dnsAction); add(logTable, BorderLayout.CENTER); }
public void addActions(JPanel buttPanel) { AbstractAction netcdfAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { String location = ds.getLocation(); if (location == null) location = "test"; int pos = location.lastIndexOf("."); if (pos > 0) location = location.substring(0, pos); String filename = fileChooser.chooseFilenameToSave(location + ".nc"); if (filename == null) return; writeNetCDF(filename); } }; BAMutil.setActionProperties(netcdfAction, "netcdf", "Write netCDF-3 file", false, 'S', -1); BAMutil.addActionToContainer(buttPanel, netcdfAction); AbstractAction ncstreamAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { String location = ds.getLocation(); if (location == null) location = "test"; int pos = location.lastIndexOf("."); if (pos > 0) location = location.substring(0, pos); String filename = fileChooser.chooseFilenameToSave(location + ".ncs"); if (filename == null) return; writeNcstream(filename); } }; BAMutil.setActionProperties(ncstreamAction, "netcdf", "Write ncstream file", false, 'S', -1); BAMutil.addActionToContainer(buttPanel, ncstreamAction); AbstractButton compareButton = BAMutil.makeButtcon("Select", "Compare to another file", false); compareButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { compareDataset(); } }); buttPanel.add(compareButton); AbstractAction attAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { showAtts(); } }; BAMutil.setActionProperties(attAction, "FontDecr", "global attributes", false, 'A', -1); BAMutil.addActionToContainer(buttPanel, attAction); }
OpPanel(PreferencesExt prefs, boolean isAccess) { this.prefs = prefs; this.isAccess = isAccess; ta = new TextHistoryPane(true); infoWindow = new IndependentWindow("Details", BAMutil.getImage("netcdfUI"), new JScrollPane(ta)); Rectangle bounds = (Rectangle) prefs.getBean(FRAME_SIZE, new Rectangle(200, 50, 500, 700)); infoWindow.setBounds(bounds); topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); // which server serverCB = new JComboBox(); serverCB.setModel(manage.getServersCB().getModel()); serverCB.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { String server = (String) serverCB.getSelectedItem(); setServer(server); } }); // serverCB.setModel(manage.getServers().getModel()); topPanel.add(new JLabel("server:")); topPanel.add(serverCB); // the date selectors startDateField = new JTextArea(" "); endDateField = new JTextArea(" "); topPanel.add(new JLabel("Start Date:")); topPanel.add(startDateField); topPanel.add(new JLabel("End Date:")); topPanel.add(endDateField); AbstractAction showAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { showLogs(); } }; BAMutil.setActionProperties(showAction, "Import", "get logs", false, 'G', -1); BAMutil.addActionToContainer(topPanel, showAction); AbstractAction filterAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { Boolean state = (Boolean) getValue(BAMutil.STATE); removeTestReq = state.booleanValue(); } }; BAMutil.setActionProperties(filterAction, "time", "remove test Requests", true, 'F', -1); BAMutil.addActionToContainer(topPanel, filterAction); AbstractAction filter2Action = new AbstractAction() { public void actionPerformed(ActionEvent e) { Boolean state = (Boolean) getValue(BAMutil.STATE); problemsOnly = state.booleanValue(); } }; BAMutil.setActionProperties(filter2Action, "time", "only show problems", true, 'F', -1); BAMutil.addActionToContainer(topPanel, filter2Action); AbstractAction infoAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { Formatter f = new Formatter(); showInfo(f); ta.setText(f.toString()); infoWindow.show(); } }; BAMutil.setActionProperties( infoAction, "Information", "info on selected logs", false, 'I', -1); BAMutil.addActionToContainer(topPanel, infoAction); setLayout(new BorderLayout()); add(topPanel, BorderLayout.NORTH); }