|
From: Thomas K. <kr...@us...> - 2008-03-15 17:32:39
|
Update of /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18857/src/main/java/de/mud/bsx Modified Files: BSXDisplay.java BSXScene.java BSXProtocol.java BSXCache.java BSXObject.java BSX.java Log Message: [CLEAN UP] Javadoc Index: BSXDisplay.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSXDisplay.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** BSXDisplay.java 15 Mar 2008 15:30:38 -0000 1.8 --- BSXDisplay.java 15 Mar 2008 17:32:44 -0000 1.9 *************** *** 13,24 **** /** * the visual component for displaying bsx data. Implementation of a BSX Display ! * capable of handling basic BSX-Calls. Handles: * - * @SCE, - * @DFS, - * @VIO, - * @RMO, - * @DFO, - * @RFS * @author Thomas Kriegelstein * @version $Id$ --- 13,19 ---- /** * the visual component for displaying bsx data. Implementation of a BSX Display ! * capable of handling basic BSX-Calls. Handles: &SCE, &DFS, &VIO, ! * &RMO, &DFO, &RFS * * @author Thomas Kriegelstein * @version $Id$ *************** *** 60,64 **** * @SCEscene. * @param sceneName ! * BSX-style identifier of the scene * @return query for scene data if not in cache */ --- 55,59 ---- * @SCEscene. * @param sceneName ! * BSX-style identifier of the scene * @return query for scene data if not in cache */ *************** *** 86,92 **** * @DFSscene.data * @param sceneName ! * BSX-style identifier of the scene * @param data ! * BSX-style data */ public void defineScene(final String sceneName, final int[][] data) { --- 81,87 ---- * @DFSscene.data * @param sceneName ! * BSX-style identifier of the scene * @param data ! * BSX-style data */ public void defineScene(final String sceneName, final int[][] data) { *************** *** 109,117 **** * @VIOid.xy * @param objectName ! * BSX-style identifier for the object * @param xpos ! * the horizontal location * @param ypos ! * the vertical location * @return query for object data if not in cache */ --- 104,112 ---- * @VIOid.xy * @param objectName ! * BSX-style identifier for the object * @param xpos ! * the horizontal location * @param ypos ! * the vertical location * @return query for object data if not in cache */ *************** *** 134,141 **** * @RMOid. * @param objectName ! * BSX-style identifier of an object */ public void removeObject(final String objectName) { ! if (this.working!=null) { if (this.working.containsObject(objectName)) { this.working.removeObject(objectName); --- 129,136 ---- * @RMOid. * @param objectName ! * BSX-style identifier of an object */ public void removeObject(final String objectName) { ! if (this.working != null) { if (this.working.containsObject(objectName)) { this.working.removeObject(objectName); *************** *** 148,154 **** * @DFOid. * @param id ! * BSX-style identifier of an object * @param data ! * BSX-style data */ public void defineObject(final String id, final int[][] data) { --- 143,149 ---- * @DFOid. * @param id ! * BSX-style identifier of an object * @param data ! * BSX-style data */ public void defineObject(final String id, final int[][] data) { *************** *** 212,216 **** * * @param g ! * Graphicsobject to draw onto */ public void paint(final Graphics g) { --- 207,211 ---- * * @param g ! * Graphicsobject to draw onto */ public void paint(final Graphics g) { Index: BSXScene.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSXScene.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** BSXScene.java 15 Mar 2008 14:30:36 -0000 1.4 --- BSXScene.java 15 Mar 2008 17:32:44 -0000 1.5 *************** *** 28,32 **** * * @param id ! * object to be checked * @return true if object is here, otherwise false */ --- 28,32 ---- * * @param id ! * object to be checked * @return true if object is here, otherwise false */ *************** *** 39,47 **** * * @param objectName ! * BSX-style identifier of object to be added * @param x ! * x-position of object in scene * @param y ! * y-position of object in scene */ public void addObject(final String objectName, final int x, final int y) { --- 39,47 ---- * * @param objectName ! * BSX-style identifier of object to be added * @param x ! * x-position of object in scene * @param y ! * y-position of object in scene */ public void addObject(final String objectName, final int x, final int y) { *************** *** 57,61 **** * * @param objectName ! * BSX-style identifier of object in this scene * @return -1 object not in this scene, 0..7 layer of the object */ --- 57,61 ---- * * @param objectName ! * BSX-style identifier of object in this scene * @return -1 object not in this scene, 0..7 layer of the object */ *************** *** 73,79 **** * * @param objectName ! * BSX-style identifier of object to be removed * @param layer ! * number of the layer the object is supposed to be */ public void removeObject(final String objectName, final int layer) { --- 73,79 ---- * * @param objectName ! * BSX-style identifier of object to be removed * @param layer ! * number of the layer the object is supposed to be */ public void removeObject(final String objectName, final int layer) { *************** *** 85,89 **** * * @param objectName ! * BSX-style identifier of object to be removed */ public void removeObject(final String objectName) { --- 85,89 ---- * * @param objectName ! * BSX-style identifier of object to be removed */ public void removeObject(final String objectName) { *************** *** 98,102 **** * * @param objectName ! * BSX-style identifier of object to be found * @return null object is not in this scene, location otherwise */ --- 98,102 ---- * * @param objectName ! * BSX-style identifier of object to be found * @return null object is not in this scene, location otherwise */ *************** *** 122,128 **** * * @param sceneName ! * BSX-style identifier of this scene * @param data ! * BSX-style data as description of this scene */ public BSXScene(final String sceneName, final int[][] data) { --- 122,128 ---- * * @param sceneName ! * BSX-style identifier of this scene * @param data ! * BSX-style data as description of this scene */ public BSXScene(final String sceneName, final int[][] data) { *************** *** 138,142 **** * * @param layer ! * layer to look on * @return Enumeration with objects on that layer */ --- 138,142 ---- * * @param layer ! * layer to look on * @return Enumeration with objects on that layer */ *************** *** 149,153 **** * * @param g ! * graphics object to draw on */ public void fill(final Graphics g) { --- 149,153 ---- * * @param g ! * graphics object to draw on */ public void fill(final Graphics g) { Index: BSXProtocol.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSXProtocol.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** BSXProtocol.java 15 Mar 2008 14:30:36 -0000 1.4 --- BSXProtocol.java 15 Mar 2008 17:32:44 -0000 1.5 *************** *** 8,12 **** * @since 1.0 */ ! interface BSXProtocol { /** length of BSX commands in bytes. */ public static final int COMMAND_LENGTH = 4; --- 8,12 ---- * @since 1.0 */ ! public final class BSXProtocol { /** length of BSX commands in bytes. */ public static final int COMMAND_LENGTH = 4; *************** *** 30,32 **** --- 30,36 ---- public static final int Y_MAX = 7; + private BSXProtocol() { + // Do not call, never, ever + } + } Index: BSXCache.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSXCache.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** BSXCache.java 15 Mar 2008 15:30:38 -0000 1.7 --- BSXCache.java 15 Mar 2008 17:32:44 -0000 1.8 *************** *** 47,51 **** */ public final String toString() { ! final StringBuilder res = new StringBuilder("" + this.size + " entries\n"); for (int i = CACHE_SIZE - this.size; i < CACHE_SIZE; i++) { res.append("\t\t" + i + ":\t" + this.ids[i] + "\n"); --- 47,52 ---- */ public final String toString() { ! final StringBuilder res = new StringBuilder("" + this.size ! + " entries\n"); for (int i = CACHE_SIZE - this.size; i < CACHE_SIZE; i++) { res.append("\t\t" + i + ":\t" + this.ids[i] + "\n"); *************** *** 58,62 **** * * @param name ! * BSX-style identifier of object * @return null or found object */ --- 59,63 ---- * * @param name ! * BSX-style identifier of object * @return null or found object */ *************** *** 80,87 **** * * @param name ! * BSX-style identifier of object */ public final void removeEntry(final String name) { ! final int index= find(name); if (NOT_FOUND != index) { remove(index); --- 81,88 ---- * * @param name ! * BSX-style identifier of object */ public final void removeEntry(final String name) { ! final int index = find(name); if (NOT_FOUND != index) { remove(index); *************** *** 93,99 **** * * @param name ! * BSX-style identifier of object * @param bsxobject ! * the data to use */ public final void addEntry(final String name, final BSXObject bsxobject) { --- 94,100 ---- * * @param name ! * BSX-style identifier of object * @param bsxobject ! * the data to use */ public final void addEntry(final String name, final BSXObject bsxobject) { *************** *** 115,119 **** * * @param name ! * BSX-style identifier of object * @return true if cache contains the named object */ --- 116,120 ---- * * @param name ! * BSX-style identifier of object * @return true if cache contains the named object */ *************** *** 127,131 **** * * @param index ! * index of object to remove */ private void remove(final int index) { --- 128,132 ---- * * @param index ! * index of object to remove */ private void remove(final int index) { *************** *** 147,151 **** * * @param offset ! * how much space to make. */ private void move(final int offset) { --- 148,152 ---- * * @param offset ! * how much space to make. */ private void move(final int offset) { *************** *** 170,174 **** * * @param name ! * BSX-style identifier of object * @return the index inside the cache */ --- 171,175 ---- * * @param name ! * BSX-style identifier of object * @return the index inside the cache */ Index: BSXObject.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSXObject.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** BSXObject.java 15 Mar 2008 15:30:38 -0000 1.6 --- BSXObject.java 15 Mar 2008 17:32:44 -0000 1.7 *************** *** 44,57 **** * * @param name ! * identifier of this object * @param aData ! * field containing gfx information ! * <ul> ! * <li>data.length - number of polygons ! * <li>(data[i].length-1)/2 - number of edges ! * <li>data[i][0] - color index ! * <li>data[i][j*2+1] - x coord ! * <li>data[i][j*2+2] - y coord ! * </ul> */ public BSXObject(final String name, final int[][] aData) { --- 44,57 ---- * * @param name ! * identifier of this object * @param aData ! * field containing gfx information ! * <ul> ! * <li>data.length - number of polygons ! * <li>(data[i].length-1)/2 - number of edges ! * <li>data[i][0] - color index ! * <li>data[i][j*2+1] - x coord ! * <li>data[i][j*2+2] - y coord ! * </ul> */ public BSXObject(final String name, final int[][] aData) { *************** *** 64,72 **** * * @param g ! * draw there * @param x ! * BSX_XPOS * @param y ! * BSX_YPOS */ public final void draw(final Graphics g, final int x, final int y) { --- 64,72 ---- * * @param g ! * draw there * @param x ! * BSX_XPOS * @param y ! * BSX_YPOS */ public final void draw(final Graphics g, final int x, final int y) { *************** *** 79,83 **** * * @param aData ! * BSX-style new data to be used */ public final void setData(final int[][] aData) { --- 79,83 ---- * * @param aData ! * BSX-style new data to be used */ public final void setData(final int[][] aData) { *************** *** 94,98 **** * * @param aData ! * BSX-style data to use internally * @return the copy of the data */ --- 94,98 ---- * * @param aData ! * BSX-style data to use internally * @return the copy of the data */ *************** *** 111,115 **** * * @param obj ! * the other object * @return true if the other object is a BSXObject with the same identifier. */ --- 111,115 ---- * * @param obj ! * the other object * @return true if the other object is a BSXObject with the same identifier. */ *************** *** 132,140 **** * * @param g ! * Graphics to draw onto * @param xMiddle ! * adjusted middle of the graphic * @param yMiddle ! * adjusted middle of the graphic */ public final void drawAt(final Graphics g, final int xMiddle, --- 132,140 ---- * * @param g ! * Graphics to draw onto * @param xMiddle ! * adjusted middle of the graphic * @param yMiddle ! * adjusted middle of the graphic */ public final void drawAt(final Graphics g, final int xMiddle, *************** *** 146,150 **** final int px = this.data[polys][2 * point + 1]; final int py = this.data[polys][2 * point + 2]; ! final int dpx = px * 2 - xMiddle + BSXDisplay.DIMENSION.width / 2; final int dpy = BSXDisplay.DIMENSION.height / 2 - py + yMiddle; this.poly[2 * polys + 0][point] = dpx; --- 146,151 ---- final int px = this.data[polys][2 * point + 1]; final int py = this.data[polys][2 * point + 2]; ! final int dpx = px * 2 - xMiddle + BSXDisplay.DIMENSION.width ! / 2; final int dpy = BSXDisplay.DIMENSION.height / 2 - py + yMiddle; this.poly[2 * polys + 0][point] = dpx; Index: BSX.java =================================================================== RCS file: /cvsroot/bsxproject/backend/src/main/java/de/mud/bsx/BSX.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** BSX.java 15 Mar 2008 14:30:36 -0000 1.6 --- BSX.java 15 Mar 2008 17:32:44 -0000 1.7 *************** *** 7,23 **** /** * UltraHighSpeed-BSX-command-parser. Features: ! * <UL> ! * <LI> BSX-Commands: ! * @RFS, ! * @DFS, ! * @DFO, ! * @RQV, ! * @SCE, ! * @VIO, ! * @RMO, ! * @TMS ! * <LI> fault-tolerant handling of buggy BSX data -> ignoring until ! * @RFS ! * </UL> * @author Thomas Kriegelstein (foobar@regenbogen) * @version $Id$ --- 7,17 ---- /** * UltraHighSpeed-BSX-command-parser. Features: ! * <ul> ! * <li> BSX-Commands: &RFS, &DFS, &DFO, &RQV, &SCE, ! * &VIO, &RMO, &TMS </li> ! * <li> fault-tolerant handling of buggy BSX data -> ignoring until &RFS ! * </li> ! * </ul> ! * * @author Thomas Kriegelstein (foobar@regenbogen) * @version $Id$ *************** *** 68,72 **** * * @param name ! * Version to return when asked for. */ public BSX(final String name) { --- 62,66 ---- * * @param name ! * Version to return when asked for. */ public BSX(final String name) { *************** *** 88,92 **** * * @param s ! * what to send to the server */ protected void write(final String s) { --- 82,86 ---- * * @param s ! * what to send to the server */ protected void write(final String s) { *************** *** 189,193 **** * * @param arg ! * message to print */ private void debug(final String arg) { --- 183,187 ---- * * @param arg ! * message to print */ private void debug(final String arg) { *************** *** 199,208 **** * * @param buffer ! * input buffer byte array * @param length ! * count of valid bytes in buffer * @return new length of valid bytes in buffer * @throws IOException ! * on errors */ public final int parse(final byte[] buffer, final int length) { --- 193,202 ---- * * @param buffer ! * input buffer byte array * @param length ! * count of valid bytes in buffer * @return new length of valid bytes in buffer * @throws IOException ! * on errors */ public final int parse(final byte[] buffer, final int length) { *************** *** 249,255 **** * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void discard(final byte[] buffer, final int bufferIndex) { --- 243,249 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void discard(final byte[] buffer, final int bufferIndex) { *************** *** 277,285 **** * * @param buffer ! * input * @param bufferIndex ! * index in input * @throws IOException ! * on errors */ private void readYPos(final byte[] buffer, final int bufferIndex) { --- 271,279 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input * @throws IOException ! * on errors */ private void readYPos(final byte[] buffer, final int bufferIndex) { *************** *** 305,311 **** * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readXPos(final byte[] buffer, final int bufferIndex) { --- 299,305 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readXPos(final byte[] buffer, final int bufferIndex) { *************** *** 327,333 **** * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readPolygon(final byte[] buffer, final int bufferIndex) { --- 321,327 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readPolygon(final byte[] buffer, final int bufferIndex) { *************** *** 369,375 **** * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readEdgeCount(final byte[] buffer, final int bufferIndex) { --- 363,369 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readEdgeCount(final byte[] buffer, final int bufferIndex) { *************** *** 398,404 **** * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readPolygonCount(final byte[] buffer, final int bufferIndex) { --- 392,398 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input */ private void readPolygonCount(final byte[] buffer, final int bufferIndex) { *************** *** 436,447 **** * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output * @throws IOException ! * on errors */ private int readId(final byte[] buffer, final int bufferIndex, --- 430,441 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output * @throws IOException ! * on errors */ private int readId(final byte[] buffer, final int bufferIndex, *************** *** 487,498 **** * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output * @throws IOException ! * on errors */ private int readCommand(final byte[] buffer, final int bufferIndex, --- 481,492 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output * @throws IOException ! * on errors */ private int readCommand(final byte[] buffer, final int bufferIndex, *************** *** 526,530 **** } else if (equals(this.cmd, TMS)) { ! final byte[] temp = "\n\n\tTerminate Session!\n\n".getBytes(); for (int idx = 0; idx < temp.length; idx++) { this.res[resindex++] = temp[idx]; --- 520,525 ---- } else if (equals(this.cmd, TMS)) { ! final byte[] temp = "\n\n\tTerminate Session!\n\n" ! .getBytes(); for (int idx = 0; idx < temp.length; idx++) { this.res[resindex++] = temp[idx]; *************** *** 546,554 **** * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output */ --- 541,549 ---- * * @param buffer ! * input * @param bufferIndex ! * index in input * @param resultIndex ! * index in output * @return new index in output */ *************** *** 569,575 **** * * @param a ! * a byte array * @param b ! * another byte array * @return true if they contain the same values */ --- 564,570 ---- * * @param a ! * a byte array * @param b ! * another byte array * @return true if they contain the same values */ *************** *** 594,598 **** * * @param b ! * a byte[2] array * @return -1 on parseerror */ --- 589,593 ---- * * @param b ! * a byte[2] array * @return -1 on parseerror */ |