From 3205f22801e4dd716f6e1b5218e79db8d64d4cb8 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 3 Jun 2013 10:43:50 -0400 Subject: [PATCH] fix for binary table problem, addl release notes --- build/shared/revisions.txt | 7 +++++++ core/src/processing/data/Table.java | 14 ++++++++++++-- core/todo.txt | 3 +++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 77a4db7de..90559b409 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -49,6 +49,13 @@ And just like that, here we are at 2.0. for GUI elements can be modified in lib/theme.txt, but be careful with those, and don't complain if/when they break. ++ Added several additional functions for data classes. More details + in the reference and coming soon. + ++ Changed how null values were handled with binary tables. If anyone + was using the (undocument) .bin format for Table, you'll need to + re-save your data. + [ andres on the attack ] + PImage not drawn after resize()/get() in P2D/P3D diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index df44166ea..debac686a 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -1097,7 +1097,13 @@ public class Table { for (int col = 0; col < getColumnCount(); col++) { switch (columnTypes[col]) { case STRING: - output.writeUTF(row.getString(col)); + String str = row.getString(col); + if (str == null) { + output.writeBoolean(false); + } else { + output.writeBoolean(true); + output.writeUTF(str); + } break; case INT: output.writeInt(row.getInt(col)); @@ -1191,7 +1197,11 @@ public class Table { for (int col = 0; col < columnCount; col++) { switch (columnTypes[col]) { case STRING: - setString(row, col, input.readUTF()); + String str = null; + if (input.readBoolean()) { + str = input.readUTF(); + } + setString(row, col, str); break; case INT: setInt(row, col, input.readInt()); diff --git a/core/todo.txt b/core/todo.txt index 5e9b473d5..85cd195e5 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -12,6 +12,9 @@ X https://github.com/processing/processing/issues/1826 X Java2D surfaces not updating when used with OpenGL X PGraphics using JAVA2D will not update when used with P2D or P3D X https://github.com/processing/processing/issues/1786 +X several additional functions for data classes +X change to the binary table file format +X not backwards compatible, b/c this feature is unannounced andres A PImage not drawn after resize()/get() in P2D/P3D