[245847] reduce warnings
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.engines.lowvision/META-INF/MANIFEST.MF
index 51998d8..fab45d1 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/META-INF/MANIFEST.MF
@@ -12,5 +12,5 @@
org.eclipse.actf.model.ui
Export-Package: org.eclipse.actf.visualization.engines.lowvision,
org.eclipse.actf.visualization.engines.lowvision.image
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/LowVisionType.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/LowVisionType.java
index fedf95b..73b82d0 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/LowVisionType.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/LowVisionType.java
@@ -127,7 +127,7 @@
*/
public void setEyesightDegree(float _deg) throws LowVisionException {
if (_deg <= 0.0) {
- throw new LowVisionException("Eyesight degree must be positive.");
+ throw new LowVisionException("Eyesight degree must be positive."); //$NON-NLS-1$
}
eyesightDegree = _deg;
eyesightPixel = calcUndistinguishablePixel(eyesightDegree);
@@ -223,7 +223,7 @@
*/
public void setCVDType(int cvd_type) throws LowVisionException {
if (cvd_type != 1 && cvd_type != 2 && cvd_type != 3) {
- throw new LowVisionException("CVD type must be 1,2, or 3");
+ throw new LowVisionException("CVD type must be 1,2, or 3"); //$NON-NLS-1$
}
CVDType = cvd_type;
}
@@ -258,6 +258,7 @@
return (rgb);
}
+ @SuppressWarnings("nls")
private void setColorFilterRGB(float _r, float _g, float _b)
throws LowVisionException {
if (_r < 0.0 || 1.0 < _r)
@@ -392,6 +393,7 @@
return (dest);
}
+ @SuppressWarnings("nls")
public String toString() {
StringBuffer sb = new StringBuffer();
if (eyesight) {
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/PageEvaluation.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/PageEvaluation.java
index 7473a5a..1d2a8fc 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/PageEvaluation.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/engines/lowvision/PageEvaluation.java
@@ -60,9 +60,9 @@
private int pageHeight = UNSET;
- private String overallRatingString = "";
+ private String overallRatingString = ""; //$NON-NLS-1$
- private String overallRatingImageString = "";
+ private String overallRatingImageString = ""; //$NON-NLS-1$
/**
* Constructor of PageEvaluation utility
@@ -272,6 +272,8 @@
* target file path to save report
* @throws LowVisionException
*/
+ @SuppressWarnings("nls")
+ //TODO
public void unsupportedModeReport(File targetFile)
throws LowVisionException {
@@ -306,6 +308,8 @@
* target {@link IProblemItem} list
* @throws LowVisionException
*/
+ @SuppressWarnings("nls")
+ // TODO
public void generateReport(String _path, String _htmlName, String _imgName,
List<IProblemItem> _problemGroupArray) throws LowVisionException {
boolean doMakeProblemMap = true;
@@ -389,11 +393,11 @@
}
}
- double scaleDouble = (double) (scale * scale);
+ double scaleDouble = (scale * scale);
for (int j = 0; j < mapHeight; j++) {
for (int i = 0; i < mapWidth; i++) {
scoreMap.getData()[j][i] = DecisionMaker
- .getScoreMapColor(((double) (scoreMap.getData()[j][i]))
+ .getScoreMapColor((scoreMap.getData()[j][i])
/ 100.0 / scaleDouble);
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DebugUtil.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DebugUtil.java
index 89e0337..c4a41f8 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DebugUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DebugUtil.java
@@ -19,7 +19,7 @@
// public static String DEBUG_STRING = "style-addcss-page-post-cache-diff";
// private static final String DEBUG_STRING =
// "post-genRE-infoSet-diff-cache";
- private static final String DEBUG_STRING = "TRACE";
+ private static final String DEBUG_STRING = "TRACE"; //$NON-NLS-1$
// private static final String DEBUG_STRING =
// "TRACE_HISTOGRAM_CONTAINER_EXTRACT_PROBLEM_COMPONENT_REPORT";
@@ -55,15 +55,15 @@
public static void printMsg(Object o, String s, PrintStream ps, int level) {
if (level != 0) {
- ps.println("--------------------------------");
+ ps.println("--------------------------------"); //$NON-NLS-1$
}
if (o != null) {
- ps.println(o.getClass().getName() + ": " + s);
+ ps.println(o.getClass().getName() + ": " + s); //$NON-NLS-1$
} else {
ps.println(s);
}
if (level != 0) {
- ps.println("--------------------------------");
+ ps.println("--------------------------------"); //$NON-NLS-1$
}
ps.flush();
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DecisionMaker.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DecisionMaker.java
index df831af..3b2abe7 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DecisionMaker.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/DecisionMaker.java
@@ -35,6 +35,7 @@
* Check color combination by using threshold (in LowvisionCommon)
*
*/
+@SuppressWarnings("nls")
public class DecisionMaker {
// thresholds for char check
@@ -79,7 +80,7 @@
public static final float ENOUGH_DELTA_E_FOR_IMAGE = 40.0f;
// color combination check (text)
public static final float MIN_ENOUGH_DELTA_L_FOR_TEXT = 20.0f; // enough L
- // (L*a*b*)
+ // (L*a*b*)
public static final float MAX_ENOUGH_DELTA_L_FOR_TEXT = 40.0f; // (L*a*b*)
public static final float ENOUGH_DELTA_E_FOR_TEXT = 100.0f; // (L*a*b*)
public static final float ENOUGH_DELTA_H_FOR_TEXT = 100.0f; // (L*a*b*)
@@ -103,7 +104,7 @@
// very small
if (cWidth < DecisionMaker.THRESHOLD_MIN_CHAR_WIDTH
|| cHeight < DecisionMaker.THRESHOLD_MIN_CHAR_HEIGHT) {
- return (PageComponent.OTHER_TYPE );
+ return (PageComponent.OTHER_TYPE);
}
double density = _cc.getDensity();
@@ -114,7 +115,7 @@
throw new ImageException(
"detectLongestHorizontalLine() does not work.");
}
- double widthRatio = horSeg.getLength() / (double) cWidth;
+ double widthRatio = horSeg.getLength() / cWidth;
double position = (double) (horSeg.getLeftPoint().getY())
/ (double) cHeight;
double ratio = (double) cWidth / (double) cHeight;
@@ -122,32 +123,32 @@
&& position >= DecisionMaker.THRESHOLD_MIN_UNDERLINE_POSITION
&& ratio >= DecisionMaker.THRESHOLD_MIN_UNDERLINE_RATIO
&& density < DecisionMaker.THRESHOLD_MIN_CONTAINER_DENSITY) {
- return (PageComponent.CANDIDATE_UNDERLINED_CHARACTER_TYPE );
+ return (PageComponent.CANDIDATE_UNDERLINED_CHARACTER_TYPE);
}
// container
if ((cWidth > DecisionMaker.THRESHOLD_MAX_CHAR_WIDTH || cHeight > DecisionMaker.THRESHOLD_MAX_CHAR_HEIGHT)) {
- return (PageComponent.CONTAINER_TYPE );
+ return (PageComponent.CONTAINER_TYPE);
}
// small (might be line)
if (ratio < DecisionMaker.THRESHOLD_MIN_CHAR_RATIO
|| DecisionMaker.THRESHOLD_MAX_CHAR_RATIO < ratio) {
- return (PageComponent.OTHER_TYPE );
+ return (PageComponent.OTHER_TYPE);
}
// test
/*
* Topology topo = new Topology( _cc ); Topology thinTopo = new
- * Topology( _cc.thinning() ); int count1 = topo.getCount(); int count2 =
- * thinTopo.getCount(); int interior1 = topo.getNumInterior(); int
+ * Topology( _cc.thinning() ); int count1 = topo.getCount(); int count2
+ * = thinTopo.getCount(); int interior1 = topo.getNumInterior(); int
* interior2 = thinTopo.getNumInterior(); int edge1 =
* topo.getNumEdges(); int edge2 = thinTopo.getNumEdges(); int branch1 =
* topo.getNumBranches(); int branch2 = thinTopo.getNumBranches(); int
* cross1 = topo.getNumCrosses(); int cross2 = thinTopo.getNumCrosses();
*
- * double countDouble = (double)(topo.getCount()); double interiorRatio =
- * (double)(topo.getNumInterior())/countDouble; double edgeRatio =
+ * double countDouble = (double)(topo.getCount()); double interiorRatio
+ * = (double)(topo.getNumInterior())/countDouble; double edgeRatio =
* (double)(topo.getNumEdges())/countDouble; double branchRatio =
* (double)(topo.getNumBranches())/countDouble; double crossRatio =
* (double)(topo.getNumCrosses())/countDouble;
@@ -162,34 +163,35 @@
// thinning
ConnectedComponent thinCc = _cc.thinning();
if ((double) (thinCc.getCount()) / (double) (_cc.getCount()) < DecisionMaker.THRESHOLD_MIN_THINNING_RATIO) {
- return (PageComponent.OTHER_TYPE );
+ return (PageComponent.OTHER_TYPE);
}
Topology thinTopo = new Topology(thinCc);
if (thinTopo.getNumBranches() > DecisionMaker.THRESHOLD_MAX_THINNED_BRANCHES) {
- return (PageComponent.OTHER_TYPE );
+ return (PageComponent.OTHER_TYPE);
}
if (thinTopo.getNumCrosses() > DecisionMaker.THRESHOLD_MAX_THINNED_CROSSES) {
- return (PageComponent.OTHER_TYPE );
+ return (PageComponent.OTHER_TYPE);
}
// debug(from here)
/*
- * if( _test ){ int ccX = _cc.getLeft(); int ccY = _cc.getTop(); int ccW =
- * _cc.getWidth(); int ccH = _cc.getHeight(); DebugUtil.debugMsg( null,
- * "Judging container at (" + ccX + "," + ccY + ") [" + ccW + " x " +
- * ccH + "] : count=(" + count1 + "," + count2 + ") interior=(" +
- * interior1 + "," + interior2 + ") edge=(" + edge1 + "," + edge2 + ")
+ * if( _test ){ int ccX = _cc.getLeft(); int ccY = _cc.getTop(); int ccW
+ * = _cc.getWidth(); int ccH = _cc.getHeight(); DebugUtil.debugMsg(
+ * null, "Judging container at (" + ccX + "," + ccY + ") [" + ccW +
+ * " x " + ccH + "] : count=(" + count1 + "," + count2 + ") interior=("
+ * + interior1 + "," + interior2 + ") edge=(" + edge1 + "," + edge2 + ")
* branch=(" + branch1 + "," + branch2 + ") cross=(" + cross1 + "," +
* cross2 + ")", "COMPONENT" ); // DebugUtil.debugMsg( null, "Judging
* container at (" + ccX + "," + ccY + ") [" + ccW + " x " + ccH + "] :
- * count = " + topo.getCount() + ", interiorRatio = " + interiorRatio + ",
- * edgeRatio = " + edgeRatio + ", branchRatio = " + branchRatio + ",
- * crossRatio = " + crossRatio, "COMPONENT" ); // DebugUtil.debugMsg(
- * null, "Density = " + density, "COMPONENT" ); // debug(to here) }
+ * count = " + topo.getCount() + ", interiorRatio =
+ * " + interiorRatio + ", edgeRatio = " + edgeRatio + ", branchRatio =
+ * " + branchRatio + ", crossRatio = " + crossRatio, "COMPONENT" ); //
+ * DebugUtil.debugMsg( null, "Density = " + density, "COMPONENT" ); //
+ * debug(to here) }
*/
- return (PageComponent.CANDIDATE_CHARACTER_TYPE );
+ return (PageComponent.CANDIDATE_CHARACTER_TYPE);
} // judgeComponentType( ConnectedComponent )
// check connected component is MS character or not
@@ -210,8 +212,8 @@
/*
* do not use thinning ConnectedComponent thinCc = _cc.thinning(); //
* debug // DebugUtil.outMsg( null, "thinCc.count = " +
- * thinCc.getCount() + ", _cc.count = " + _cc.getCount() + ", Ratio = " +
- * (double)(thinCc.getCount())/(double)(_cc.getCount()) ); if(
+ * thinCc.getCount() + ", _cc.count = " + _cc.getCount() + ", Ratio = "
+ * + (double)(thinCc.getCount())/(double)(_cc.getCount()) ); if(
* (double)(thinCc.getCount())/(double)(_cc.getCount()) <
* THRESHOLD_MIN_THINNING_RATIO ){ return( false ); }
*/
@@ -282,7 +284,6 @@
*
* criteria for text/image text (bg/fg connected) <- brightness image
* (components are separated in some cases) <- chroma, hue
- *
*/
public static boolean distinguishableTextColors(ColorLAB _c1, ColorLAB _c2) {
double deltaL = ColorLAB.deltaL(_c1, _c2);
@@ -319,11 +320,11 @@
* ColorIRGB i2_ = new ColorIRGB(_c2); ColorIRGB i1_ = new
* ColorIRGB(_c1); int c1R = i1_.getR(); int c1G = i1_.getG(); int c1B =
* i1_.getB(); try{ if( _c2 == ((90<<16)+(93<<8)+90) && (c1R>c1G) &&
- * (c1R>c1B) ){ DebugUtil.outMsg( null, "C1: R = " + i1_.getR() + ", G = " +
- * i1_.getG() + ", B = " + i1_.getB() ); ColorLAB l1_ = (new
+ * (c1R>c1B) ){ DebugUtil.outMsg( null, "C1: R = " + i1_.getR() +
+ * ", G = " + i1_.getG() + ", B = " + i1_.getB() ); ColorLAB l1_ = (new
* ColorIRGB(_c1)).toXYZ().toLAB(); ColorLAB l2_ = (new
- * ColorIRGB(_c2)).toXYZ().toLAB(); DebugUtil.outMsg( null, "Delta L = " +
- * ColorLAB.deltaL(l1_,l2_) ); DebugUtil.outMsg( null, "Delta E = " +
+ * ColorIRGB(_c2)).toXYZ().toLAB(); DebugUtil.outMsg( null, "Delta L = "
+ * + ColorLAB.deltaL(l1_,l2_) ); DebugUtil.outMsg( null, "Delta E = " +
* ColorLAB.deltaE(l1_,l2_) ); } }catch( Exception e ){
* e.printStackTrace(); }
*/
@@ -354,7 +355,8 @@
return (thresholdL);
/*
* double deltaH = ColorLAB.deltaH( _c1, _c2 ); double thresholdL =
- * (MIN_ENOUGH_DELTA_L_FOR_TEXT-MAX_ENOUGH_DELTA_L_FOR_TEXT)/ENOUGH_DELTA_H_FOR_TEXT*deltaH +
+ * (MIN_ENOUGH_DELTA_L_FOR_TEXT
+ * -MAX_ENOUGH_DELTA_L_FOR_TEXT)/ENOUGH_DELTA_H_FOR_TEXTdeltaH +
* MAX_ENOUGH_DELTA_L_FOR_TEXT; if( thresholdL < 0.0 ){ thresholdL =
* 0.0; } return( thresholdL );
*/
@@ -466,8 +468,7 @@
private static Vector3D colorToVector3D(int _color) {
ColorIRGB ci = new ColorIRGB(_color);
- return (new Vector3D((double) (ci.getR()), (double) (ci.getG()),
- (double) (ci.getB())));
+ return (new Vector3D(ci.getR(), ci.getG(), ci.getB()));
}
/*
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/EdgeDetector.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/EdgeDetector.java
index 0884225..3f6be7a 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/EdgeDetector.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/EdgeDetector.java
@@ -70,7 +70,7 @@
destBufferedImage = convolve(srcBufferedImage, 3, 3,
LAPLACIAN8_3X3_PLUS);
} else {
- throw new LowVisionException("Unknown method: " + _method);
+ throw new LowVisionException("Unknown method: " + _method); //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/LowVisionProblemConverter.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/LowVisionProblemConverter.java
index cc361a1..7060e2d 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/LowVisionProblemConverter.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/LowVisionProblemConverter.java
@@ -30,12 +30,12 @@
for (int i = 0; i < target.length; i++) {
- ProblemItemLV tmp = new ProblemItemLV("L_" + target[i].getLowVisionProblemType());
+ ProblemItemLV tmp = new ProblemItemLV("L_" + target[i].getLowVisionProblemType()); //$NON-NLS-1$
tmp.setSubType(target[i].getLowVisionProblemType());
try {
tmp.setDescription(target[i].getDescription());
} catch (Exception e) {
- tmp.setDescription("unknown");
+ tmp.setDescription("unknown"); //$NON-NLS-1$
}
tmp.setCanHighlight(true);
@@ -78,9 +78,9 @@
origR = origAll >> 16 & 0xff;
origG = origAll >> 8 & 0xff;
origB = origAll & 0xff;
- return origR + "," + origG + "," + origB;
+ return origR + "," + origG + "," + origB; //$NON-NLS-1$ //$NON-NLS-2$
} else {
- return " ";
+ return " "; //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/PageElement.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/PageElement.java
index a6d3934..6490b32 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/PageElement.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/PageElement.java
@@ -40,7 +40,7 @@
public class PageElement {
// IE fontsize
- static final String IE_LARGEST_FONT = "16pt";
+ static final String IE_LARGEST_FONT = "16pt"; //$NON-NLS-1$
static final double IE_EM_SCALING = 1.33; // "1em" in largest
// (experimental)
static final double IE_LARGER_SCALING = 1.67; // "larger" in largest
@@ -59,9 +59,10 @@
public static final double SEVERITY_PROHIBITED_BOTH_COLORS = SEVERITY_PROHIBITED_FOREGROUND_COLOR
+ SEVERITY_PROHIBITED_BACKGROUND_COLOR;
- private static final String DELIM = "/";
+ private static final String DELIM = "/"; //$NON-NLS-1$
// text check
+ @SuppressWarnings("nls")
private static final String[] nonTextTagNames = { "area", "base",
"basefont", "br", "col", "colgroup", "frame", "frameset", "head",
"html", "hr", "img", "input", "isindex", "link", "meta",
@@ -69,6 +70,7 @@
"textarea", "title" };
// tags that change font size when that succeeded pt from <body>
+ @SuppressWarnings("nls")
private static final String[] fontSizeChangeTags = { "big", "code", "h1",
"h2", "h3", "h5", "h6", "kbd", "pre", "samp", "small", "sub",
"sup", "tt" };
@@ -76,6 +78,7 @@
/*
* tags that usually uses same font size (can change by using %,em,ex)
*/
+ @SuppressWarnings("nls")
private static final String[] alwaysFixedFontSizeTags = { "button",
"option", "textarea" };
@@ -132,7 +135,7 @@
backgroundColor = (new ColorCSS(bgStr)).toInt();
} catch (ColorException e) {
e.printStackTrace();
- throw new ImageException("Could not interpret colors.");
+ throw new ImageException("Could not interpret colors."); //$NON-NLS-1$
}
}
@@ -178,7 +181,7 @@
try {
cp = checkColors(_lvType);
} catch (LowVisionException e) {
- DebugUtil.errMsg(this, "Error occurred in checking colors: id = "
+ DebugUtil.errMsg(this, "Error occurred in checking colors: id = " //$NON-NLS-1$
+ this.id);
e.printStackTrace();
}
@@ -191,7 +194,7 @@
fsfp = checkFixedSizeFont(_lvType);
} catch (LowVisionException e) {
DebugUtil.errMsg(this,
- "Error occurred in checking fixed-size font: id = "
+ "Error occurred in checking fixed-size font: id = " //$NON-NLS-1$
+ this.id);
e.printStackTrace();
}
@@ -201,7 +204,7 @@
sfp = checkSmallFont(_lvType);
} catch (LowVisionException e) {
DebugUtil.errMsg(this,
- "Error occurred in checking small font: id = " + this.id);
+ "Error occurred in checking small font: id = " + this.id); //$NON-NLS-1$
e.printStackTrace();
}
@@ -260,7 +263,7 @@
int size = problemVec.size();
LowVisionProblem[] problemArray = new LowVisionProblem[size];
for (int i = 0; i < size; i++) {
- problemArray[i] = (LowVisionProblem) (problemVec.elementAt(i));
+ problemArray[i] = problemVec.elementAt(i);
}
return (problemArray);
}
@@ -281,7 +284,7 @@
bgSim = new ColorIRGB(_lvType.convertColor(backgroundColor));
} catch (LowVisionException e) {
e.printStackTrace();
- throw new LowVisionException("Could not convert colors.");
+ throw new LowVisionException("Could not convert colors."); //$NON-NLS-1$
}
W3CColorChecker w3c = new W3CColorChecker(fgSim, bgSim);
@@ -299,15 +302,14 @@
}
/*
- * fixed size font check experimental result (in IE6) (1)mm,cm,in,pt,pc,px ->
- * fixed (2)larger,smaller, xx-small to xx-large -> variable (3)em,ex,% ->
- * same with parent (if not specified in ancestor -> variable)
+ * fixed size font check experimental result (in IE6) (1)mm,cm,in,pt,pc,px
+ * -> fixed (2)larger,smaller, xx-small to xx-large -> variable (3)em,ex,%
+ * -> same with parent (if not specified in ancestor -> variable)
*
* if <BODY> uses "pt" -> consider IE added this configuration
*
* private static final Pattern regexFontSequence =
* Pattern.compile("^(([^\\/]+\\/)*([^\\/]+))$" );
- *
*/
private static final short FONT_SIZE_UNKNOWN = 0;
@@ -376,7 +378,7 @@
StringTokenizer stTag = new StringTokenizer(tagName, DELIM);
if (stTag.countTokens() != tokenCount) {
throw new LowVisionException(
- "# of tagNames and fontSizes did not match.");
+ "# of tagNames and fontSizes did not match."); //$NON-NLS-1$
}
String[] tagNameSequence = new String[tokenCount];
for (int i = tokenCount - 1; i >= 0; i--) {
@@ -404,7 +406,7 @@
String tmpFont = fontSequence[i];
String tmpTag = tagNameSequence[i];
// <TD>,<TH> -> same initialization at <BODY>
- if (tmpTag.equals("td") || tmpTag.equals("th")) {
+ if (tmpTag.equals("td") || tmpTag.equals("th")) { //$NON-NLS-1$ //$NON-NLS-2$
firstPtFlag = true;
if (curType != FONT_SIZE_PT) {
firstPtFlag = false;
@@ -461,6 +463,7 @@
}
}
+ @SuppressWarnings("nls")
private short fontSizeType(String _fontSize) {
String s = _fontSize.toLowerCase();
@@ -481,6 +484,7 @@
}
}
+ @SuppressWarnings("nls")
private String digitToFontSetting(String _fontStr)
throws LowVisionException {
@@ -576,6 +580,7 @@
/*
* note: reset at td/th is experimental behaviour in IE6
*/
+ @SuppressWarnings("nls")
private SmallFontProblem checkSmallFont(LowVisionType _lvType)
throws LowVisionException {
if (!(_lvType.doBlur())) {
@@ -626,7 +631,7 @@
int numFontSizeSettings = fontSequence.size();
String[] fontSizeSettings = new String[numFontSizeSettings];
for (int i = 0; i < numFontSizeSettings; i++) {
- String tmpSetting = (String) (fontSequence.elementAt(i));
+ String tmpSetting = fontSequence.elementAt(i);
fontSizeSettings[i] = digitToFontSetting(tmpSetting);
}
fontSequence = null;
@@ -636,7 +641,6 @@
*
* define LARGEST as default to check the small size font in the LARGEST
* setting
- *
*/
String curFontSize = fontSizeSettings[numFontSizeSettings - 1];
if (fontSizeType(curFontSize) == FONT_SIZE_PT) {
@@ -760,7 +764,7 @@
}
// TODO check link color?
- if (tagName.startsWith("a/")) {
+ if (tagName.startsWith("a/")) { //$NON-NLS-1$
return (null);
}
@@ -778,8 +782,8 @@
} catch (ColorException ce) {
ce.printStackTrace();
throw new LowVisionException(
- "ColorException occurs while converting String \""
- + curColorString + "\" to a color.");
+ "ColorException occurs while converting String \"" //$NON-NLS-1$
+ + curColorString + "\" to a color."); //$NON-NLS-1$
}
if (templateColor.equals(foregroundColor)) {
return (null);
@@ -823,8 +827,8 @@
} catch (ColorException ce) {
ce.printStackTrace();
throw new LowVisionException(
- "ColorException occurs while converting String \""
- + curColorString + "\" to a color.");
+ "ColorException occurs while converting String \"" //$NON-NLS-1$
+ + curColorString + "\" to a color."); //$NON-NLS-1$
}
if (templateColor.equals(backgroundColor)) {
return (null);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterMS.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterMS.java
index abc48ef..b2db3ce 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterMS.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterMS.java
@@ -89,7 +89,7 @@
return (getInt2D());
}
if (_margin < 0) {
- throw new ImageException("The margin must be non-negative.");
+ throw new ImageException("The margin must be non-negative."); //$NON-NLS-1$
}
Int2D i2d = new Int2D(cc.getShape().getWidth() + 2 * _margin, cc.getShape().getHeight() + 2
* _margin);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterSM.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterSM.java
index 1407d0c..360bd78 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterSM.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/character/CharacterSM.java
@@ -99,7 +99,7 @@
return (getInt2D());
}
if (_margin < 0) {
- throw new ImageException("The margin must be non-negative.");
+ throw new ImageException("The margin must be non-negative."); //$NON-NLS-1$
}
int w = cc.getShape().getWidth();
int h = cc.getShape().getHeight();
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/CharacterChecker.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/CharacterChecker.java
index 2dc78b8..3603ac3 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/CharacterChecker.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/CharacterChecker.java
@@ -190,7 +190,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while simulating an MSCharacter.");
+ "Error occurred while simulating an MSCharacter."); //$NON-NLS-1$
}
/*
@@ -209,7 +209,7 @@
continue;
} else {
Integer pixelInt = new Integer(pixel);
- Boolean answerBool = (Boolean) (answerMap.get(pixelInt));
+ Boolean answerBool = answerMap.get(pixelInt);
if (answerBool == null) {
if (DecisionMaker.distinguishableTextColors(pixel,
_bg)) {
@@ -229,7 +229,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while making binary image.");
+ "Error occurred while making binary image."); //$NON-NLS-1$
}
int ccLeft = _msc.cc.getLeft() - margin;
if (ccLeft < 0)
@@ -282,7 +282,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while simulating an SMCharacter.");
+ "Error occurred while simulating an SMCharacter."); //$NON-NLS-1$
}
/*
@@ -302,7 +302,7 @@
continue;
} else {
Integer pixelInt = new Integer(pixel);
- Boolean answerBool = (Boolean) (answerMap.get(pixelInt));
+ Boolean answerBool = (answerMap.get(pixelInt));
if (answerBool == null) {
if (!(DecisionMaker.distinguishableTextColors(
pixel, _fg))) {
@@ -322,7 +322,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while making binary image.");
+ "Error occurred while making binary image."); //$NON-NLS-1$
}
int ccLeft = _smc.cc.getLeft() - margin;
if (ccLeft < 0)
@@ -370,7 +370,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while simulating an SSCharacter.");
+ "Error occurred while simulating an SSCharacter."); //$NON-NLS-1$
}
/*
@@ -389,7 +389,7 @@
continue;
} else {
Integer pixelInt = new Integer(pixel);
- Boolean answerBool = (Boolean) (answerMap.get(pixelInt));
+ Boolean answerBool = (answerMap.get(pixelInt));
if (answerBool == null) {
if (DecisionMaker.distinguishableTextColors(pixel,
_bg)) {
@@ -407,7 +407,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Error occurred while making binary image.");
+ "Error occurred while making binary image."); //$NON-NLS-1$
}
int ccLeft = _ssc.cc.getLeft() - margin;
if (ccLeft < 0)
@@ -484,7 +484,7 @@
if (data[j][i] == 0) {
int simBg = _lvType.convertColor(im[j][i]);
Integer bgInt = new Integer(simBg);
- Boolean bgBool = (Boolean) (map.get(bgInt));
+ Boolean bgBool = (map.get(bgInt));
if (bgBool == null) { // first time
if (!(DecisionMaker.distinguishableTextColors(
simFgColor, simBg))) {
@@ -539,7 +539,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "An error occurred while checking colors of an SSCharacter.");
+ "An error occurred while checking colors of an SSCharacter."); //$NON-NLS-1$
}
}
@@ -596,7 +596,7 @@
} catch (LowVisionProblemException lvpe) {
// lvpe.printStackTrace();
throw new ImageException(
- "Error occurred while making problem group.");
+ "Error occurred while making problem group."); //$NON-NLS-1$
}
}
@@ -613,7 +613,7 @@
}
int groupSize = groupVector.size();
if (groupSize <= 0) {
- throw new ImageException("No instance belongs to the group. id = "
+ throw new ImageException("No instance belongs to the group. id = " //$NON-NLS-1$
+ _id);
}
LowVisionProblemGroup pg = null;
@@ -622,7 +622,7 @@
} catch (LowVisionProblemException lvpe) {
// lvpe.printStackTrace();
throw new ImageException(
- "LowVisionProblemGroup cannot be constracted.");
+ "LowVisionProblemGroup cannot be constracted."); //$NON-NLS-1$
}
_resultVec.addElement(pg);
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/W3CColorChecker.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/W3CColorChecker.java
index 297efa3..c233e57 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/W3CColorChecker.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/checker/W3CColorChecker.java
@@ -95,7 +95,7 @@
}
private static double calcY(int _r, int _g, int _b) {
- return ((double) (_r * 299 + _g * 587 + _b * 114) / 1000.0);
+ return ( (_r * 299 + _g * 587 + _b * 114) / 1000.0);
}
private static double calcSevY(double _diffY) {
@@ -113,7 +113,7 @@
private static double calcSevC(int _diffC) {
double sevC = 0.0;
if (_diffC < THRESHOLD_C) {
- sevC = -(double) _diffC / (double) THRESHOLD_C + 1.0;
+ sevC = -(double) _diffC / THRESHOLD_C + 1.0;
}
if (sevC < 0.0)
sevC = 0.0;
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorCSS.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorCSS.java
index 39b76d6..bd9caef 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorCSS.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorCSS.java
@@ -24,6 +24,7 @@
* rgb(R%,G%,B%)
* pre-defined colors(16) (see ColorUtil.java)
*/
+@SuppressWarnings("nls")
public class ColorCSS extends ColorIRGB{
private static final String DELIM = "/";
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorIRGB.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorIRGB.java
index 53dc07c..287a434 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorIRGB.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorIRGB.java
@@ -16,6 +16,7 @@
import java.util.regex.Pattern;
// sRGB [0,255]
+@SuppressWarnings("nls")
public class ColorIRGB {
int R;
@@ -245,8 +246,7 @@
}
public ColorSRGB toSRGB(boolean _check) throws ColorException {
- ColorSRGB s = new ColorSRGB((float) R / 255.0f, (float) G / 255.0f,
- (float) B / 255.0f, _check);
+ ColorSRGB s = new ColorSRGB(R / 255.0f, G / 255.0f, B / 255.0f, _check);
// s.setR( (float)R/255.0f, _check );
// s.setG( (float)G/255.0f, _check );
// s.setB( (float)B/255.0f, _check );
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorLAB.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorLAB.java
index ef30ae7..c627ce1 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorLAB.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorLAB.java
@@ -56,7 +56,7 @@
public void setL(float _l) throws ColorException {
if (_l < 0.0f || 100.0f < _l) {
- throw new ColorException("L is out of range: " + _l);
+ throw new ColorException("L is out of range: " + _l); //$NON-NLS-1$
}
L = _l;
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorSRGB.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorSRGB.java
index 07a489b..b0f71fc 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorSRGB.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorSRGB.java
@@ -47,12 +47,12 @@
public void setR(float _r, boolean _check) throws ColorException {
if (_r < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
rgb[0] = 0.0f;
} else if (1.0f < _r) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
rgb[0] = 1.0f;
} else
@@ -64,12 +64,12 @@
public void setG(float _g, boolean _check) throws ColorException {
if (_g < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
rgb[1] = 0.0f;
} else if (1.0f < _g) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
rgb[1] = 1.0f;
} else
@@ -81,12 +81,12 @@
public void setB(float _b, boolean _check) throws ColorException {
if (_b < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
rgb[2] = 0.0f;
} else if (1.0f < _b) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
rgb[2] = 1.0f;
} else
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorUtil.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorUtil.java
index 5abddca..e3ef942 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorUtil.java
@@ -16,6 +16,7 @@
public class ColorUtil {
// pre-defined 16 colors (HTML4.0, XHTML1.0, CSS2)
+ @SuppressWarnings("nls")
private static final String predefinedColors[] = {
"black", "#000000", "silver", "#c0c0c0",
"gray", "#808080", "grey", "#808080", "white", "#ffffff",
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorXYZ.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorXYZ.java
index 554bc89..4706e5f 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorXYZ.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorXYZ.java
@@ -64,12 +64,12 @@
public void setX(float _x, boolean _check) throws ColorException {
if (_x < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
xyz[0] = 0.0f;
} else if (1.0f < _x) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
xyz[0] = 1.0f;
} else
@@ -83,12 +83,12 @@
public void setY(float _y, boolean _check) throws ColorException {
if (_y < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
xyz[1] = 0.0f;
} else if (1.0f < _y) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
xyz[1] = 1.0f;
} else
@@ -102,12 +102,12 @@
public void setZ(float _z, boolean _check) throws ColorException {
if (_z < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
xyz[2] = 0.0f;
} else if (1.0f < _z) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
xyz[2] = 1.0f;
} else
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYIQ.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYIQ.java
index 1a8d543..479c6d7 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYIQ.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYIQ.java
@@ -42,13 +42,13 @@
private void rangeCheck() throws ColorException {
if (Y < 0.0f || 1.0f < Y) {
- throw new ColorException("Y is out of range: " + Y);
+ throw new ColorException("Y is out of range: " + Y); //$NON-NLS-1$
}
if (I < 0.0f || 1.0f < I) {
- throw new ColorException("I is out of range: " + I);
+ throw new ColorException("I is out of range: " + I); //$NON-NLS-1$
}
if (Q < 0.0f || 1.0f < Q) {
- throw new ColorException("Q is out of range: " + Q);
+ throw new ColorException("Q is out of range: " + Q); //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYXY.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYXY.java
index e6b5a41..a3c4f73 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYXY.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/color/ColorYXY.java
@@ -53,12 +53,12 @@
public void setYY(float _yy, boolean _check) throws ColorException {
if (_yy < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
YY = 0.0f;
} else if (1.0f < _yy) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
YY = 1.0f;
} else
@@ -72,12 +72,12 @@
public void setX(float _x, boolean _check) throws ColorException {
if (_x < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
x = 0.0f;
} else if (1.0f < _x) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
x = 1.0f;
} else
@@ -91,12 +91,12 @@
public void setY(float _y, boolean _check) throws ColorException {
if (_y < 0.0f) {
if (_check)
- throw new ColorException("Smaller than minimum.");
+ throw new ColorException("Smaller than minimum."); //$NON-NLS-1$
else
y = 0.0f;
} else if (1.0f < _y) {
if (_check)
- throw new ColorException("Larger than maximum.");
+ throw new ColorException("Larger than maximum."); //$NON-NLS-1$
else
y = 1.0f;
} else
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/BinaryImage.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/BinaryImage.java
index 5d84e39..380629f 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/BinaryImage.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/BinaryImage.java
@@ -194,6 +194,7 @@
*
* protrusion -strict -> error -not strict -> clip
*/
+ @SuppressWarnings("nls")
public BinaryImage offsetCopy(int _newWidth, int _newHeight, int _offsetX,
int _offsetY, boolean _strict) throws ImageException {
BinaryImage bi = new BinaryImage(_newWidth, _newHeight);
@@ -335,7 +336,7 @@
if (size > 0) {
Coord[] coArray = new Coord[size];
for (int i = 0; i < size; i++) {
- coArray[i] = (Coord) (tmpVec.elementAt(i));
+ coArray[i] = tmpVec.elementAt(i);
}
return (coArray);
} else {
@@ -369,7 +370,7 @@
int height = _bi1.height;
if (width != _bi2.width || height != _bi2.height) {
throw new ImageException(
- "subtract(): Sizes of the two image must be the same");
+ "subtract(): Sizes of the two image must be the same"); //$NON-NLS-1$
}
BinaryImage newImage = new BinaryImage(width, height);
@@ -448,7 +449,7 @@
return (null);
if (horSeg.isVertical() || horSeg.isDiagonal())
throw new ImageException(
- "Endpoints cannot be successfully detected");
+ "Endpoints cannot be successfully detected"); //$NON-NLS-1$
BinaryImage bi = new BinaryImage(width, height);
Coord left = horSeg.getLeftPoint();
Coord right = horSeg.getRightPoint();
@@ -466,7 +467,7 @@
return (null);
if (horSeg.isVertical() || horSeg.isDiagonal())
throw new ImageException(
- "Endpoints cannot be successfully detected");
+ "Endpoints cannot be successfully detected"); //$NON-NLS-1$
BinaryImage bi = new BinaryImage(width, height);
Coord left = horSeg.getLeftPoint();
Coord right = horSeg.getRightPoint();
@@ -483,7 +484,7 @@
}
if (horSeg2.isVertical() || horSeg2.isDiagonal())
throw new ImageException(
- "Endpoints cannot be successfully detected");
+ "Endpoints cannot be successfully detected"); //$NON-NLS-1$
Coord left2 = horSeg.getLeftPoint();
Coord right2 = horSeg.getRightPoint();
if ((left2.y == maxHeight) && (left2.x == curX0)
@@ -509,6 +510,7 @@
dump(pw);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping a BinaryImage");
@@ -532,6 +534,7 @@
dump(pw, _left, _top, _width, _height);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw, int _left, int _top, int _width,
int _height) {
_pw.println("-------------------------------");
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ColorHistogram.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ColorHistogram.java
index df87724..2923345 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ColorHistogram.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ColorHistogram.java
@@ -17,8 +17,6 @@
import java.util.Comparator;
import java.util.HashMap;
-
-
public class ColorHistogram {
private HashMap<Integer, ColorHistogramBin> pixelMap = new HashMap<Integer, ColorHistogramBin>();
@@ -42,8 +40,7 @@
public void put(int _color) {
changedFlag = true;
Integer curPixel = new Integer(_color);
- ColorHistogramBin curHistBin = (ColorHistogramBin) (pixelMap
- .get(curPixel));
+ ColorHistogramBin curHistBin = pixelMap.get(curPixel);
if (curHistBin != null) {
curHistBin.occurrence++;
} else {
@@ -66,19 +63,18 @@
sortedArrayByOccurrence = new ColorHistogramBin[len];
for (int i = 0; i < len; i++) {
- sortedArrayByOccurrence[i] = (ColorHistogramBin) (pixelMap
- .get(keyArray[i]));
+ sortedArrayByOccurrence[i] = pixelMap.get(keyArray[i]);
}
Arrays.sort(sortedArrayByOccurrence, new ComparatorByOccurrence());
}
- public class ComparatorByOccurrence implements Comparator<ColorHistogramBin> {
+ public class ComparatorByOccurrence implements
+ Comparator<ColorHistogramBin> {
public int compare(ColorHistogramBin o1, ColorHistogramBin o2) {
- return(o2.occurrence-o1.occurrence);
+ return (o2.occurrence - o1.occurrence);
}
}
-
public static ColorHistogram makeColorHistogram(int[][] _pixel, int _width,
int _height) {
ColorHistogram histo = new ColorHistogram();
@@ -92,7 +88,8 @@
}
public static ColorHistogram makeColorHistogram(IInt2D _i2d) {
- return (makeColorHistogram(_i2d.getData(), _i2d.getWidth(), _i2d.getHeight()));
+ return (makeColorHistogram(_i2d.getData(), _i2d.getWidth(), _i2d
+ .getHeight()));
}
public void dump(PrintStream _ps) {
@@ -100,6 +97,7 @@
dump(pw);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw) {
if (changedFlag)
makeSortedArrayByOccurrence();
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ConnectedComponent.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ConnectedComponent.java
index 0d3c876..903feea 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ConnectedComponent.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ConnectedComponent.java
@@ -152,7 +152,7 @@
}
public double getDensity() {
- return ((double) count / ((double) (shape.width) * (double) (shape.height)));
+ return (count / ((double) (shape.width) * (double) (shape.height)));
}
// adjust shape size (for removal of underline of link, etc.)
@@ -167,7 +167,7 @@
public ConnectedComponent calcContour() throws ImageException {
if (connectivity == CONNECTIVITY_UNSET) {
throw new ImageException(
- "Information on connectivity is needed to calculate genus");
+ "Information on connectivity is needed to calculate genus"); //$NON-NLS-1$
}
int width = shape.width;
@@ -214,7 +214,7 @@
}
}
} else {
- throw new ImageException("Unknown connectivity");
+ throw new ImageException("Unknown connectivity"); //$NON-NLS-1$
}
ConnectedComponent cc = new ConnectedComponent(left, top, bi,
@@ -231,7 +231,7 @@
return (thinningHilditch());
} else {
// TBD
- throw new ImageException("Unknown thinning method: " + _method);
+ throw new ImageException("Unknown thinning method: " + _method); //$NON-NLS-1$
}
}
@@ -348,7 +348,7 @@
int numVertex = vertexVector.size();
Coord[] vertexArray = new Coord[numVertex];
for (int i = 0; i < numVertex; i++) {
- vertexArray[i] = (Coord) (vertexVector.elementAt(i));
+ vertexArray[i] = vertexVector.elementAt(i);
}
// // debug(from here)
@@ -367,11 +367,11 @@
private Coord nextConvexHullVertex(Coord[] _all, Coord _origin,
Coord _vector) throws ImageException {
if (_all == null) {
- throw new ImageException("Empty vertex set.");
+ throw new ImageException("Empty vertex set."); //$NON-NLS-1$
}
int len = _all.length;
if (len == 0) {
- throw new ImageException("No vertex");
+ throw new ImageException("No vertex"); //$NON-NLS-1$
}
Coord answer = new Coord(-1, -1);
@@ -413,7 +413,7 @@
public int calcGenus() throws ImageException {
if (connectivity == CONNECTIVITY_UNSET) {
throw new ImageException(
- "Information on connectivity is needed to calculate genus");
+ "Information on connectivity is needed to calculate genus"); //$NON-NLS-1$
}
int width = shape.width;
@@ -496,7 +496,7 @@
e++;
return (v - e - d + t - f);
} else {
- throw new ImageException("Unknown connectivity");
+ throw new ImageException("Unknown connectivity"); //$NON-NLS-1$
}
}
@@ -505,6 +505,7 @@
dump(pw);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping a ConnectedComponent");
@@ -529,6 +530,7 @@
dump(pw, _left, _top, _width, _height);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw, int _left, int _top, int _width,
int _height) {
_pw.println("-------------------------------");
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Coord.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Coord.java
index 287e6ec..6ecfc9c 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Coord.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Coord.java
@@ -96,11 +96,11 @@
}
public static double distance(Coord _a, Coord _b) {
- return (Math.sqrt((double) distancePow2(_a, _b)));
+ return (Math.sqrt(distancePow2(_a, _b)));
}
public static double distance(Coord _a) {
- return (Math.sqrt((double) distancePow2(_a)));
+ return (Math.sqrt(distancePow2(_a)));
}
public static boolean isOnLine(Coord _start, Coord _end, Coord _point) {
@@ -136,9 +136,9 @@
public static double cosine(Coord _a, Coord _b) throws ImageException {
if (_a.isOrigin() || _b.isOrigin()) {
- throw new ImageException("Cannot calculate cosine of zero-vectors");
+ throw new ImageException("Cannot calculate cosine of zero-vectors"); //$NON-NLS-1$
}
- return ((double) innerProduct(_a, _b) / (distance(_a) * distance(_b)));
+ return (innerProduct(_a, _b) / (distance(_a) * distance(_b)));
}
public static int outerProduct(Coord _a, Coord _b) {
@@ -154,6 +154,7 @@
dump(pw);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping a point");
@@ -166,6 +167,7 @@
dump(pw, _points);
}
+ @SuppressWarnings("nls")
public static void dump(PrintWriter _pw, Coord[] _points) {
int numPoints = _points.length;
_pw.println("-------------------------------");
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ImageUtil.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ImageUtil.java
index 1e44c88..98c92a9 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ImageUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/ImageUtil.java
@@ -22,7 +22,7 @@
public static Int2D bufferedImageToInt2D(BufferedImage _bi)
throws ImageException {
if (_bi == null) {
- throw new ImageException("Input BufferedImage is null.");
+ throw new ImageException("Input BufferedImage is null."); //$NON-NLS-1$
}
int width = _bi.getWidth();
int height = _bi.getHeight();
@@ -95,6 +95,7 @@
dumpInt2DArray(pw, _data, _width, _height);
}
+ @SuppressWarnings("nls")
public static void dumpInt2DArray(PrintWriter _pw, int[][] _data,
int _width, int _height) {
_pw.println("-------");
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Int2D.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Int2D.java
index 3a71a22..cc9d8fb 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Int2D.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Int2D.java
@@ -40,7 +40,7 @@
public Int2D(int _w, int _h, int[][] _array) throws ImageException {
this(_w, _h);
if (_array.length < _h || _array[0].length < _w) {
- throw new ImageException("Out of range");
+ throw new ImageException("Out of range"); //$NON-NLS-1$
}
for (int j = 0; j < getHeight(); j++) {
for (int i = 0; i < getWidth(); i++) {
@@ -138,7 +138,7 @@
*/
public Int2D cutMargin(int _m) throws ImageException {
if (getWidth() <= 2 * _m || getHeight() <= 2 * _m) {
- throw new ImageException("The margin is too wide.");
+ throw new ImageException("The margin is too wide."); //$NON-NLS-1$
}
int newW = getWidth() - 2 * _m;
int newH = getHeight() - 2 * _m;
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImage.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImage.java
index 703a6c6..c3c3a7a 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImage.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImage.java
@@ -118,6 +118,7 @@
return (pixel.getHeight());
}
+ @SuppressWarnings("nls")
public String dumpLargeComponents() {
if (numLargeComponents == 0) {
return ("There are no large components.");
@@ -187,8 +188,7 @@
if (numLargeComponents > 0) {
largeComponents = new InteriorImageComponent[numLargeComponents];
for (int k = 0; k < numLargeComponents; k++) {
- largeComponents[k] = (InteriorImageComponent) (largeComponentVector
- .elementAt(k));
+ largeComponents[k] = largeComponentVector.elementAt(k);
}
largeComponentVector.removeAllElements();
}
@@ -251,7 +251,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "Exception occurred while checking colors.");
+ "Exception occurred while checking colors."); //$NON-NLS-1$
}
// (A) assume ImageProblem only
@@ -263,7 +263,7 @@
} catch (LowVisionProblemException lvpe) {
// lvpe.printStackTrace();
throw new ImageException(
- "Error occurred while making an instance of LowVisionProblemGroup.");
+ "Error occurred while making an instance of LowVisionProblemGroup."); //$NON-NLS-1$
}
LowVisionProblemGroup[] groupArray = new LowVisionProblemGroup[1];
groupArray[0] = group;
@@ -321,11 +321,11 @@
} catch (LowVisionProblemException lvpe) {
// lvpe.printStackTrace();
throw new ImageException(
- "Error occurred while making an instance of LowVisionProblemGroup.");
+ "Error occurred while making an instance of LowVisionProblemGroup."); //$NON-NLS-1$
}
- if (curGroup != null) {
- answerVec.addElement(curGroup);
- }
+ // if (curGroup != null) {
+ answerVec.addElement(curGroup);
+ // }
curSize = _vec.size();
}
return (answerVec);
@@ -353,7 +353,7 @@
} catch (LowVisionException lve) {
// lve.printStackTrace();
throw new ImageException(
- "Exception occurred while simulating an interiorImage");
+ "Exception occurred while simulating an interiorImage"); //$NON-NLS-1$
}
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImageComponent.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImageComponent.java
index 0c07de3..0433c0b 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImageComponent.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/InteriorImageComponent.java
@@ -36,7 +36,7 @@
if (numConnectedComponents > 0) {
connectedComponents = new ConnectedComponent[numConnectedComponents];
for (int k = 0; k < numConnectedComponents; k++) {
- ConnectedComponent cc = (ConnectedComponent) (_vec.elementAt(k));
+ ConnectedComponent cc = _vec.elementAt(k);
count += cc.getCount();
connectedComponents[k] = cc;
}
@@ -64,8 +64,8 @@
public ConnectedComponent getConnectedComponent(int _index)
throws ImageException {
if (_index < 0 || numConnectedComponents <= _index) {
- throw new ImageException("Out of range: specified index = "
- + _index + ", while #ConnectedComponent = "
+ throw new ImageException("Out of range: specified index = " //$NON-NLS-1$
+ + _index + ", while #ConnectedComponent = " //$NON-NLS-1$
+ numConnectedComponents);
}
return (connectedComponents[_index]);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LabeledImage.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LabeledImage.java
index f57d0a8..34e5e7f 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LabeledImage.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LabeledImage.java
@@ -100,7 +100,7 @@
else if (method == METHOD_4_CONNECTIVITY)
conn = ConnectedComponent.CONNECTIVITY_4;
for (int i = 0; i < numComponents; i++) {
- components[i] = (ConnectedComponent) (ccVector.elementAt(i));
+ components[i] = ccVector.elementAt(i);
components[i].connectivity = conn;
}
}
@@ -120,7 +120,7 @@
labelingStack.push(startCoord);
while (!labelingStack.empty()) {
- Coord co = (Coord) (labelingStack.pop());
+ Coord co = labelingStack.pop();
int i = co.x;
int j = co.y;
@@ -256,7 +256,7 @@
*/
public BufferedImage toBufferedImage() throws ImageException {
if ((numComponents >> 24) != 0) {
- throw new ImageException("Too many labels to make bufferedImage.");
+ throw new ImageException("Too many labels to make bufferedImage."); //$NON-NLS-1$
}
BufferedImage destImage = new BufferedImage(width, height,
@@ -295,6 +295,7 @@
dumpLabel(pw);
}
+ @SuppressWarnings("nls")
public void dumpLabel(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping a labeledImage");
@@ -317,6 +318,7 @@
dumpComponents(pw);
}
+ @SuppressWarnings("nls")
public void dumpComponents(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping components");
@@ -332,6 +334,7 @@
dumpComponents(pw, _i);
}
+ @SuppressWarnings("nls")
public void dumpComponents(PrintWriter _pw, int _i) {
_pw.println("-----");
_pw.println("Components # = " + _i);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LineSegment.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LineSegment.java
index 86490c6..e8afde8 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LineSegment.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/LineSegment.java
@@ -111,13 +111,13 @@
int xDiff = x1-x0+1;
int yDiff = y1-y0+1;
if( x0 == x1 ){
- return( (double)(Math.abs(yDiff)) );
+ return( (Math.abs(yDiff)) );
}
else if( y0 == y1 ){
- return( (double)(Math.abs(xDiff)) );
+ return( (Math.abs(xDiff)) );
}
else{
- return( Math.sqrt((double)(xDiff*xDiff + yDiff*yDiff)) );
+ return( Math.sqrt((xDiff*xDiff + yDiff*yDiff)) );
}
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImage.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImage.java
index dfb900d..1bc926e 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImage.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImage.java
@@ -40,6 +40,7 @@
*
*/
public class PageImage implements IPageImage {
+ private static final String NULL_STRING = ""; //$NON-NLS-1$
public static final boolean DO_CHECK_CHARACTERS = false;
public static final boolean DO_CHECK_IMAGES = true;
@@ -281,7 +282,7 @@
if (size > 0) {
interiorImageArray = new InteriorImage[size];
for (int k = 0; k < size; k++) {
- interiorImageArray[k] = (InteriorImage) (imageVector
+ interiorImageArray[k] = (imageVector
.elementAt(k));
}
}
@@ -358,7 +359,7 @@
} else if (type == PageComponent.OTHER_TYPE) {
;
} else {
- throw new ImageException("Unexpected type = " + type);
+ throw new ImageException("Unexpected type = " + type); //$NON-NLS-1$
}
}
}
@@ -373,7 +374,7 @@
*/
int numCandChar = candidateCharacterVector.size();
for (int k = numCandChar - 1; k >= 0; k--) {
- CandidateCharacter cChar = (CandidateCharacter) (candidateCharacterVector
+ CandidateCharacter cChar = (candidateCharacterVector
.elementAt(k));
int w = cChar.cc.shape.width;
int i = 0;
@@ -429,7 +430,7 @@
this.numNonContainedCharacters = tmpSMCharacterVector.size();
this.nonContainedCharacters = new CharacterSM[numNonContainedCharacters];
for (int k = 0; k < numNonContainedCharacters; k++) {
- nonContainedCharacters[k] = (CharacterSM) (tmpSMCharacterVector
+ nonContainedCharacters[k] = (tmpSMCharacterVector
.elementAt(k));
}
tmpSMCharacterVector.removeAllElements();
@@ -476,7 +477,7 @@
} catch (Exception e) {
// e.printStackTrace();
throw new ImageException(
- "An error occurred while making contBin.");
+ "An error occurred while making contBin."); //$NON-NLS-1$
}
if (containerMap[j + contY][i + contX] == k + 1) {
@@ -574,7 +575,7 @@
*/
int msVecSize = curCont.msCharacterVector.size();
for (int l = msVecSize - 1; l >= 0; l--) {
- CharacterMS curMS = (CharacterMS) (curCont.msCharacterVector
+ CharacterMS curMS = (curCont.msCharacterVector
.elementAt(l));
if (DecisionMaker.isTooSmallThinedMSCharacter(curMS)) {
curCont.msCharacterVector.removeElementAt(l);
@@ -587,7 +588,7 @@
int tmptmpVecSize = tmpVec.size();
for (int l = tmptmpVecSize - 1; l >= 0; l--) {
- CharacterSM tmpSM = (CharacterSM) (tmpVec.elementAt(l));
+ CharacterSM tmpSM = (tmpVec.elementAt(l));
if (!(DecisionMaker.isSMCharacter(tmpSM))) {
tmpVec.removeElementAt(l);
}
@@ -596,7 +597,7 @@
curCont.numSMCharacters = tmpVec.size();
curCont.smCharacters = new CharacterSM[curCont.numSMCharacters];
for (int l = 0; l < curCont.numSMCharacters; l++) {
- curCont.smCharacters[l] = (CharacterSM) (tmpVec.elementAt(l));
+ curCont.smCharacters[l] = (tmpVec.elementAt(l));
}
tmpVec.removeAllElements();
tmpVec = null;
@@ -645,8 +646,9 @@
}
}
+ @SuppressWarnings("nls")
private void fillOneContainer(int _id) throws ImageException {
- Container curCont = (Container) (containerVector.elementAt(_id - 1));
+ Container curCont = (containerVector.elementAt(_id - 1));
int curX0 = curCont.cc.left;
int curY0 = curCont.cc.top;
int curX1 = curX0 + curCont.cc.shape.width;
@@ -711,14 +713,14 @@
DebugUtil.outMsg(this, "i = " + i + ", j = " + j);
DebugUtil.outMsg(this, "Dumping containerMap");
for (int k = 0; k < pixel.getWidth(); k++) {
- System.err.print("" + containerMap[j][k]);
+ System.err.print(NULL_STRING + containerMap[j][k]);
}
- System.err.println("");
+ System.err.println(NULL_STRING);
DebugUtil.outMsg(this, "Dumping workMap");
for (int k = 0; k < pixel.getWidth(); k++) {
- System.err.print("" + workMap[j][k]);
+ System.err.print(NULL_STRING + workMap[j][k]);
}
- System.err.println("");
+ System.err.println(NULL_STRING);
throw new ImageException("filling error 0: id = " + _id);
}
containerMap[j][i] = _id;
@@ -843,7 +845,7 @@
// target SM Char is contained within MS Char in the Container?
private CharacterMS includingMSCharacter(CharacterSM _smc, Container _cont) {
for (int k = 0; k < _cont.msCharacterVector.size(); k++) {
- CharacterMS curMS = (CharacterMS) (_cont.msCharacterVector
+ CharacterMS curMS = (_cont.msCharacterVector
.elementAt(k));
if (_smc.cc.isIncludedBy(curMS.cc)) {
return (curMS);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImageDebugUtil.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImageDebugUtil.java
index faeac2b..262d542 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImageDebugUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/PageImageDebugUtil.java
@@ -17,8 +17,8 @@
public class PageImageDebugUtil {
private PageImage pageImage;
-
- PageImageDebugUtil(PageImage pageImage){
+
+ PageImageDebugUtil(PageImage pageImage) {
this.pageImage = pageImage;
}
@@ -40,11 +40,11 @@
public int[][] paintContainers(int[][] _image, int _color) {
if (pageImage.numContainers == 0) {
- DebugUtil.errMsg(this, "There are no containers.");
+ DebugUtil.errMsg(this, "There are no containers."); //$NON-NLS-1$
return (null);
}
- DebugUtil.debugMsg(null, "# of containers = " + pageImage.numContainers,
- "CONTAINER");
+ DebugUtil.debugMsg(null,
+ "# of containers = " + pageImage.numContainers, "CONTAINER"); //$NON-NLS-1$ //$NON-NLS-2$
for (int i = 0; i < pageImage.numContainers; i++) {
Container curContainer = pageImage.containers[i];
paintOnePageComponent(curContainer, _image, _color);
@@ -54,7 +54,8 @@
}
public IInt2D showRepaintedContainerMap() {
- Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel.getHeight());
+ Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel
+ .getHeight());
for (int j = 0; j < pageImage.pixel.getHeight(); j++) {
for (int i = 0; i < pageImage.pixel.getWidth(); i++) {
i2d.getData()[j][i] = ColorUtil
@@ -69,7 +70,8 @@
}
public IInt2D showAllSSCharacters(int _color) {
- Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel.getHeight());
+ Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel
+ .getHeight());
for (int k = 0; k < pageImage.containerVector.size(); k++) {
i2d = showSSCharactersInOneContainer(i2d, k, _color);
}
@@ -79,10 +81,9 @@
public Int2D showSSCharactersInOneContainer(Int2D _i2d, int _contIndex,
int _color) {
- Container curCont = (Container) (pageImage.containerVector.elementAt(_contIndex));
+ Container curCont = (pageImage.containerVector.elementAt(_contIndex));
for (int l = 0; l < curCont.ssCharacterVector.size(); l++) {
- CharacterSS ssc = (CharacterSS) (curCont.ssCharacterVector
- .elementAt(l));
+ CharacterSS ssc = (curCont.ssCharacterVector.elementAt(l));
ConnectedComponent cc = ssc.cc;
for (int j = 0; j < cc.shape.height; j++) {
for (int i = 0; i < cc.shape.width; i++) {
@@ -102,9 +103,10 @@
public IInt2D showAllCharacters(int _ssColor, int _msColor, int _smColor1,
int _smColor2) {
- Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel.getHeight());
- DebugUtil.debugMsg(this, "numContainers = " + pageImage.numContainers,
- "CONTAINER");
+ Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel
+ .getHeight());
+ DebugUtil.debugMsg(this, "numContainers = " + pageImage.numContainers, //$NON-NLS-1$
+ "CONTAINER"); //$NON-NLS-1$
for (int k = 0; k < pageImage.numContainers; k++) {
Container cont = pageImage.containers[k];
i2d = showCharactersInOneContainer(i2d, cont, _ssColor, _msColor,
@@ -112,7 +114,8 @@
}
for (int k = 0; k < pageImage.numNonContainedCharacters; k++) {
- i2d = pageImage.nonContainedCharacters[k].cc.drawShape(i2d, _smColor2);
+ i2d = pageImage.nonContainedCharacters[k].cc.drawShape(i2d,
+ _smColor2);
}
return (i2d);
@@ -139,9 +142,10 @@
public IInt2D showAllThinedCharacters(int _ssColor, int _msColor,
int _smColor1, int _smColor2) throws ImageException {
- Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel.getHeight());
- DebugUtil.debugMsg(this, "numContainers = " + pageImage.numContainers,
- "CONTAINER");
+ Int2D i2d = new Int2D(pageImage.pixel.getWidth(), pageImage.pixel
+ .getHeight());
+ DebugUtil.debugMsg(this, "numContainers = " + pageImage.numContainers, //$NON-NLS-1$
+ "CONTAINER"); //$NON-NLS-1$
for (int k = 0; k < pageImage.numContainers; k++) {
Container cont = pageImage.containers[k];
i2d = showThinedCharactersInOneContainer(i2d, cont, _ssColor,
@@ -149,8 +153,8 @@
}
for (int k = 0; k < pageImage.numNonContainedCharacters; k++) {
- i2d = pageImage.nonContainedCharacters[k].cc.thinning().drawShape(i2d,
- _smColor2);
+ i2d = pageImage.nonContainedCharacters[k].cc.thinning().drawShape(
+ i2d, _smColor2);
}
return (i2d);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/SimulatedPageImage.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/SimulatedPageImage.java
index da7a31b..df598fe 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/SimulatedPageImage.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/SimulatedPageImage.java
@@ -40,7 +40,7 @@
} catch (LowVisionException lve) {
// lve.printStackTrace();
throw new ImageException(
- "The original PageImage cannot be filtered.");
+ "The original PageImage cannot be filtered."); //$NON-NLS-1$
}
init(bi);
bi = null;
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Topology.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Topology.java
index 48409e0..8fc23e3 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Topology.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Topology.java
@@ -107,7 +107,7 @@
boolean existTop = false;
boolean existBottom = false;
for( int i=0; i<numNodes; i++ ){
- Node n = (Node)(tmpNodes.elementAt(i));
+ Node n = (tmpNodes.elementAt(i));
if( n.y == topPosition )
existTop = true;
if( n.y == bottomPosition )
@@ -127,7 +127,7 @@
break;
}
else{
- throw new ImageException( "Unknown type" );
+ throw new ImageException( "Unknown type" ); //$NON-NLS-1$
}
}
}
@@ -144,7 +144,7 @@
break;
}
else{
- throw new ImageException( "Unknown type" );
+ throw new ImageException( "Unknown type" ); //$NON-NLS-1$
}
}
}
@@ -157,7 +157,7 @@
offset = 1;
}
for( int i=0; i<tmpNodes.size(); i++ )
- nodes[i+offset] = (Node)(tmpNodes.elementAt(i));
+ nodes[i+offset] = (tmpNodes.elementAt(i));
if( bottomNode != null )
nodes[numNodes-1] = bottomNode;
@@ -208,7 +208,7 @@
nextNodes = new Vector<Coord>();
for( int i=0; i<size; i++ ){
- Coord co = (Coord)(currentNodes.elementAt(i));
+ Coord co = (currentNodes.elementAt(i));
int x = co.x;
int y = co.y;
if( x>0 && bi.data[y][x-1] != 0 ){
@@ -294,6 +294,7 @@
showNodes(pw);
}
+ @SuppressWarnings("nls")
public void showNodes(PrintWriter _pw) {
_pw.println("-------------------------------");
_pw.println("Dumping nodes");
@@ -333,6 +334,7 @@
showDistances(pw);
}
+ @SuppressWarnings("nls")
public void showDistances(PrintWriter _pw) {
if (distance == null) {
return;
@@ -362,6 +364,7 @@
_pw.println("-------------------------------");
}
+ @SuppressWarnings("nls")
private String numberFormat4(int _i) {
if (0 <= _i && _i <= 9)
return (" " + _i);
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Vector3D.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Vector3D.java
index f326c2c..e1fe6b3 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Vector3D.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/image/Vector3D.java
@@ -85,7 +85,7 @@
public static double cosine(Vector3D _a, Vector3D _b) throws ImageException {
if (isZeroVector(_a) || isZeroVector(_b)) {
- throw new ImageException("Cannot calculate cosine of zero-vectors");
+ throw new ImageException("Cannot calculate cosine of zero-vectors"); //$NON-NLS-1$
}
double answer = innerProduct(_a, _b) / (magnitude(_a) * magnitude(_b));
if (answer < -1.0) {
@@ -116,6 +116,7 @@
return (sine(this, _a));
}
+ @SuppressWarnings("nls")
public String toString() {
return ("(" + x + ", " + y + ", " + z + ")");
}
@@ -125,6 +126,7 @@
dump(pw);
}
+ @SuppressWarnings("nls")
public void dump(PrintWriter _pw) {
_pw.println("-----");
_pw.println("dumping Vector3D");
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPReader.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPReader.java
index 60a3457..0c6e1e3 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPReader.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPReader.java
@@ -35,7 +35,7 @@
fis = new FileInputStream(_fileName);
} catch (FileNotFoundException e) {
e.printStackTrace();
- throw new LowVisionIOException("The file was not found: "
+ throw new LowVisionIOException("The file was not found: " //$NON-NLS-1$
+ _fileName);
}
return (readInt2D(fis));
@@ -48,12 +48,13 @@
fis = new FileInputStream(_fileName);
} catch (FileNotFoundException e) {
e.printStackTrace();
- throw new LowVisionIOException("The file was not found: "
+ throw new LowVisionIOException("The file was not found: " //$NON-NLS-1$
+ _fileName);
}
return (readBufferedImage(fis));
}
+ @SuppressWarnings("nls")
public static int getBitCount(String _fileName) throws LowVisionIOException {
FileInputStream fis = null;
try {
@@ -66,6 +67,7 @@
return (getBitCount(fis));
}
+ @SuppressWarnings("nls")
public static int getBitCount(InputStream _is) throws LowVisionIOException {
short bitCount;
@@ -113,6 +115,7 @@
}
}
+ @SuppressWarnings("nls")
public static BufferedImage readBufferedImage(InputStream _is)
throws LowVisionIOException {
int fileSize;
@@ -319,6 +322,7 @@
return (destImage);
}
+ @SuppressWarnings("nls")
public static Int2D readInt2D(InputStream _is) throws LowVisionIOException {
int fileSize;
int offSet;
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPWriter.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPWriter.java
index 8838500..b7eac5d 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPWriter.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/BMPWriter.java
@@ -55,7 +55,7 @@
fos = new FileOutputStream(_fileName);
} catch (FileNotFoundException e) {
e.printStackTrace();
- throw new LowVisionIOException("The file was not found: "
+ throw new LowVisionIOException("The file was not found: " //$NON-NLS-1$
+ _fileName);
}
writeBufferedImage(_bi, fos, _bitCount);
@@ -76,7 +76,7 @@
// only for BufferedImage.TYPE_INT_RGB
if (_bitCount != 16 && _bitCount != 24) {
- throw new LowVisionIOException("Invalid bitCount: " + _bitCount);
+ throw new LowVisionIOException("Invalid bitCount: " + _bitCount); //$NON-NLS-1$
}
int imageWidth = _bi.getWidth();
@@ -121,7 +121,7 @@
} catch (IOException e) {
e.printStackTrace();
throw new LowVisionIOException(
- "IO error occurred when writing header.");
+ "IO error occurred when writing header."); //$NON-NLS-1$
}
WritableRaster srcRaster = _bi.copyData(null);
@@ -166,7 +166,7 @@
} catch (IOException e) {
e.printStackTrace();
throw new LowVisionIOException(
- "IO error occurred while writing image data.");
+ "IO error occurred while writing image data."); //$NON-NLS-1$
}
try {
@@ -175,7 +175,7 @@
} catch (IOException e) {
e.printStackTrace();
throw new LowVisionIOException(
- "IO error occurred when closing output streams.");
+ "IO error occurred when closing output streams."); //$NON-NLS-1$
}
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderController.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderController.java
index 943fdae..1ca4011 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderController.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderController.java
@@ -50,8 +50,8 @@
return;
}
}
- DebugUtil.outMsg(null, "Thread for getting \"" + fileName
- + "\" was timed out.");
+ DebugUtil.outMsg(null, "Thread for getting \"" + fileName //$NON-NLS-1$
+ + "\" was timed out."); //$NON-NLS-1$
} catch (InterruptedException ie) {
ie.printStackTrace();
} finally {
diff --git a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderGetter.java b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderGetter.java
index ccdedb1..08c7607 100644
--- a/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderGetter.java
+++ b/plugins/org.eclipse.actf.visualization.engines.lowvision/src/org/eclipse/actf/visualization/internal/engines/lowvision/io/ImageFileReaderGetter.java
@@ -44,8 +44,8 @@
try {
tracker.waitForID(0);
} catch (InterruptedException ie) {
- DebugUtil.outMsg(this, "Thread for getting \"" + fileName
- + "\" was interrupted.");
+ DebugUtil.outMsg(this, "Thread for getting \"" + fileName //$NON-NLS-1$
+ + "\" was interrupted."); //$NON-NLS-1$
// ie.printStackTrace();
}
@@ -60,7 +60,7 @@
gr.drawImage(im, 0, 0, null);
}
if (image == null) {
- DebugUtil.outMsg(this, "BufferedImage is null.");
+ DebugUtil.outMsg(this, "BufferedImage is null."); //$NON-NLS-1$
}
caller.setBufferedImage(image);