directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r370645 - in /directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui: AboutDialog.java IndexDialog.java
Date Thu, 19 Jan 2006 21:43:37 GMT
Author: akarasulu
Date: Thu Jan 19 13:43:34 2006
New Revision: 370645

URL: http://svn.apache.org/viewcvs?rev=370645&view=rev
Log:
cleaned up a couple bugs and converted the pulldown for cursor type to a radio button group

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AboutDialog.java
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AboutDialog.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AboutDialog.java?rev=370645&r1=370644&r2=370645&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AboutDialog.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AboutDialog.java
Thu Jan 19 13:43:34 2006
@@ -31,6 +31,7 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextArea;
+import javax.swing.SwingConstants;
 
 
 /**
@@ -44,13 +45,13 @@
     private static final long serialVersionUID = 3257853194544952884L;
 
     private String title = "About";
-    private String product = "Eve jdbm partition inspector";
-    private String version = "0.1";
+    private String product = "Vendor: Apache Software Foundation";
+    private String version = "Version: 0.1";
     private String copyright = "Copyright (c) 2003";
     private String comments =
-        "This is the jdbm partition viewer or introspector.\nIrregular behavior "
+        "This is the btree partition introspector.\nParitions "
       + "can be analyzed by using this tool to inspect\nthe state of system "
-      + "indices and entry attributes within the partition's database.";
+      + "indices and entry attributes.";
     private JPanel contentPane = new JPanel();
     private JLabel prodLabel = new JLabel();
     private JLabel verLabel = new JLabel();
@@ -96,7 +97,7 @@
         getContentPane().setLayout(formLayout);
         contentPane.setLayout(contentPaneLayout);
         contentPane.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(
-        new java.awt.Color(153, 153, 153), 1), "Directory Project: Eve", javax.swing.border.TitledBorder.LEADING,
javax.swing.border.TitledBorder.TOP,
+        new java.awt.Color(153, 153, 153), 1), "BTree Partition Inspector", javax.swing.border.TitledBorder.LEADING,
javax.swing.border.TitledBorder.TOP,
         new java.awt.Font("SansSerif", 0, 14), new java.awt.Color(60, 60, 60)));
         prodLabel.setText(product);
         prodLabel.setAlignmentX(0.5f);
@@ -125,16 +126,17 @@
         java.awt.GridBagConstraints.REMAINDER, 3, 0.0, 1.0, java.awt.GridBagConstraints.NORTHWEST,
java.awt.GridBagConstraints.BOTH,
         new java.awt.Insets(5, 5, 5, 0), 0, 0));
 
-        image.setText("Eve");
-        image.setIcon( new ImageIcon( getClass().getResource( "server.gif" ) ) );
-
-        image.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
-        image.setMinimumSize(new java.awt.Dimension(98,44));
-        image.setMaximumSize(new java.awt.Dimension(98,44));
+        image.setText( "ApacheDS" );
+        image.setVerticalTextPosition( SwingConstants.BOTTOM );
+        image.setHorizontalTextPosition( SwingConstants.CENTER );
+        image.setIcon( new ImageIcon( AboutDialog.class.getResource( "server.gif" ) ) );
+        image.setHorizontalAlignment(javax.swing.SwingConstants.CENTER );
+        image.setMinimumSize(new java.awt.Dimension(120,44));
+        image.setMaximumSize(new java.awt.Dimension(120,44));
         image.setAlignmentX(0.5f);
         image.setBorder(javax.swing.BorderFactory.createEmptyBorder());
         image.setPreferredSize(new java.awt.Dimension(98,44));
-        image.setSize(new java.awt.Dimension(98,200));
+        image.setSize(new java.awt.Dimension(120,200));
         btnPanel.setLayout(btnPaneLayout);
         okButton.setText("OK");
         okButton.addActionListener(

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java?rev=370645&r1=370644&r2=370645&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java
Thu Jan 19 13:43:34 2006
@@ -11,13 +11,14 @@
 
 import javax.naming.NamingEnumeration;
 import javax.swing.BorderFactory;
-import javax.swing.DefaultComboBoxModel;
+import javax.swing.BoxLayout;
+import javax.swing.ButtonGroup;
 import javax.swing.JButton;
-import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
 import javax.swing.JTable;
@@ -64,8 +65,8 @@
     private JLabel jLabel1 = new JLabel();
     private JTextField keyText = new JTextField();
     private JLabel jLabel2 = new JLabel();
-    private JComboBox cursorType = new JComboBox();
     private JButton scanBut = new JButton();
+    
     private Index index = null ;
 
     /** Creates new form JDialog */
@@ -98,6 +99,45 @@
         mainPnl.add(tabbedPane, java.awt.BorderLayout.CENTER);
         tabbedPane.add(listPnl, "Listing");
         listPnl.setLayout(new java.awt.GridBagLayout());
+
+        
+        RadioButtonListener radioListener = new RadioButtonListener();
+        JRadioButton radioDefault = new JRadioButton( DEFAULT_CURSOR );
+        radioDefault.setActionCommand( DEFAULT_CURSOR );
+        radioDefault.setSelected( true );
+        radioDefault.addActionListener( radioListener );
+        
+        JRadioButton radioEquality = new JRadioButton( EQUALITY_CURSOR );
+        radioEquality.setActionCommand( EQUALITY_CURSOR );
+        radioEquality.addActionListener( radioListener );
+        
+        JRadioButton radioGreater = new JRadioButton( GREATER_CURSOR );
+        radioGreater.setActionCommand( GREATER_CURSOR );
+        radioGreater.addActionListener( radioListener );
+        
+        JRadioButton radioLess = new JRadioButton( LESS_CURSOR );
+        radioLess.setActionCommand( LESS_CURSOR );
+        radioLess.addActionListener( radioListener );
+        
+        JRadioButton radioRegex = new JRadioButton( REGEX_CURSOR );
+        radioRegex.setActionCommand( REGEX_CURSOR );
+        radioRegex.addActionListener( radioListener );
+
+        ButtonGroup group = new ButtonGroup();
+        group.add( radioDefault );
+        group.add( radioEquality );
+        group.add( radioGreater );
+        group.add( radioLess );
+        group.add( radioRegex );
+
+        JPanel radioPanel = new JPanel();
+        radioPanel.setLayout( new BoxLayout( radioPanel, BoxLayout.X_AXIS ) );
+        radioPanel.add( radioDefault );
+        radioPanel.add( radioEquality );
+        radioPanel.add( radioGreater );
+        radioPanel.add( radioLess );
+        radioPanel.add( radioRegex );
+        
         listPnl.add(
             cursorPnl,
             new java.awt.GridBagConstraints(
@@ -194,7 +234,7 @@
                 0,
                 0));
         cursorPnl.add(
-            cursorType,
+            radioPanel,
             new java.awt.GridBagConstraints(
                 1,
                 0,
@@ -242,32 +282,49 @@
             new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 14));
         keyText.setSize(new java.awt.Dimension(130, 20));
         jLabel2.setText("Cursor Type:");
-        cursorType.setMaximumSize(new java.awt.Dimension(32767, 20));
-        cursorType.setMinimumSize(new java.awt.Dimension(126, 20));
-        cursorType.setPreferredSize(new java.awt.Dimension(130, 20));
-        DefaultComboBoxModel l_comboModel = new DefaultComboBoxModel();
-        l_comboModel.addElement(DEFAULT_CURSOR);
-        l_comboModel.addElement(EQUALITY_CURSOR);
-        l_comboModel.addElement(GREATER_CURSOR);
-        l_comboModel.addElement(LESS_CURSOR);
-        l_comboModel.addElement(REGEX_CURSOR);
-        cursorType.setModel(l_comboModel);
-        cursorType.setMaximumRowCount(5);
+
         scanBut.setText("Scan");
         scanBut.addActionListener(new ActionListener()
         {
-            public void actionPerformed(ActionEvent e)
+            public void actionPerformed( ActionEvent e )
             {
-                doScan(
-                    keyText.getText(),
-                    (String) cursorType.getSelectedItem());
+                doScan( keyText.getText(), selectedCursorType );
             }
         });
 
-        doScan(null, DEFAULT_CURSOR);
+        doScan( null, DEFAULT_CURSOR );
     }
 
 
+    private String selectedCursorType = DEFAULT_CURSOR;
+    class RadioButtonListener implements ActionListener
+    {
+        public void actionPerformed(ActionEvent e)
+        {
+            if ( e.getActionCommand() == DEFAULT_CURSOR )
+            {
+                selectedCursorType = DEFAULT_CURSOR;
+            }
+            else if ( e.getActionCommand() == EQUALITY_CURSOR )
+            {
+                selectedCursorType = EQUALITY_CURSOR;
+            }
+            else if ( e.getActionCommand() == GREATER_CURSOR )
+            {
+                selectedCursorType = GREATER_CURSOR;
+            }
+            else if ( e.getActionCommand() == LESS_CURSOR )
+            {
+                selectedCursorType = LESS_CURSOR;
+            }
+            else if ( e.getActionCommand() == REGEX_CURSOR )
+            {
+                selectedCursorType = REGEX_CURSOR;
+            }
+        }
+    }
+
+    
     private void closeDialog()
     {
         setVisible( false ) ;



Mime
View raw message