rana_b 2002/10/10 09:02:01
Modified: ftpserver/src/java/org/apache/avalon/ftpserver/gui
about.html FtpAdmin.java FtpAdminFrame.java
FtpIpPanel.java FtpRootPanel.java
FtpStatisticsPanel.java FtpUserPanel.java
Log:
UI layout changed - fixed resizing bug
Revision Changes Path
1.4 +53 -3
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/about.html
Index: about.html
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/about.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- about.html 7 Apr 2002 17:08:57 -0000 1.3
+++ about.html 10 Oct 2002 16:02:01 -0000 1.4
@@ -21,6 +21,7 @@
<li><font face="Arial">You can monitor all the user activities.</font></li>
<li><font face="Arial">Anonymous login support.</font></li>
<li><font face="Arial">Handles both ASCII and binary data transfers.</font></li>
+ <li><font face="Arial">Both upload and download files are resumable.</font></li>
<li><font face="Arial">IP restriction support. You can use a limited set of
regular expressions (*?[^-]) to specify the allowed/banned IPs.</font></li>
<li><font face="Arial">The server reloads the user data at a regular interval if
necessary.</font></li>
<li><font face="Arial">Database and LDAP can be used to store user
data.</font></li>
@@ -34,12 +35,61 @@
<li><font face="Arial">Tested with different FTP clients like
<a href="http://www.microsoft.com/windows/ie/">Internet Explorer</a>,
<a href="http://www.netscape.com/">Netscape Navigator</a>,
- <a href="http://www.globalscape.com/">CuteFTP</a>,
+ <a href="http://www.globalscape.com/">cuteFTP</a>,
<a href="http://www.smartftp.com/">SmartFTP</a>,
- <a href="http://www.ipswitch.com/">WsFtp</a>,
- <a href="http://stud.fh-heilbronn.de/~jdebis/leechftp/">LeechFTP</a>
etc.</font></li>
+ <a href="http://stud.fh-heilbronn.de/%7Ejdebis/leechftp/">LeechFTP</a>,
+ <a href="http://http://www.ipswitch.com/">WsFTP</a> etc.</font></li>
<li><font face="Arial" color="red">If you are using property file based user
manager, make sure that the user property file is not accesible by the FTP users.
Otherwise it will be a security problem. Keep it below the user virtual root
directory.</font></li>
</ul>
+
+<p align="left"><b><font face="Arial">License:</font></b></p>
+<pre><font size="1">
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
+ "Apache Software Foundation" must not be used to endorse or promote
+ products derived from this software without prior written
+ permission. For written permission, please contact [EMAIL PROTECTED]
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation. For more information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+</font></pre>
</body>
</html>
1.12 +16 -9
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpAdmin.java
Index: FtpAdmin.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpAdmin.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- FtpAdmin.java 20 May 2002 10:20:17 -0000 1.11
+++ FtpAdmin.java 10 Oct 2002 16:02:01 -0000 1.12
@@ -69,15 +69,17 @@
*/
public void initComponents() {
GridBagConstraints gc;
+ int yIndex = -1;
getContentPane().setLayout(new GridBagLayout());
+
// Host name
JLabel jHostLab = new JLabel("Host");
jHostLab.setHorizontalAlignment(JLabel.RIGHT);
jHostLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 0;
+ gc.gridy = ++yIndex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
gc.insets = new Insets(0, 0, 5, 10);
@@ -87,18 +89,19 @@
mjHostTxt.setColumns(15);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 0;
+ gc.gridy = yIndex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
getContentPane().add(mjHostTxt, gc);
+
// Port number
JLabel jPortLab = new JLabel("Port");
jPortLab.setHorizontalAlignment(JLabel.RIGHT);
jPortLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 1;
+ gc.gridy = ++yIndex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
gc.insets = new Insets(0, 0, 5, 10);
@@ -108,18 +111,19 @@
mjPortTxt.setColumns(5);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 1;
+ gc.gridy = yIndex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
getContentPane().add(mjPortTxt, gc);
+
// Admin login id
JLabel jAdminLab = new JLabel("Admin Id");
jAdminLab.setHorizontalAlignment(JLabel.RIGHT);
jAdminLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 2;
+ gc.gridy = ++yIndex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
gc.insets = new Insets(0, 0, 5, 10);
@@ -129,18 +133,19 @@
mjAdminTxt.setColumns(15);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 2;
+ gc.gridy = yIndex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
getContentPane().add(mjAdminTxt, gc);
+
// Admin password
JLabel jPasswordLab = new JLabel("Admin Password");
jPasswordLab.setHorizontalAlignment(JLabel.RIGHT);
jPasswordLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 3;
+ gc.gridy = ++yIndex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
gc.insets = new Insets(0, 0, 5, 10);
@@ -150,11 +155,12 @@
mjPasswordTxt.setColumns(15);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 3;
+ gc.gridy = yIndex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
getContentPane().add(mjPasswordTxt, gc);
+
// button panel
JPanel btnPane = new JPanel();
btnPane.setLayout(new FlowLayout(FlowLayout.CENTER));
@@ -169,7 +175,7 @@
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 4;
+ gc.gridy = ++yIndex;
gc.gridwidth = 3;
getContentPane().add(btnPane, gc);
@@ -186,6 +192,7 @@
terminate();
}
});
+
// set login icon
if (ICON_IMG != null) {
1.13 +17 -7
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpAdminFrame.java
Index: FtpAdminFrame.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpAdminFrame.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- FtpAdminFrame.java 20 May 2002 10:20:17 -0000 1.12
+++ FtpAdminFrame.java 10 Oct 2002 16:02:01 -0000 1.13
@@ -1,3 +1,4 @@
+//$Id$
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
@@ -8,12 +9,19 @@
package org.apache.avalon.ftpserver.gui;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.WindowEvent;
import java.rmi.RemoteException;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.tree.*;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
import org.apache.avalon.ftpserver.remote.interfaces.RemoteHandlerInterface;
@@ -51,6 +59,7 @@
mjTabPane = new JTabbedPane();
// top level
+ getContentPane().setLayout(new BorderLayout());
JSplitPane jSplitPane = new JSplitPane();
jSplitPane.setDividerSize(2);
@@ -64,6 +73,7 @@
// right pane
mjFtpPane = new JPanel();
+ mjFtpPane.setLayout(new BorderLayout());
jSplitPane.setRightComponent(mjFtpPane);
mjFtpPane.add(mjFtpTree.getRootPanel());
@@ -78,7 +88,7 @@
if (ICON_IMG != null) {
setIconImage(ICON_IMG.getImage());
}
- setSize(new Dimension(600, 450));
+ setSize(new Dimension(610, 450));
GuiUtils.setLocation(this);
}
@@ -117,4 +127,4 @@
dispose();
}
-}
\ No newline at end of file
+}
1.10 +42 -9
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpIpPanel.java
Index: FtpIpPanel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpIpPanel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FtpIpPanel.java 7 Apr 2002 17:08:57 -0000 1.9
+++ FtpIpPanel.java 10 Oct 2002 16:02:01 -0000 1.10
@@ -1,3 +1,4 @@
+//$Id$
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
@@ -8,13 +9,24 @@
package org.apache.avalon.ftpserver.gui;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.StringTokenizer;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.*;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTree;
+
import org.apache.avalon.ftpserver.remote.interfaces.IpRestrictorInterface;
/**
@@ -47,8 +59,13 @@
* Initialize UI components
*/
private void initComponents() throws RemoteException {
- setLayout(new BorderLayout());
+ setLayout(new GridBagLayout());
+ GridBagConstraints gc = null;
+ int yindex = -1;
+
+
+ // header
String headerStr = "";
if(mRestrictor.isAllowIp()) {
headerStr = "Allow IP listed";
@@ -59,13 +76,24 @@
JLabel headerLab = new JLabel(headerStr);
headerLab.setHorizontalAlignment(JLabel.CENTER);
headerLab.setForeground(Color.black);
- add(headerLab, BorderLayout.NORTH);
+ gc = new GridBagConstraints();
+ gc.gridx = 0;
+ gc.gridy = ++yindex;
+ gc.gridwidth = 1;
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(headerLab, gc);
- mjIpTxt = new JTextArea(18, 15);
+ mjIpTxt = new JTextArea(16, 12);
JScrollPane txtPane = new JScrollPane(mjIpTxt,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- add(txtPane, BorderLayout.CENTER);
+ gc = new GridBagConstraints();
+ gc.gridx = 0;
+ gc.gridy = ++yindex;
+ gc.gridwidth = 1;
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(txtPane, gc);
+
// buttons
JPanel btnPane = new JPanel();
@@ -77,7 +105,12 @@
JButton jResetBtn = new JButton("Reload");
btnPane.add(jResetBtn);
- add(btnPane, BorderLayout.SOUTH);
+ gc = new GridBagConstraints();
+ gc.gridx = 0;
+ gc.gridy = ++yindex;
+ gc.gridwidth = 1;
+ add(btnPane, gc);
+
// event handlers
jSaveBtn.addActionListener(new ActionListener() {
1.10 +18 -5
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpRootPanel.java
Index: FtpRootPanel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpRootPanel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FtpRootPanel.java 31 Mar 2002 16:52:43 -0000 1.9
+++ FtpRootPanel.java 10 Oct 2002 16:02:01 -0000 1.10
@@ -1,3 +1,4 @@
+//$Id$
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
@@ -8,10 +9,20 @@
package org.apache.avalon.ftpserver.gui;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
import java.rmi.RemoteException;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTree;
/**
@@ -51,12 +62,13 @@
JPanel topPane = new JPanel();
topPane.setLayout(new GridBagLayout());
GridBagConstraints gc;
+ int yIndex = -1;
JLabel hostLab = new JLabel("Remote Host");
hostLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 0;
+ gc.gridy = ++yIndex;
gc.insets = new Insets(0, 0, 0, 10);
topPane.add(hostLab, gc);
@@ -71,12 +83,13 @@
gc.insets = new Insets(0, 0, 0, 10);
topPane.add(mjHostTxt, gc);
+
JLabel headerLab = new JLabel("Configuration Parameters");
headerLab.setHorizontalAlignment(JLabel.CENTER);
headerLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 1;
+ gc.gridy = ++yIndex;
gc.gridwidth = 2;
gc.insets = new Insets(30, 0, 0, 0);
topPane.add(headerLab, gc);
1.11 +121 -95
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpStatisticsPanel.java
Index: FtpStatisticsPanel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpStatisticsPanel.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FtpStatisticsPanel.java 20 May 2002 10:20:17 -0000 1.10
+++ FtpStatisticsPanel.java 10 Oct 2002 16:02:01 -0000 1.11
@@ -1,3 +1,4 @@
+//$Id$
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
@@ -8,17 +9,28 @@
package org.apache.avalon.ftpserver.gui;
-import java.rmi.RemoteException;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+
import org.apache.avalon.ftpserver.FtpUser;
-import org.apache.avalon.ftpserver.remote.interfaces.FtpFileListener;
-import org.apache.avalon.ftpserver.remote.interfaces.FtpStatisticsListener;
-import org.apache.avalon.ftpserver.remote.interfaces.FtpStatisticsInterface;
import org.apache.avalon.ftpserver.gui.remote.FtpFileListenerAdapter;
import org.apache.avalon.ftpserver.gui.remote.FtpStatisticsListenerAdapter;
+import org.apache.avalon.ftpserver.remote.interfaces.FtpFileListener;
+import org.apache.avalon.ftpserver.remote.interfaces.FtpStatisticsInterface;
+import org.apache.avalon.ftpserver.remote.interfaces.FtpStatisticsListener;
/**
* Ftp server global statistics panel. It listenes to the global
@@ -86,34 +98,35 @@
* initialize the panel.
*/
private void initComponents() {
- setLayout(new BorderLayout());
- JPanel topPane = new JPanel();
GridBagConstraints gc;
- topPane.setLayout(new GridBagLayout());
-
+ setLayout(new GridBagLayout());
+ int yindex = -1;
+
+
// start time
JLabel jStartTimeLab = new JLabel("Start Time");
jStartTimeLab.setHorizontalAlignment(JLabel.RIGHT);
jStartTimeLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 0;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(15, 0, 0, 5);
- topPane.add(jStartTimeLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jStartTimeLab, gc);
mjStartTimeTxt = new JTextField();
- mjStartTimeTxt.setColumns(15);
+ mjStartTimeTxt.setColumns(12);
mjStartTimeTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 0;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(15, 0, 0, 5);
- topPane.add(mjStartTimeTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjStartTimeTxt, gc);
+
// number of uploads
JLabel jUploadNbrLab = new JLabel("Number of uploads");
@@ -121,22 +134,23 @@
jUploadNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 1;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jUploadNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jUploadNbrLab, gc);
mjUploadNbrTxt = new JTextField();
mjUploadNbrTxt.setColumns(6);
mjUploadNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 1;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjUploadNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjUploadNbrTxt, gc);
+
// number of downloads
JLabel jDownloadNbrLab = new JLabel("Number of downloads");
@@ -144,22 +158,23 @@
jDownloadNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 2;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jDownloadNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jDownloadNbrLab, gc);
mjDownloadNbrTxt = new JTextField();
mjDownloadNbrTxt.setColumns(6);
mjDownloadNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 2;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjDownloadNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjDownloadNbrTxt, gc);
+
// number of downloads
JLabel jDeleteNbrLab = new JLabel("Number of deletes");
@@ -167,22 +182,23 @@
jDeleteNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 3;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jDeleteNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jDeleteNbrLab, gc);
mjDeleteNbrTxt = new JTextField();
mjDeleteNbrTxt.setColumns(6);
mjDeleteNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 3;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjDeleteNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjDeleteNbrTxt, gc);
+
// number of uploaded bytes
JLabel jUploadBytesLab = new JLabel("Uploaded bytes");
@@ -190,22 +206,23 @@
jUploadBytesLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 4;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jUploadBytesLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jUploadBytesLab, gc);
mjUploadBytesTxt = new JTextField();
- mjUploadBytesTxt.setColumns(15);
+ mjUploadBytesTxt.setColumns(12);
mjUploadBytesTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 4;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjUploadBytesTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjUploadBytesTxt, gc);
+
// number of uploaded bytes
JLabel jDownloadBytesLab = new JLabel("Downloaded bytes");
@@ -213,22 +230,23 @@
jDownloadBytesLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 5;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jDownloadBytesLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jDownloadBytesLab, gc);
mjDownloadBytesTxt = new JTextField();
- mjDownloadBytesTxt.setColumns(15);
+ mjDownloadBytesTxt.setColumns(12);
mjDownloadBytesTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 5;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjDownloadBytesTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjDownloadBytesTxt, gc);
+
// number of current logins
JLabel jLoginNbrLab = new JLabel("Current logins");
@@ -236,22 +254,23 @@
jLoginNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 6;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jLoginNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jLoginNbrLab, gc);
mjLoginNbrTxt = new JTextField();
mjLoginNbrTxt.setColumns(6);
mjLoginNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 6;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjLoginNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjLoginNbrTxt, gc);
+
// number of total logins
JLabel jTotalLoginNbrLab = new JLabel("Total logins");
@@ -259,22 +278,23 @@
jTotalLoginNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 7;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jTotalLoginNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jTotalLoginNbrLab, gc);
mjTotalLoginNbrTxt = new JTextField();
mjTotalLoginNbrTxt.setColumns(6);
mjTotalLoginNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 7;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjTotalLoginNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjTotalLoginNbrTxt, gc);
+
// number of current anonymous logins
JLabel jAnonLoginNbrLab = new JLabel("Current anonymous logins");
@@ -282,22 +302,23 @@
jAnonLoginNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 8;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jAnonLoginNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jAnonLoginNbrLab, gc);
mjAnonLoginNbrTxt = new JTextField();
mjAnonLoginNbrTxt.setColumns(6);
mjAnonLoginNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 8;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjAnonLoginNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjAnonLoginNbrTxt, gc);
+
// number of total anonymous logins
JLabel jTotalAnonLoginNbrLab = new JLabel("Total anonymous logins");
@@ -305,22 +326,23 @@
jTotalAnonLoginNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 9;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jTotalAnonLoginNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jTotalAnonLoginNbrLab, gc);
mjTotalAnonLoginNbrTxt = new JTextField();
mjTotalAnonLoginNbrTxt.setColumns(6);
mjTotalAnonLoginNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 9;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjTotalAnonLoginNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjTotalAnonLoginNbrTxt, gc);
+
// number of current connections
JLabel jConNbrLab = new JLabel("Current connections");
@@ -328,22 +350,23 @@
jConNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 10;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jConNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jConNbrLab, gc);
mjConNbrTxt = new JTextField();
mjConNbrTxt.setColumns(6);
mjConNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 10;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjConNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjConNbrTxt, gc);
+
// number of current connections
JLabel jTotalConNbrLab = new JLabel("Total connections");
@@ -351,36 +374,39 @@
jTotalConNbrLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 11;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(jTotalConNbrLab, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(jTotalConNbrLab, gc);
mjTotalConNbrTxt = new JTextField();
mjTotalConNbrTxt.setColumns(6);
mjTotalConNbrTxt.setEditable(false);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 11;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.anchor = GridBagConstraints.WEST;
- gc.insets = new Insets(5, 0, 0, 5);
- topPane.add(mjTotalConNbrTxt, gc);
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(mjTotalConNbrTxt, gc);
- add(topPane, BorderLayout.CENTER);
-
- JPanel bottomPane = new JPanel();
- bottomPane.setLayout(new FlowLayout(FlowLayout.CENTER));
- JButton jReloadButton = new JButton("Reload");
- jReloadButton.addActionListener(new ActionListener() {
+
+ // reload statistics
+ JButton reloadButton = new JButton("Reload");
+ gc = new GridBagConstraints();
+ gc.gridx = 1;
+ gc.gridy = ++yindex;
+ gc.gridwidth = 1;
+ gc.anchor = GridBagConstraints.WEST;
+ gc.insets = new Insets(3, 0, 0, 3);
+ add(reloadButton, gc);
+
+ reloadButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
reload();
}
});
- bottomPane.add(jReloadButton);
-
- add(bottomPane, BorderLayout.SOUTH);
}
/**
1.14 +41 -33
jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpUserPanel.java
Index: FtpUserPanel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/FtpUserPanel.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- FtpUserPanel.java 20 May 2002 10:20:17 -0000 1.13
+++ FtpUserPanel.java 10 Oct 2002 16:02:01 -0000 1.14
@@ -8,23 +8,30 @@
package org.apache.avalon.ftpserver.gui;
-import java.util.Collections;
-import java.util.Random;
-import java.util.Iterator;
-import java.util.List;
import java.awt.Color;
-import java.awt.Insets;
import java.awt.FlowLayout;
-import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.SwingConstants;
-import javax.swing.*;
-import javax.swing.event.*;
import org.apache.avalon.ftpserver.FtpUser;
-import org.apache.avalon.ftpserver.usermanager.User;
import org.apache.avalon.ftpserver.remote.interfaces.UserManagerInterface;
+import org.apache.avalon.ftpserver.usermanager.User;
/**
@@ -93,13 +100,14 @@
private void initComponents() {
GridBagConstraints gc;
setLayout(new GridBagLayout());
-
+ int yindex = -1;
+
// user list
mjUserLst = new JComboBox();
mjUserLst.addActionListener(this);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 0;
+ gc.gridy = ++yindex;
gc.gridwidth = 3;
gc.insets = new Insets(10, 0, 10, 10);
add(mjUserLst, gc);
@@ -110,7 +118,7 @@
jNameLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 1;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -120,7 +128,7 @@
mjNameTxt.setColumns(12);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 1;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -132,7 +140,7 @@
jPasswordLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 2;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -142,7 +150,7 @@
mjPasswordTxt.setColumns(12);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 2;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -156,7 +164,7 @@
});
gc = new GridBagConstraints();
gc.gridx = 2;
- gc.gridy = 2;
+ gc.gridy = yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -168,7 +176,7 @@
jRetypePasswordLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 3;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -178,7 +186,7 @@
mjRetypePasswordTxt.setColumns(12);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 3;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -190,7 +198,7 @@
jSetPasswordLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 4;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -200,7 +208,7 @@
mjPasswordChkBox.setHorizontalTextPosition(SwingConstants.LEFT);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 4;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -212,7 +220,7 @@
jDirectoryLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 5;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.EAST;
gc.insets = new Insets(5, 0, 0, 10);
@@ -222,7 +230,7 @@
mjDirectoryTxt.setColumns(12);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 5;
+ gc.gridy = yindex;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.WEST;
gc.insets = new Insets(5, 0, 0, 10);
@@ -234,7 +242,7 @@
jEnabledLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 6;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -243,7 +251,7 @@
mjEnabledChkBox = new JCheckBox();
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 6;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -255,7 +263,7 @@
jWritePermLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 7;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -264,7 +272,7 @@
mjWriteChkBox = new JCheckBox();
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 7;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -276,7 +284,7 @@
jIdleLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 8;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -286,7 +294,7 @@
mjIdleLst.setEditable(true);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 8;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -301,7 +309,7 @@
jUploadLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 9;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -311,7 +319,7 @@
mjUploadLst.setEditable(true);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 9;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -323,7 +331,7 @@
jDownloadLab.setForeground(Color.black);
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 10;
+ gc.gridy = ++yindex;
gc.gridwidth = 1;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.EAST;
@@ -333,7 +341,7 @@
mjDownloadLst.setEditable(true);
gc = new GridBagConstraints();
gc.gridx = 1;
- gc.gridy = 10;
+ gc.gridy = yindex;
gc.gridwidth = 2;
gc.insets = new Insets(5, 0, 0, 10);
gc.anchor = GridBagConstraints.WEST;
@@ -368,7 +376,7 @@
gc = new GridBagConstraints();
gc.gridx = 0;
- gc.gridy = 11;
+ gc.gridy = ++yindex;
gc.gridwidth = 3;
gc.insets = new Insets(5, 0, 0, 10);
add(btnPane, gc);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>