[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/gui ClassesViewer.java,1.2,1.3
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2003-01-28 03:06:38
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv29798
Modified Files:
ClassesViewer.java
Log Message:
added expandTree and collapseTree methods. removed a lot of commented code.
Index: ClassesViewer.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ClassesViewer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ClassesViewer.java 25 Jan 2003 23:24:31 -0000 1.2
--- ClassesViewer.java 28 Jan 2003 03:06:33 -0000 1.3
***************
*** 30,40 ****
import java.awt.Container;
import java.awt.Cursor;
- import java.awt.Font;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
- import java.util.HashMap;
import java.util.List;
- import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
--- 30,37 ----
***************
*** 43,51 ****
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
- import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
- import javax.swing.JOptionPane;
- import javax.swing.event.ListSelectionEvent;
- import javax.swing.event.ListSelectionListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
--- 40,44 ----
***************
*** 57,67 ****
*/
public class ClassesViewer extends JPanel
! implements/* ListSelectionListener,*/ TreeSelectionListener {
- // private JarInspector jarInspector = null;
private ClassDetailsPanel classDetailPanel;
- // private JarSpyClassList classList;
private JarSpyClassTree classTree;
- // private List jarFileSelectionListeners = new ArrayList();
private List classSelectionListeners = new ArrayList();
private JarSpyPreferences jarSpyPreferences = null;
--- 50,57 ----
*/
public class ClassesViewer extends JPanel
! implements /* ListSelectionListener,*/ TreeSelectionListener {
private ClassDetailsPanel classDetailPanel;
private JarSpyClassTree classTree;
private List classSelectionListeners = new ArrayList();
private JarSpyPreferences jarSpyPreferences = null;
***************
*** 70,78 ****
public ClassesViewer(JarInspector jarInspector) {
super(new BorderLayout());
- // this.jarInspector = jarInspector;
classDetailPanel = new ClassDetailsPanel(this);
classTree = new JarSpyClassTree(jarInspector);
- // classList = new JarSpyClassList(jarInspector);
- // classList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
Container cont = this;
splitter = new JSplitPane();
--- 60,65 ----
***************
*** 80,84 ****
splitter.setRightComponent(classDetailPanel);
setJarViewComponent(classTree);
- // classList.addListSelectionListener(this);
classTree.addTreeSelectionListener(this);
--- 67,70 ----
***************
*** 88,107 ****
int dividerLocation = jarSpyPreferences.getMainDividerLocation();
splitter.setDividerLocation(dividerLocation);
-
- // if (initialFileToOpen == null) {
- // if a file path was not passed on the command line...
- // initialFileToOpen = jarSpyPreferences.getMostRecentJarFile();
- // }
-
- // if (initialFileToOpen != null) {
- // try {
- // File jarFile = new File(initialFileToOpen);
- // if (jarFile.exists()) {
- // setFile(jarFile);
- // }
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- // }
}
--- 74,77 ----
***************
*** 109,124 ****
classDetailPanel.jarFileSelectionChanged(file);
classTree.jarFileSelectionChanged(file);
- // classList.jarFileSelectionChanged(file);
- // jarInspector.setFile(file);
}
- // public void addJarFileSelectionListener(JarFileSelectionListener l) {
- // jarFileSelectionListeners.add(l);
- // }
- //
public void addClassSelectionListener(ClassSelectionListener l) {
classSelectionListeners.add(l);
}
! //
private void notifyClassSelectionListeners(ClassInfo classInfo) {
for (int i = 0; i < classSelectionListeners.size(); i++) {
--- 79,88 ----
classDetailPanel.jarFileSelectionChanged(file);
classTree.jarFileSelectionChanged(file);
}
public void addClassSelectionListener(ClassSelectionListener l) {
classSelectionListeners.add(l);
}
!
private void notifyClassSelectionListeners(ClassInfo classInfo) {
for (int i = 0; i < classSelectionListeners.size(); i++) {
***************
*** 156,160 ****
classesLabel.setBorder
(BorderFactory.createRaisedBevelBorder());
- // classList.setFont(new Font("Courier", Font.PLAIN, 14));
classListPanel.add(BorderLayout.NORTH, classesLabel);
classListPanel.add(BorderLayout.CENTER, new JScrollPane(viewComponent));
--- 120,123 ----
***************
*** 184,201 ****
}
! // public void valueChanged(ListSelectionEvent lse) {
! //
! // setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
! //
! // if (!lse.getValueIsAdjusting()) {
! // Object o = classList.getSelectedValue();
! // if (o instanceof ClassInfo) {
! // ClassInfo classInfo = (ClassInfo) o;
! // notifyClassSelectionListeners(classInfo);
! // } else if (o == null) {
! // notifyClassSelectionListeners(null);
! // }
! // }
! // setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
! // }
}
--- 147,156 ----
}
! public void collapseTree() {
! classTree.collapseAll();
! }
!
! public void expandTree() {
! classTree.expandAll();
! }
}
|