[Jcrossclient-cvs] jcrossclient CFclient.java,1.24,1.25 Changelog,1.28,1.29 MapWin.java,1.6,1.7 Sett
Status: Alpha
Brought to you by:
cavesomething
From: <jcr...@li...> - 2006-01-25 01:35:50
|
Update of /cvsroot/jcrossclient/jcrossclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30798 Modified Files: CFclient.java Changelog MapWin.java Settings.java SettingsWin.java StatbarWin.java Log Message: better command line argument parsing and some display tweaks Index: Settings.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Settings.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Settings.java 24 Jan 2006 18:56:31 -0000 1.4 --- Settings.java 25 Jan 2006 01:35:40 -0000 1.5 *************** *** 312,354 **** } ! public void setLegalValue(String item, String newval) { ! if(newval.charAt(0) != '-') { ! // debug("setting "+item+" to "+newval); ! val.put(item,newval); ! } ! } ! ! void setValFromCmdLine(String args[]) { ! for(int ind = 0; ind < args.length; ind++ ) ! { ! String test = args[ind]; ! if(test.charAt(0) == '-') { ! try { ! // it would be cleaner to implement this as a switch, ! // how come java wont allow string switches?!? argh! ! if(test.equals("-host") || test.equals("-server")) { ! setLegalValue("server",args[++ind]); ! } else if(test.equals("-cache")) { ! setLegalValue("cache_images","true"); ! debug ("Image caching not enabled yet..."); ! } else if(test.equals("-debug")) { ! debug ("Running w/ debug mode"); ! setLegalValue("debug","true"); ! } else if(test.equals("-cmd")) { ! debug ("simple client 1-line command not installed yet..."); ! } else if(test.equals("-help")) { ! debug ("help not installed yet..."); ! } else { ! errmsg("unknown option:"+test); ! } ! } catch (ArrayIndexOutOfBoundsException err) { ! errmsg("No value given for:"+test); ! } ! } else { ! errmsg("unknown option:"+test); ! } ! } ! } } --- 312,351 ---- } ! public void setLegalValue(String item, String newval) { ! if(newval.charAt(0) != '-') { ! val.put(item,newval); ! } ! } ! void setValFromCmdLine(String args[]) { ! StringBuffer helptxt = new StringBuffer(); ! for(int ind = 0; ind < args.length; ind++ ) { ! String test = args[ind]; ! if(test.charAt(0) == '-') { ! try { ! if(test.equals("-host") || test.equals("-server")) { ! setLegalValue("server",args[++ind]); ! } else if(test.equals("-debug")) { ! debug ("Running w/ debug mode"); ! setLegalValue("debug","true"); ! } else if(test.equals("-help")) { ! helptxt.append("Jcrossclient:\n Options are:\n"); ! helptxt.append(" -server [hostname] Connect to server hostname\n"); ! helptxt.append(" -debug Run with extra debug messages\n"); ! helptxt.append(" -help This help text\n"); ! debug(helptxt.toString()); ! System.exit(0); ! } else { ! errmsg("unknown option:"+test + "\nrun with -help for options"); ! System.exit(0); ! } ! } catch (ArrayIndexOutOfBoundsException err) { ! errmsg("No value given for:"+test); ! } ! } else { ! errmsg("unknown option:"+test); ! } ! } ! } } Index: Changelog =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/Changelog,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Changelog 24 Jan 2006 18:56:31 -0000 1.28 --- Changelog 25 Jan 2006 01:35:40 -0000 1.29 *************** *** 203,206 **** --- 203,207 ---- - remove skill_name() function - remove listspells() function + - update for new naming Settings - reduce the default map and server delay by one-third *************** *** 208,211 **** --- 209,213 ---- Spell - remove irrelevant comment. - use skill.getName() instead of stats.skill_name() + - update for new naming SettingsWin - New file *************** *** 214,215 **** --- 216,229 ---- - added getName() function. + 25/01/2006 - StatbarWin - Set a preferred size + + SettingsWin - Improve layout + + Settings - Improve command line argument parsing + - Remove obsolete options + - provide a -help text + + MapWin - set minimum and maximum sizes + + CFclient - clarify some comments + Index: StatbarWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/StatbarWin.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatbarWin.java 28 Nov 2005 19:04:32 -0000 1.2 --- StatbarWin.java 25 Jan 2006 01:35:40 -0000 1.3 *************** *** 38,44 **** boolean loading_pixmaps=false; ! public void componentResized(ComponentEvent evt) ! { Dimension newsize; int fontspace=25; // yeah, hardcoded. sigh. --- 38,47 ---- boolean loading_pixmaps=false; + public Dimension getPrefferedSize() { + /* magic numbers, 65 is the height that the last piece of text is printed at */ + return new Dimension(0, 65); + } ! public void componentResized(ComponentEvent evt) { Dimension newsize; int fontspace=25; // yeah, hardcoded. sigh. Index: CFclient.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/CFclient.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CFclient.java 24 Jan 2006 18:56:31 -0000 1.24 --- CFclient.java 25 Jan 2006 01:35:40 -0000 1.25 *************** *** 1327,1340 **** /****************************************************************\ * addWindows() adds and creates all the subwindows for user * ! * WIndow layout is roughly as follows: * * * - * inv stats spells * - * | skills | * - * | | * - * V map V * - * ground messages * - * | statbar | * - * | V * - * V * \****************************************************************/ --- 1327,1345 ---- /****************************************************************\ * addWindows() adds and creates all the subwindows for user * ! * Window layout is as follows: * ! * _________________________________________________ * ! * | | | | * ! * | | | | * ! * | | | | * ! * | | map | | * ! * | | | | * ! * | tabs | | messages | * ! * | | | | * ! * | |_______________| | * ! * | | | | * ! * | | stats | | * ! * | | | | * ! * |_______________|_______________|_______________| * * * \****************************************************************/ *************** *** 1363,1370 **** sscrollp = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); - /* These next two lines only work with java 1.5+ until I find a - * better way to do this, they can stay commented out */ - /*miscwin.setMinimumSize(new Dimension(mapwin.pixwidth*mapwin.XMAX, 80)); - mapwin.setMinimumSize(new Dimension(mapwin.pixwidth*mapwin.XMAX, mapwin.pixheight*mapwin.YMAX));*/ iscrollp.setSize(290,210); iscrollp.add(invwin); --- 1368,1371 ---- Index: SettingsWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/SettingsWin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SettingsWin.java 24 Jan 2006 18:56:31 -0000 1.1 --- SettingsWin.java 25 Jan 2006 01:35:40 -0000 1.2 *************** *** 31,35 **** public SettingsWin(CFclient parent) { ! super(); Parent = parent; /* set up the server delay */ --- 31,35 ---- public SettingsWin(CFclient parent) { ! super(new BorderLayout()); Parent = parent; /* set up the server delay */ *************** *** 48,52 **** server_panel.add(new Label("Server Delay(ms)")); server_panel.add(server_delay); ! add(server_panel); map_delay = new Choice(); map_delay.add("5"); --- 48,52 ---- server_panel.add(new Label("Server Delay(ms)")); server_panel.add(server_delay); ! add(server_panel, "North"); map_delay = new Choice(); map_delay.add("5"); *************** *** 63,67 **** map_panel.add(new Label("Map Delay(ms)")); map_panel.add(map_delay); ! add(map_panel); } --- 63,67 ---- map_panel.add(new Label("Map Delay(ms)")); map_panel.add(map_delay); ! add(map_panel, "Center"); } Index: MapWin.java =================================================================== RCS file: /cvsroot/jcrossclient/jcrossclient/MapWin.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MapWin.java 15 Jan 2006 00:30:08 -0000 1.6 --- MapWin.java 25 Jan 2006 01:35:40 -0000 1.7 *************** *** 312,315 **** --- 312,323 ---- + /* ensure the entire map is always displayed when possible*/ + public Dimension getMinimumSize() { + return new Dimension(XMAX*pixwidth, YMAX*pixheight); + } + public Dimension getMaximumSize() { + return new Dimension(XMAX*pixwidth, YMAX*pixheight); + } + public void assignCells() { /* |