Revise use of deprecated methods.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@815 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2002-08-20 18:57:31 +00:00
parent 597290d4df
commit e12f2e9a51
5 changed files with 20 additions and 14 deletions
@@ -1,5 +1,5 @@
//
// $Id: RequestUtils.java,v 1.4 2002/05/09 05:01:09 mdb Exp $
// $Id: RequestUtils.java,v 1.5 2002/08/20 18:57:31 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -20,6 +20,7 @@
package com.samskivert.servlet.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpUtils;
@@ -41,7 +42,12 @@ public class RequestUtils
*/
public static String getLocationEncoded (HttpServletRequest req)
{
return URLEncoder.encode(getLocation(req));
String location = getLocation(req);
try {
return URLEncoder.encode(location, "UTF-8");
} catch (UnsupportedEncodingException uee) {
return location;
}
}
/**
@@ -1,5 +1,5 @@
//
// $Id: CollapsiblePanel.java,v 1.3 2002/07/10 01:53:32 ray Exp $
// $Id: CollapsiblePanel.java,v 1.4 2002/08/20 18:57:31 mdb Exp $
package com.samskivert.swing;
@@ -117,11 +117,11 @@ public class CollapsiblePanel extends JPanel
public void setCollapsed (boolean collapse)
{
if (collapse) {
_content.hide();
_content.setVisible(false);
_trigger.setIcon(_downIcon);
} else {
_content.show();
_content.setVisible(true);
_trigger.setIcon(_upIcon);
}
revalidate();
@@ -1,5 +1,5 @@
//
// $Id: SmartPolygon.java,v 1.2 2002/04/27 22:07:05 mdb Exp $
// $Id: SmartPolygon.java,v 1.3 2002/08/20 18:57:31 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -45,6 +45,6 @@ public class SmartPolygon extends Polygon
*/
public Rectangle getBoundingBox ()
{
return (bounds == null) ? super.getBoundingBox() : bounds;
return (bounds == null) ? super.getBounds() : bounds;
}
}
@@ -1,5 +1,5 @@
//
// $Id: DialogUtil.java,v 1.2 2002/07/10 01:53:59 ray Exp $
// $Id: DialogUtil.java,v 1.3 2002/08/20 18:57:31 mdb Exp $
package com.samskivert.swing.util;
@@ -67,6 +67,6 @@ public class DialogUtil
}
});
dialog.resize(dialog.getPreferredSize());
dialog.setSize(dialog.getPreferredSize());
}
}
@@ -1,14 +1,15 @@
//
// $Id: TermUtil.java,v 1.1 2002/06/06 20:52:36 mdb Exp $
// $Id: TermUtil.java,v 1.2 2002/08/20 18:57:30 mdb Exp $
package com.samskivert.util;
import java.awt.Dimension;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -86,12 +87,11 @@ public class TermUtil
try {
Process proc = Runtime.getRuntime().exec("resize");
InputStream in = proc.getInputStream();
BufferedInputStream bin = new BufferedInputStream(in);
DataInputStream din = new DataInputStream(bin);
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
Pattern regex = Pattern.compile("([0-9]+)");
String line;
int columns = -1, lines = -1;
while ((line = din.readLine()) != null) {
while ((line = bin.readLine()) != null) {
if (line.indexOf("COLUMNS") != -1) {
Matcher match = regex.matcher(line);
if (match.find()) {