Thread: [Jcrossclient-cvs] jcrossclient Changelog,1.46,1.47 Settings.java,1.7,1.8 TabPanel.java,1.2,1.3
Status: Alpha
Brought to you by:
cavesomething
From: <jcr...@li...> - 2006-04-20 00:18:51
|
Update of /cvsroot/jcrossclient/jcrossclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31128 Modified Files: Changelog Settings.java TabPanel.java Log Message: update some deprecated code Index: TabPanel.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/TabPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TabPanel.java 19 Apr 2006 12:57:15 -0000 1.2 --- TabPanel.java 20 Apr 2006 00:18:47 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- import java.awt.*; import java.util.*; + import java.awt.event.*; /** ************************************************************************** *************** *** 33,37 **** @author not subject to copyright. */ ! public class TabPanel extends Panel { /** The width of the margins around the cards. */ public int margin = 3; // width of margins around cards --- 34,38 ---- @author not subject to copyright. */ ! public class TabPanel extends Panel implements MouseListener, MouseMotionListener { /** The width of the margins around the cards. */ public int margin = 3; // width of margins around cards *************** *** 53,56 **** --- 54,59 ---- public TabPanel() { setLayout(new CardLayout()); + addMouseListener(this); + addMouseMotionListener(this); setTabFont(new Font("Helvetica",Font.BOLD,12)); } *************** *** 111,116 **** ((CardLayout) getLayout()).show(this, (String) names.elementAt(i)); repaint(); ! Component c = getComponent(i); ! c.postEvent(new Event(c,Event.WINDOW_EXPOSE,this)); }} /** Select the first card in the Panel. */ --- 114,144 ---- ((CardLayout) getLayout()).show(this, (String) names.elementAt(i)); repaint(); ! Component c = getComponent(i); }} ! ! Applet applet = null; ! ! public void mouseDragged(MouseEvent evt) {} ! public void mouseMoved(MouseEvent evt) { ! if (applet == null) { ! Component c = getParent(); ! while (c != null) { ! if (c instanceof Applet) applet = (Applet) c; ! c = c.getParent(); }} ! if (applet != null) { ! int i=cardAt(evt.getX(),evt.getY()); ! if (i != -1) ! applet.showStatus(documentCard((String) names.elementAt(i))); }} ! ! public void mousePressed(MouseEvent evt) { ! int i = cardAt(evt.getX(),evt.getY()); ! if (i != -1) { ! setSelected(i,false); }} ! ! public void mouseClicked(MouseEvent evt) {} ! public void mouseReleased(MouseEvent evt) {} ! public void mouseEntered(MouseEvent evt) {} ! public void mouseExited(MouseEvent evt) { ! if (applet != null) ! applet.showStatus(""); } /** Select the first card in the Panel. */ *************** *** 150,176 **** return "Select tab card " + name; } ! Applet applet = null; ! ! /** Handle mouse clicks and documentation line for Tab selection. */ ! public boolean handleEvent(Event e) { ! if (e.id == Event.MOUSE_DOWN) { ! int i = cardAt(e.x,e.y); ! if (i != -1) { ! setSelected(i,false); ! return true; }} ! else if (e.id == Event.MOUSE_MOVE) { ! if (applet == null) { ! Component c = getParent(); ! while (c != null) { ! if (c instanceof Applet) applet = (Applet) c; ! c = c.getParent(); }} ! if (applet != null) { ! int i=cardAt(e.x,e.y); ! if (i != -1) ! applet.showStatus(documentCard((String) names.elementAt(i))); }} ! else if (e.id == Event.MOUSE_EXIT) { ! if (applet != null) ! applet.showStatus(""); } ! return super.handleEvent(e); } /*************************************************** --- 178,182 ---- return "Select tab card " + name; } ! /*************************************************** *************** *** 178,182 **** /** Allocates extra margins to give the cards some `body'. */ ! public Insets insets() { return new Insets(tabH+margin,margin,margin,margin); } --- 184,188 ---- /** Allocates extra margins to give the cards some `body'. */ ! public Insets getInsets() { return new Insets(tabH+margin,margin,margin,margin); } *************** *** 213,217 **** x += width[i]; } pos[nCards] = x; ! int w = size().width; if ((offscreen==null) || (offscreen.getHeight(this)<tabH) || (offscreen.getWidth(this)<w)){ --- 219,223 ---- x += width[i]; } pos[nCards] = x; ! int w = getSize().width; if ((offscreen==null) || (offscreen.getHeight(this)<tabH) || (offscreen.getWidth(this)<w)){ *************** *** 256,260 **** /** Paint the tabs in a row atop the cards. */ public void paint(Graphics gg) { ! Dimension sz = size(); Graphics g = offscreen.getGraphics(); int x,w = sz.width-1, h = sz.height-1, r = tabH/2; --- 262,266 ---- /** Paint the tabs in a row atop the cards. */ public void paint(Graphics gg) { ! Dimension sz = getSize(); Graphics g = offscreen.getGraphics(); int x,w = sz.width-1, h = sz.height-1, r = tabH/2; Index: Settings.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Settings.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Settings.java 19 Apr 2006 12:57:15 -0000 1.7 --- Settings.java 20 Apr 2006 00:18:47 -0000 1.8 *************** *** 187,191 **** public void reload (String buf) { ! StringBufferInputStream bais = new StringBufferInputStream(buf); try { val.load(bais); } catch(IOException err) { } } --- 187,197 ---- public void reload (String buf) { ! /* This change (replacing a StringBufferInputStream with a ! * ByteArrayInputStream) removes a deprecation warning, it doesn't ! * actually fix the problem that caused the old function to be ! * deprecated. Sun provide no proper way to do this, so we are ! * left with this horrible way to do it. ! */ ! ByteArrayInputStream bais = new ByteArrayInputStream(buf.getBytes()); try { val.load(bais); } catch(IOException err) { } } Index: Changelog =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Changelog,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Changelog 19 Apr 2006 23:05:27 -0000 1.46 --- Changelog 20 Apr 2006 00:18:47 -0000 1.47 *************** *** 343,344 **** --- 343,348 ---- README - update to mention 't' doubling for the quote key + + Settings - change some deprecated code + + Tabpanel - change some deprecated code |