Author: slotia
Date: 2009-08-04 09:38:18 -0700 (Tue, 04 Aug 2009)
New Revision: 17685
Added:
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/ConsoleDialog.java
Log:
Forgot to add ConsoleDialog
Added:
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/ConsoleDialog.java
===================================================================
---
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/ConsoleDialog.java
(rev 0)
+++
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/ConsoleDialog.java
2009-08-04 16:38:18 UTC (rev 17685)
@@ -0,0 +1,53 @@
+package org.cytoscape.log.internal;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import java.util.Map;
+
+import cytoscape.view.CySwingApplication;
+
+class ConsoleDialog extends JDialog
+{
+ final SimpleLogViewer simpleLogViewer;
+ final AdvancedLogViewer advancedLogViewer;
+ final JCheckBox viewSelection;
+ final JPanel contents;
+
+ public ConsoleDialog( CySwingApplication app,
+ SimpleLogViewer simpleLogViewer,
+ AdvancedLogViewer advancedLogViewer)
+ {
+ super(app.getJFrame(), "Console");
+ setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
+ setPreferredSize(new Dimension(850, 400));
+
+ this.advancedLogViewer = advancedLogViewer;
+ this.simpleLogViewer = simpleLogViewer;
+
+ contents = new JPanel(new CardLayout());
+ contents.add(simpleLogViewer.getComponent(), "simple");
+ contents.add(advancedLogViewer.getComponent(), "advanced");
+
+ viewSelection = new JCheckBox("Show All Messages");
+ viewSelection.addActionListener(new ViewSelectionAction());
+
+ getContentPane().add(contents, BorderLayout.CENTER);
+ getContentPane().add(viewSelection, BorderLayout.SOUTH);
+
+ pack();
+ setVisible(true);
+ }
+
+ class ViewSelectionAction implements ActionListener
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ CardLayout cl = (CardLayout) contents.getLayout();
+ if (viewSelection.isSelected())
+ cl.show(contents, "advanced");
+ else
+ cl.show(contents, "simple");
+ }
+ }
+}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---