RandomSec/src/main/java/com/metaweb/gridworks/clustering/Clusterer.java
David Huynh 253874b1a1 Got Clusterer to use Column.name rather than Column.headerLabel now.
Tried using Verdana instead of Tahoma as the common font.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@220 7d457c2a-affb-35e4-300a-418c747d4874
2010-03-06 22:48:42 +00:00

30 lines
840 B
Java

package com.metaweb.gridworks.clustering;
import org.json.JSONObject;
import com.metaweb.gridworks.Jsonizable;
import com.metaweb.gridworks.browsing.Engine;
import com.metaweb.gridworks.model.Column;
import com.metaweb.gridworks.model.Project;
public abstract class Clusterer implements Jsonizable {
protected Project _project;
protected int _colindex;
protected JSONObject _config;
public abstract void computeClusters(Engine engine);
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
_project = project;
_config = o;
String colname = o.getString("column");
for (Column column : project.columnModel.columns) {
if (column.getName().equals(colname)) {
_colindex = column.getCellIndex();
}
}
}
}