For a simple data table like this: Test Table
protected final Schema tableschema=new Schema();
{
tableschema.addColumn(ID, int.class);
tableschema.addColumn(SIMscore, float.class);
tableschema.addColumn(LINES, float.class);
}
The table schema is same as above.
Schema[(ID, int, -1) (score, float, 0.0) (lines, float, 0.0)]
When this table is associated with a Visualization, a VisualTable is created and the schema of this table is:
Schema[(_validated, boolean, false) (_visible, boolean, true) (_visible:start, boolean, false) (_visible:end, boolean, true) (_interactive, boolean, true) (_expanded, boolean, true) (_fixed, boolean, false) (_highlight, boolean, false) (_hover, boolean, false) (_x, double, 0.0) (_x:start, double, 0.0) (_x:end, double, 0.0) (_y, double, 0.0) (_y:start, double, 0.0) (_y:end, double, 0.0) (_bounds, java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=0.0,h=0.0]) (_strokeColor, int, 0) (_strokeColor:start, int, 0) (_strokeColor:end, int, 0) (_fillColor, int, 0) (_fillColor:start, int, 0) (_fillColor:end, int, 0) (_textColor, int, 0) (_textColor:start, int, 0) (_textColor:end, int, 0) (_size, double, 1.0) (_size:start, double, 1.0) (_size:end, double, 1.0) (_shape, int, 0) (_stroke, java.awt.Stroke, java.awt.BasicStroke@d1a0003e) (_font, java.awt.Font, java.awt.Font[family=SansSerif,name=SansSerif,style=plain,size=10]) (_font:start, java.awt.Font, java.awt.Font[family=SansSerif,name=SansSerif,style=plain,size=10]) (_font:end, java.awt.Font, java.awt.Font[family=SansSerif,name=SansSerif,style=plain,size=10]) (_doi, double, 4.9E-324) (ID, int, -1) (score, float, 0.0) (lines, float, 0.0)]
See the image for clarity.
So now the structure of a VisualItem is clear. Besides the basic three data columns, a set of features are added in, which helps to set up the size, position, color, shape, bound, and etc. And these features can be changed when various EncodingActions are called. For example, ColorAction assigns the color of this item, which is the ROW!!!!!!! (remember? each visualitem represents a row in the table. So one row, one item, and one visual unit in a Visualization). ShapeAction assigns the shape of an item.
Each visual item has its position information, normally assigned by Layout actions, such as AxisLayout, and CircleLayout.
Eventually various Renderers will paint a visual item based on its features that stored in its corresponding columns.
TMHK, Renderers will use PrefuseLib.paint(graphic g, visualitem item) method to do the painting.
In next post, I tried to explain how the Actions and Renderers work, as these two classes need to collaborate to paint a visual item in the right place, with right color and shape.

No comments:
Post a Comment