Author: dgolovin
Date: 2007-10-24 20:21:07 -0400 (Wed, 24 Oct 2007)
New Revision: 4489
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/edit/xpl/TilesConnectionRouter.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java
Log:
Code clean up.
new Integer() replaced for Integer.valueOf()
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/edit/xpl/TilesConnectionRouter.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/edit/xpl/TilesConnectionRouter.java 2007-10-25
00:21:01 UTC (rev 4488)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/edit/xpl/TilesConnectionRouter.java 2007-10-25
00:21:07 UTC (rev 4489)
@@ -73,7 +73,7 @@
r--;
Integer i;
while (proximity < r) {
- i = new Integer(r + proximity * direction);
+ i = Integer.valueOf(r + proximity * direction);
if (!colsUsed.contains(i)) {
colsUsed.add(i);
reserveColumn(connection, i);
@@ -160,7 +160,7 @@
r--;
Integer i;
while (proximity < r) {
- i = new Integer(r + proximity * direction);
+ i = Integer.valueOf(r + proximity * direction);
if (!rowsUsed.contains(i)) {
rowsUsed.add(i);
reserveRow(connection, i);
@@ -306,9 +306,9 @@
List<Integer> positions = new ArrayList<Integer>(5);
boolean horizontal = startNormal.isHorizontal();
if (horizontal)
- positions.add(new Integer(start.y));
+ positions.add(Integer.valueOf(start.y));
else
- positions.add(new Integer(start.x));
+ positions.add(Integer.valueOf(start.x));
horizontal = !horizontal;
if (startNormal.dotProduct(endNormal) == 0) {
@@ -325,7 +325,7 @@
else
i = average.x;
}
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
if (endNormal.dotProduct(direction) > 0)
@@ -336,7 +336,7 @@
else
i = average.x;
}
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
} else {
@@ -346,13 +346,13 @@
i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
else
i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
} else {
//3 or 1
if (startNormal.dotProduct(direction) < 0) {
i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
@@ -360,20 +360,20 @@
i = average.y;
else
i = average.x;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
if (startNormal.dotProduct(direction) < 0) {
i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
}
}
if (horizontal)
- positions.add(new Integer(end.y));
+ positions.add(Integer.valueOf(end.y));
else
- positions.add(new Integer(end.x));
+ positions.add(Integer.valueOf(end.x));
processPositions(start, end, positions, startNormal.isHorizontal(), conn);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2007-10-25
00:21:01 UTC (rev 4488)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2007-10-25
00:21:07 UTC (rev 4489)
@@ -559,7 +559,7 @@
return DEFAULT_VERTICAL_SPACING;
if (str.indexOf("default") >= 0)return DEFAULT_VERTICAL_SPACING;
//$NON-NLS-1$
try {
- return new Integer(str).intValue();
+ return Integer.parseInt(str);
} catch (Exception ex) {
return DEFAULT_VERTICAL_SPACING;
}
@@ -571,7 +571,7 @@
return DEFAULT_HORIZONTAL_SPACING;
if (str.indexOf("default") >= 0)return DEFAULT_HORIZONTAL_SPACING;
//$NON-NLS-1$
try {
- return new Integer(str).intValue();
+ return Integer.parseInt(str);
} catch (Exception ex) {
return DEFAULT_HORIZONTAL_SPACING;
}
@@ -603,23 +603,20 @@
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2); //$NON-NLS-1$
if (pos3 < 0)
- size = new Integer(str
- .substring(pos2 + 5, str.length())).intValue();
+ size = Integer.parseInt(str
+ .substring(pos2 + 5, str.length()));
else
- size = new Integer(str.substring(pos2 + 5, pos3))
- .intValue();
+ size = Integer.parseInt(str.substring(pos2 + 5, pos3));
}
pos2 = str.indexOf("style="); //$NON-NLS-1$
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2); //$NON-NLS-1$
if (pos3 < 0)
- style = new Integer(str.substring(pos2 + 6, str
- .length())).intValue();
+ style = Integer.parseInt(str.substring(pos2 + 6, str
+ .length()));
else
- style = new Integer(str.substring(pos2 + 6, pos3))
- .intValue();
+ style = Integer.parseInt(str.substring(pos2 + 6, pos3));
}
-
}
if (definitionNameFont == null) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java 2007-10-25
00:21:01 UTC (rev 4488)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java 2007-10-25
00:21:07 UTC (rev 4489)
@@ -250,7 +250,7 @@
while(tmp>0){
g2.drawLine(zeroX,tmp - pH+zeroY,xmax+zeroX,tmp - pH+zeroY);
tmp = tmp - pH;
- yy.add(new Integer(tmp));
+ yy.add(Integer.valueOf(tmp));
}
tmp = xmax;
Show replies by date