From de74897cb1daacd7cd50b2302f753d039fb45a0f Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 7 Dec 2011 14:18:49 +0000 Subject: [PATCH] bug fixes inside Table as they relate to inserting/adding columns --- core/src/processing/core/Table.java | 17 ++++++++++++++--- core/todo.txt | 10 ++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/src/processing/core/Table.java b/core/src/processing/core/Table.java index e04a679b9..2c2702e82 100644 --- a/core/src/processing/core/Table.java +++ b/core/src/processing/core/Table.java @@ -741,15 +741,26 @@ public class Table implements Iterable { } if (columnTitles != null) { columnTitles = PApplet.splice(columnTitles, title, index); + columnIndices = null; } columnTypes = PApplet.splice(columnTypes, type, index); - columnCategories = (HashMapBlows[]) - PApplet.splice(columnCategories, new HashMapBlows(), index); +// columnCategories = (HashMapBlows[]) +// PApplet.splice(columnCategories, new HashMapBlows(), index); + HashMapBlows[] catTemp = new HashMapBlows[columns.length + 1]; + // Faster than arrayCopy for a dozen or so entries + for (int i = 0; i < index; i++) { + catTemp[i] = columnCategories[i]; + } + catTemp[index] = new HashMapBlows(); + for (int i = index; i < columns.length; i++) { + catTemp[i+1] = columnCategories[i]; + } + columnCategories = catTemp; Object[] temp = new Object[columns.length + 1]; System.arraycopy(columns, 0, temp, 0, index); - System.arraycopy(columns, index, temp, index+1, (columns.length - index) + 1); + System.arraycopy(columns, index, temp, index+1, columns.length - index); columns = temp; switch (type) { diff --git a/core/todo.txt b/core/todo.txt index c22cee97a..5df3c645c 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -9,6 +9,7 @@ X better to learn noSmooth() later X repeatedly calling texture() with new image raises memory error X http://code.google.com/p/processing/issues/detail?id=806 X adding anti-alias methods so that FSAA can set up properly +X several bug fixes inside Table as they relate to inserting/adding columns earlier o text using textMode(SCREEN) not displayed in Processing 1.5.1 @@ -25,11 +26,20 @@ o along with 90, 180 and 270 versions of it as well o tie to glDrawPixels.. how to clear matrix properly for that? X maybe just disable this for JAVA2D cuz it's silly? +_ urlEncode() and urlDecode() + +_ pause()/resume() need to work on the desktop side as well + _ Wishlist for the new XML class in Processing 2.0 _ http://code.google.com/p/processing/issues/detail?id=904 _ add loadTable().. +_ delay() remove or no? (keep adding it back...) + +_ do we need an option to disable XML whitespace? +_ should this be the default to be more like old XML? + _ add() to add things to lists, sum() for the math (sum is used less after all) _ consider using BufferStrategy to improve performance