[Jcrossclient-cvs] jcrossclient CFclient.java,1.37,1.38 Changelog,1.44,1.45 ContainerWin.java,1.1,1.
Status: Alpha
Brought to you by:
cavesomething
From: <jcr...@li...> - 2006-04-19 17:12:40
|
Update of /cvsroot/jcrossclient/jcrossclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32233 Modified Files: CFclient.java Changelog ContainerWin.java MapWin.java Metaserver.java Log Message: tidy up container and metaserver code, make the 't' key also focus the talk window Index: Changelog =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Changelog,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Changelog 19 Apr 2006 12:57:15 -0000 1.44 --- Changelog 19 Apr 2006 17:12:37 -0000 1.45 *************** *** 327,328 **** --- 327,338 ---- CFClient - removal of some metaserver-related code from here. + + Mapwin - remove some needless mouseListener calls + + CFClient - make the 't' key focus the talk window as well as the quote key + + ContainerWin - Remove some useless sizing code + - display the container on the top of the container view + - make clicking on it close the container + + Metaserver - allow pressing enter in the url box to connect also. Index: Metaserver.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Metaserver.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Metaserver.java 19 Apr 2006 12:57:15 -0000 1.4 --- Metaserver.java 19 Apr 2006 17:12:37 -0000 1.5 *************** *** 258,261 **** --- 258,262 ---- urlentry.add(new Label("Hostname/IP")); urlbar = new TextField(40); + urlbar.addActionListener(this); urlentry.add(urlbar); connect = new Button("Connect"); Index: CFclient.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/CFclient.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CFclient.java 19 Apr 2006 12:57:15 -0000 1.37 --- CFclient.java 19 Apr 2006 17:12:37 -0000 1.38 *************** *** 258,268 **** String keytext=evt.getKeyText(keycode); ! ! /* speshul hack here to allow ' to focus the talkwindow */ ! if (keytext.equals("Quote")) { focus_talkwin(); return; } ! // Using the parameter 'key' string that will grab // the correct command string from the params table. --- 258,273 ---- String keytext=evt.getKeyText(keycode); ! ! /* speshul hack here to allow ' to focus the talkwindow ! * There seems to be an issue with some foreign keyboard ! * layouts that the quote key isn't typable without ! * setting some modifiers, we'll use the 't' key as an ! * alternitive for now - this may change eventually ! */ ! if (keytext.equals("Quote") || keytext.equals("T")) { focus_talkwin(); return; } ! // Using the parameter 'key' string that will grab // the correct command string from the params table. Index: ContainerWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/ContainerWin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContainerWin.java 19 Apr 2006 12:57:15 -0000 1.1 --- ContainerWin.java 19 Apr 2006 17:12:37 -0000 1.2 *************** *** 30,35 **** Vector ContainerObjects; int invsize=0; - int winwidth=80; // recalc'd every time contents changed - // but lets have a reasonable start! public ContainerWin(CFclient tl, Vector objs) { --- 30,33 ---- *************** *** 85,92 **** public void mouseClicked(MouseEvent evt) { int objpos=evt.getY() / objpixheight; ! if (objpos>=ContainerObjects.size()) return; int buttonmask=evt.getModifiers(); ! CFObject clickobj= (CFObject)ContainerObjects.elementAt(objpos); last_clicked_object = clickobj; Point offset = toplevel.iscrollp.getScrollPosition(); --- 83,95 ---- public void mouseClicked(MouseEvent evt) { int objpos=evt.getY() / objpixheight; ! if (objpos>ContainerObjects.size()) return; + if (objpos == 0) { + /* close the currently open container */ + toplevel.applyObj(toplevel.allobjects.getOpenContainer().getTag()); + return; + } int buttonmask=evt.getModifiers(); ! CFObject clickobj= (CFObject)ContainerObjects.elementAt(objpos-1); last_clicked_object = clickobj; Point offset = toplevel.iscrollp.getScrollPosition(); *************** *** 123,143 **** public void updateDisplay() { synchronized(ContainerObjects) { - int curwidth=0, maxwidth=0; - - int objcount = ContainerObjects.size(); - CFObject item; - String itemname; - Graphics gc = getGraphics(); - FontMetrics fm = gc.getFontMetrics(); - - for (int oc=0; oc<objcount; oc++) { - item=(CFObject)ContainerObjects.elementAt(oc); - itemname=item.getName(); - curwidth=fm.stringWidth(itemname); - - if (curwidth> maxwidth) - maxwidth=curwidth; - } - winwidth=maxwidth+objpixheight+10; repaint(); } --- 126,129 ---- *************** *** 147,161 **** synchronized(ContainerObjects) { int objcount = ContainerObjects.size(); ! CFObject item; ! if (objcount==0) { gc.drawString("(No container open)", 10,10); return; } for (int oc=0; oc<objcount; oc++) { item=(CFObject)ContainerObjects.elementAt(oc); ! int Ypos=objpixheight * oc; int Textpos=Ypos+ (objpixheight>>1) +3; ! Image pixmap = toplevel.getScaledPixmap(item.getFace()); if (pixmap==null) { toplevel.askForFace(item.getFace()); --- 133,155 ---- synchronized(ContainerObjects) { int objcount = ContainerObjects.size(); ! CFObject item, container; ! Image pixmap; ! container = toplevel.allobjects.getOpenContainer(); ! if (container == null) { gc.drawString("(No container open)", 10,10); return; } + pixmap = toplevel.getScaledPixmap(container.getFace()); + gc.drawImage(pixmap, 0, 0, this); + gc.drawString("Items in " + container.getObjName() + " (click to close)", + objpixheight+10, (objpixheight>>1) +3); + gc.drawLine(0, objpixheight, 1000, objpixheight); + for (int oc=0; oc<objcount; oc++) { item=(CFObject)ContainerObjects.elementAt(oc); ! int Ypos=objpixheight * (oc+1); int Textpos=Ypos+ (objpixheight>>1) +3; ! pixmap = toplevel.getScaledPixmap(item.getFace()); if (pixmap==null) { toplevel.askForFace(item.getFace()); Index: MapWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/MapWin.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MapWin.java 15 Apr 2006 17:45:01 -0000 1.9 --- MapWin.java 19 Apr 2006 17:12:37 -0000 1.10 *************** *** 310,322 **** } - public void keyPressed(KeyEvent evt) { } - - - public void keyReleased(KeyEvent evt) { } - - - public void keyTyped(KeyEvent evt) { } - - public void actionPerformed(ActionEvent evt) { String time = evt.getActionCommand(); --- 310,313 ---- |