Hi Sojamo! Thanks for this awesome library.
Bug Report : 1.) Unable to set the value of a matrix coordinate and have it update the appearance. Calling update() on both matrix and controlP5 does nothing. Example (click the background to attempt to set the cell location at a random row and column to true):
Quote:import controlP5.*;
ControlP5 cp5;
Matrix m;
int backgroundColor;
int numRows = 20;
int numColumns = 10;
int cellHeight = 10;
int cellWidth = 20;
void setup()
{
size( 600, 400 );
backgroundColor = color( 0 );
cp5 = new ControlP5( this );
cp5.addMatrix( "firstMatrix", cellWidth, cellHeight,
10, 10, cellWidth * numColumns, cellHeight * numRows );
m = (Matrix) cp5.controller( "firstMatrix" );
}
void draw()
{
background( backgroundColor );
}
void mouseClicked()
{
backgroundColor = color( random( 255 ), random( 255 ), random( 255 ) );
int randomRow = (int) random( 0, numRows );
int randomColumn = (int) random( 0, numColumns );
m.setValue( randomRow * 256 + randomColumn );
}
void controlEvent(ControlEvent theEvent) {
println("## controlEvent / id:"+theEvent.controller().id()+"\n"+
"name:"+theEvent.controller().name()+"\n"+
"label:"+theEvent.controller().label()+"\n"+
"value:"+theEvent.controller().value()+"\n"+
"matrixValue x:"+Matrix.getX(theEvent.controller().value())+"\n"+
"matrixValue y:"+Matrix.getY(theEvent.controller().value())+"\n"
);
}
Offer of ServicesI have a good bit of experience with java and event programming. A few months ago in this thread you mentioned that you're having difficulty coping with the expanding size and scope of the library. Do you need development help? I like the library and am willing to write some junit tests, adopt a module, clean up the javadocs, find a bug to help out.
Access RestrictionsWill you consider making Controller.isInside() public, so we can subclass your implementations for different effects without having to be in your package? For example, I have my own matrix implementation that I based on your code from svn. I had to change and recompile your library to use it - and I'd prefer not to.