detabbing (no functional changes)
David, you might want to check your editor settings, you're mixing tabs with spaces git-svn-id: http://google-refine.googlecode.com/svn/trunk@724 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
86465c2d6f
commit
1b9cfbbf90
@ -159,13 +159,13 @@ public class GridworksServlet extends HttpServlet {
|
||||
final static protected long s_autoSavePeriod = 1000 * 60 * 5; // 5 minutes
|
||||
static protected class AutoSaveTimerTask extends TimerTask {
|
||||
public void run() {
|
||||
try {
|
||||
ProjectManager.singleton.save(false); // quick, potentially incomplete save
|
||||
} finally {
|
||||
_timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod);
|
||||
// we don't use scheduleAtFixedRate because that might result in
|
||||
// bunched up events when the computer is put in sleep mode
|
||||
}
|
||||
try {
|
||||
ProjectManager.singleton.save(false); // quick, potentially incomplete save
|
||||
} finally {
|
||||
_timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod);
|
||||
// we don't use scheduleAtFixedRate because that might result in
|
||||
// bunched up events when the computer is put in sleep mode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ public class GridworksServlet extends HttpServlet {
|
||||
|
||||
if (_timer == null) {
|
||||
_timer = new Timer("autosave");
|
||||
_timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod);
|
||||
_timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod);
|
||||
}
|
||||
|
||||
logger.trace("< initialize");
|
||||
|
@ -145,23 +145,23 @@ public class ProjectManager {
|
||||
* APPDATA value to substitute back the original user ID.
|
||||
*/
|
||||
static protected String fixWindowsUnicodePath(String path) {
|
||||
int q = path.indexOf('?');
|
||||
if (q < 0) {
|
||||
return path;
|
||||
}
|
||||
int pathSep = path.indexOf(File.separatorChar, q);
|
||||
int q = path.indexOf('?');
|
||||
if (q < 0) {
|
||||
return path;
|
||||
}
|
||||
int pathSep = path.indexOf(File.separatorChar, q);
|
||||
|
||||
String goodPath = System.getenv("APPDATA");
|
||||
if (goodPath == null || goodPath.length() == 0) {
|
||||
String goodPath = System.getenv("APPDATA");
|
||||
if (goodPath == null || goodPath.length() == 0) {
|
||||
goodPath = System.getenv("USERPROFILE");
|
||||
if (!goodPath.endsWith(File.separator)) {
|
||||
goodPath = goodPath + File.separator;
|
||||
goodPath = goodPath + File.separator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int goodPathSep = goodPath.indexOf(File.separatorChar, q);
|
||||
int goodPathSep = goodPath.indexOf(File.separatorChar, q);
|
||||
|
||||
return path.substring(0, q) + goodPath.substring(q, goodPathSep) + path.substring(pathSep);
|
||||
return path.substring(0, q) + goodPath.substring(q, goodPathSep) + path.substring(pathSep);
|
||||
}
|
||||
|
||||
private ProjectManager(File dir) {
|
||||
@ -291,13 +291,13 @@ public class ProjectManager {
|
||||
}
|
||||
|
||||
public void setBusy(boolean busy) {
|
||||
synchronized (this) {
|
||||
if (busy) {
|
||||
_busy++;
|
||||
} else {
|
||||
_busy--;
|
||||
}
|
||||
}
|
||||
synchronized (this) {
|
||||
if (busy) {
|
||||
_busy++;
|
||||
} else {
|
||||
_busy--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addLatestExpression(String s) {
|
||||
@ -315,10 +315,10 @@ public class ProjectManager {
|
||||
}
|
||||
|
||||
public void save(boolean allModified) {
|
||||
if (allModified || _busy == 0) {
|
||||
saveProjects(allModified);
|
||||
saveWorkspace();
|
||||
}
|
||||
if (allModified || _busy == 0) {
|
||||
saveProjects(allModified);
|
||||
saveWorkspace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,16 +67,16 @@ public class ScatterplotDrawingRowVisitor implements RowVisitor {
|
||||
g2.setPaint(color);
|
||||
|
||||
if (r != null) {
|
||||
/*
|
||||
* Fill in the negative quadrants to give a hint of how the plot has been rotated.
|
||||
*/
|
||||
Graphics2D g2r = (Graphics2D) g2.create();
|
||||
g2r.transform(r);
|
||||
/*
|
||||
* Fill in the negative quadrants to give a hint of how the plot has been rotated.
|
||||
*/
|
||||
Graphics2D g2r = (Graphics2D) g2.create();
|
||||
g2r.transform(r);
|
||||
|
||||
g2r.setPaint(Color.lightGray);
|
||||
g2r.fillRect(-size, 0, size, size);
|
||||
g2r.fillRect(0, -size, size, size);
|
||||
g2r.dispose();
|
||||
g2r.setPaint(Color.lightGray);
|
||||
g2r.fillRect(-size, 0, size, size);
|
||||
g2r.fillRect(0, -size, size, size);
|
||||
g2r.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ public class ScatterplotDrawingRowVisitor implements RowVisitor {
|
||||
Point2D.Double p = new Point2D.Double(xv,yv);
|
||||
|
||||
p = ScatterplotFacet.translateCoordinates(
|
||||
p, min_x, max_x, min_y, max_y, dim_x, dim_y, l, r);
|
||||
p, min_x, max_x, min_y, max_y, dim_x, dim_y, l, r);
|
||||
|
||||
g2.fill(new Rectangle2D.Double(p.x - dot / 2, p.y - dot / 2, dot, dot));
|
||||
}
|
||||
|
@ -175,8 +175,8 @@ public class ScatterplotFacet implements Facet {
|
||||
to_x = o.getDouble(TO_X);
|
||||
selected = true;
|
||||
} else {
|
||||
from_x = 0;
|
||||
to_x = 1;
|
||||
from_x = 0;
|
||||
to_x = 1;
|
||||
}
|
||||
|
||||
dim_y = (o.has(DIM_Y)) ? getAxisDim(o.getString(DIM_Y)) : LIN;
|
||||
@ -185,8 +185,8 @@ public class ScatterplotFacet implements Facet {
|
||||
to_y = o.getDouble(TO_Y);
|
||||
selected = true;
|
||||
} else {
|
||||
from_y = 0;
|
||||
to_y = 1;
|
||||
from_y = 0;
|
||||
to_y = 1;
|
||||
}
|
||||
|
||||
rotation = (o.has(ROTATION)) ? getRotation(o.getString(ROTATION)) : NO_ROTATION;
|
||||
@ -251,12 +251,12 @@ public class ScatterplotFacet implements Facet {
|
||||
eval_y != null && errorMessage_y == null)
|
||||
{
|
||||
return new DualExpressionsNumberComparisonRowFilter(
|
||||
eval_x, columnName_x, columnIndex_x, eval_y, columnName_y, columnIndex_y) {
|
||||
eval_x, columnName_x, columnIndex_x, eval_y, columnName_y, columnIndex_y) {
|
||||
|
||||
double from_x_pixels = from_x * l;
|
||||
double to_x_pixels = to_x * l;
|
||||
double from_y_pixels = from_y * l;
|
||||
double to_y_pixels = to_y * l;
|
||||
double from_x_pixels = from_x * l;
|
||||
double to_x_pixels = to_x * l;
|
||||
double from_y_pixels = from_y * l;
|
||||
double to_y_pixels = to_y * l;
|
||||
|
||||
protected boolean checkValues(double x, double y) {
|
||||
Point2D.Double p = new Point2D.Double(x,y);
|
||||
@ -348,24 +348,24 @@ public class ScatterplotFacet implements Facet {
|
||||
|
||||
public static AffineTransform createRotationMatrix(int rotation, double l) {
|
||||
if (rotation == ScatterplotFacet.ROTATE_CW) {
|
||||
AffineTransform t = AffineTransform.getTranslateInstance(0, l / 2);
|
||||
t.scale(s_rotateScale, s_rotateScale);
|
||||
t.rotate(-Math.PI / 4);
|
||||
return t;
|
||||
AffineTransform t = AffineTransform.getTranslateInstance(0, l / 2);
|
||||
t.scale(s_rotateScale, s_rotateScale);
|
||||
t.rotate(-Math.PI / 4);
|
||||
return t;
|
||||
} else if (rotation == ScatterplotFacet.ROTATE_CCW) {
|
||||
AffineTransform t = AffineTransform.getTranslateInstance(l / 2, 0);
|
||||
t.scale(s_rotateScale, s_rotateScale);
|
||||
t.rotate(Math.PI / 4);
|
||||
return t;
|
||||
AffineTransform t = AffineTransform.getTranslateInstance(l / 2, 0);
|
||||
t.scale(s_rotateScale, s_rotateScale);
|
||||
t.rotate(Math.PI / 4);
|
||||
return t;
|
||||
} else {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Point2D.Double translateCoordinates(
|
||||
Point2D.Double p,
|
||||
double min_x, double max_x, double min_y, double max_y,
|
||||
int dim_x, int dim_y, double l, AffineTransform t) {
|
||||
Point2D.Double p,
|
||||
double min_x, double max_x, double min_y, double max_y,
|
||||
int dim_x, int dim_y, double l, AffineTransform t) {
|
||||
|
||||
double x = p.x;
|
||||
double y = p.y;
|
||||
@ -389,7 +389,7 @@ public class ScatterplotFacet implements Facet {
|
||||
p.x = x;
|
||||
p.y = y;
|
||||
if (t != null) {
|
||||
t.transform(p, p);
|
||||
t.transform(p, p);
|
||||
}
|
||||
|
||||
return p;
|
||||
|
@ -62,7 +62,7 @@ public class CreateProjectCommand extends Command {
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
try {
|
||||
/*
|
||||
* The uploaded file is in the POST body as a "file part". If
|
||||
@ -99,7 +99,7 @@ public class CreateProjectCommand extends Command {
|
||||
);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ImportProjectCommand extends Command {
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
try {
|
||||
Properties options = ParsingUtilities.parseUrlParameters(request);
|
||||
|
||||
@ -65,7 +65,7 @@ public class ImportProjectCommand extends Command {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ public class UploadDataCommand extends Command {
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
try {
|
||||
Project project = getProject(request);
|
||||
Engine engine = getEngine(request, project);
|
||||
@ -51,7 +51,7 @@ public class UploadDataCommand extends Command {
|
||||
} catch (Exception e) {
|
||||
respondException(response, e);
|
||||
} finally {
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class ExportRowsCommand extends Command {
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
ProjectManager.singleton.setBusy(true);
|
||||
try {
|
||||
Project project = getProject(request);
|
||||
Engine engine = getEngine(request, project);
|
||||
@ -56,7 +56,7 @@ public class ExportRowsCommand extends Command {
|
||||
} catch (Exception e) {
|
||||
respondException(response, e);
|
||||
} finally {
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
ProjectManager.singleton.setBusy(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,19 +151,19 @@ public class GetScatterplotCommand extends Command {
|
||||
size, dim_x, dim_y, rotation, dot, color
|
||||
);
|
||||
|
||||
if (base_color != null) {
|
||||
drawer.setColor(base_color);
|
||||
if (base_color != null) {
|
||||
drawer.setColor(base_color);
|
||||
|
||||
FilteredRows filteredRows = engine.getAllRows();
|
||||
filteredRows.accept(project, drawer);
|
||||
|
||||
drawer.setColor(color);
|
||||
}
|
||||
drawer.setColor(color);
|
||||
}
|
||||
|
||||
{
|
||||
FilteredRows filteredRows = engine.getAllFilteredRows(false);
|
||||
filteredRows.accept(project, drawer);
|
||||
}
|
||||
{
|
||||
FilteredRows filteredRows = engine.getAllFilteredRows(false);
|
||||
filteredRows.accept(project, drawer);
|
||||
}
|
||||
|
||||
ImageIO.write(drawer.getImage(), "png", output);
|
||||
} else {
|
||||
|
@ -28,13 +28,13 @@ public class CSVRowParser extends RowParser {
|
||||
if (quote < 0) {
|
||||
sb.append(line.substring(start));
|
||||
|
||||
start = 0;
|
||||
start = 0;
|
||||
try {
|
||||
line = lineReader.readLine();
|
||||
} catch (IOException e) {
|
||||
line = "";
|
||||
break;
|
||||
}
|
||||
line = lineReader.readLine();
|
||||
} catch (IOException e) {
|
||||
line = "";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (quote < line.length() - 1 && line.charAt(quote + 1) == '"') {
|
||||
sb.append(line.substring(start, quote + 1)); // include " as well
|
||||
|
@ -141,9 +141,9 @@ public class Recon implements HasFields, Jsonizable {
|
||||
}
|
||||
|
||||
public Object getField(String name, Properties bindings) {
|
||||
if ("id".equals(name)) {
|
||||
return id;
|
||||
} else if ("best".equals(name)) {
|
||||
if ("id".equals(name)) {
|
||||
return id;
|
||||
} else if ("best".equals(name)) {
|
||||
return candidates != null && candidates.size() > 0 ? candidates.get(0) : null;
|
||||
} else if ("candidates".equals(name)) {
|
||||
return candidates;
|
||||
|
@ -49,7 +49,7 @@ public class MassChange implements Change {
|
||||
writer.write("updateRowContextDependencies="); writer.write(Boolean.toString(_updateRowContextDependencies)); writer.write('\n');
|
||||
writer.write("changeCount="); writer.write(Integer.toString(_changes.size())); writer.write('\n');
|
||||
for (Change c : _changes) {
|
||||
History.writeOneChange(writer, c, options);
|
||||
History.writeOneChange(writer, c, options);
|
||||
}
|
||||
writer.write("/ec/\n"); // end of change marker
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Link implements Jsonizable {
|
||||
writer.key("property"); property.write(writer, options);
|
||||
if (target != null) {
|
||||
writer.key("target");
|
||||
target.write(writer, options);
|
||||
target.write(writer, options);
|
||||
}
|
||||
writer.endObject();
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class Protograph implements Jsonizable {
|
||||
node2.addLink(new Link(
|
||||
reconstructProperty(oLink.getJSONObject("property")),
|
||||
oLink.has("target") && !oLink.isNull("target") ?
|
||||
reconstructNode(oLink.getJSONObject("target")) : null
|
||||
reconstructNode(oLink.getJSONObject("target")) : null
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user