Author: dgolovin
Date: 2007-10-24 20:21:21 -0400 (Wed, 24 Oct 2007)
New Revision: 4491
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/StrutsConnectionRouter.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/xpl/DefaultRouter.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/model/impl/StrutsModel.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/print/PagesView.java
Log:
Code clean up.
new Integer() replaced for Integer.valueOf()
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/StrutsConnectionRouter.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/StrutsConnectionRouter.java 2007-10-25
00:21:14 UTC (rev 4490)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/StrutsConnectionRouter.java 2007-10-25
00:21:21 UTC (rev 4491)
@@ -55,7 +55,7 @@
conn.translateToRelative(startPoint);
Vector positions = new Vector(5);
Ray start = new Ray(startPoint);
- positions.add(new Integer(start.y));
+ positions.add(Integer.valueOf(start.y));
Point endPoint = new Point(startPoint.x + 18, startPoint.y);
Ray end = new Ray(endPoint);
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/xpl/DefaultRouter.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/xpl/DefaultRouter.java 2007-10-25
00:21:14 UTC (rev 4490)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/edit/xpl/DefaultRouter.java 2007-10-25
00:21:21 UTC (rev 4491)
@@ -93,7 +93,7 @@
r--;
Integer i;
while (proximity < r){
- i = new Integer(r + proximity*direction);
+ i = Integer.valueOf(r + proximity*direction);
if (!colsUsed.containsKey(i)){
colsUsed.put(i,i);
reserveColumn(conn, i);
@@ -144,12 +144,12 @@
Vector positions = new Vector(5);
boolean horizontal = true;//startNormal.isHorizontal();
// start horizontal segment
- positions.add(new Integer(start.y));
+ positions.add(Integer.valueOf(start.y));
horizontal = !horizontal;
if((start.x > (end.x+20)) && (Math.abs(end.y-start.y) < 100)){
i = startNormal.similarity(start.getAdded(startNormal.getScaled(INTEGER)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
if(conn.getSourceAnchor().getOwner() == null){
@@ -160,19 +160,19 @@
i = rec.y+rec.height+8;
}
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
i = endNormal.similarity(end.getAdded(endNormal.getScaled(INTEGER)));
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}else{
// vertical segment
if (startNormal.dotProduct(direction) < STEP*2){
i = startNormal.similarity(start.getAdded(startNormal.getScaled(INTEGER)));
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
@@ -180,19 +180,19 @@
if (horizontal) i = average.y;
else i = average.x;
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
// vertical segment
if (startNormal.dotProduct(direction) < STEP*2){
i = endNormal.similarity(end.getAdded(endNormal.getScaled(INTEGER)));
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
}
// end horizontal segment
- positions.add(new Integer(end.y));
+ positions.add(Integer.valueOf(end.y));
postRoute(conn, start, end, startPoint, endPoint, positions);
}
@@ -225,13 +225,13 @@
boolean horizontal = true;// startNormal.isHorizontal();
// start horizontal segment
- positions.add(new Integer(start.y));
+ positions.add(Integer.valueOf(start.y));
horizontal = !horizontal;
if ((start.x > (end.x + 20)) && (Math.abs(end.y - start.y) < 100)) {
i = startNormal.similarity(start.getAdded(startNormal
.getScaled(INTEGER)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
if (conn.getSourceAnchor().getOwner() == null) {
@@ -242,13 +242,13 @@
i = rec.y + rec.height + 8;
}
i -= i % STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
i = endNormal
.similarity(end.getAdded(endNormal.getScaled(INTEGER)));
i -= i % STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
} else {
// vertical segment
@@ -256,7 +256,7 @@
i = startNormal.similarity(start.getAdded(startNormal
.getScaled(INTEGER)));
i -= i % STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
@@ -266,7 +266,7 @@
else
i = average.x;
i -= i % STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
// vertical segment
@@ -274,12 +274,12 @@
i = endNormal.similarity(end.getAdded(endNormal
.getScaled(INTEGER)));
i -= i % STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
}
// end horizontal segment
- positions.add(new Integer(end.y));
+ positions.add(Integer.valueOf(end.y));
}
protected Ray getStartDirection(Connection conn) {
@@ -307,7 +307,7 @@
r--;
Integer i;
while (proximity < r) {
- i = new Integer(r + proximity * direction);
+ i = Integer.valueOf(r + proximity * direction);
if (!rowsUsed.containsKey(i)) {
rowsUsed.put(i, i);
reserveRow(connection, i);
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/model/impl/StrutsModel.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/model/impl/StrutsModel.java 2007-10-25
00:21:14 UTC (rev 4490)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/model/impl/StrutsModel.java 2007-10-25
00:21:21 UTC (rev 4491)
@@ -530,7 +530,7 @@
public int getGridStep() {
String str = optionsObject.getAttributeValue("Grid Step");
- return new Integer(str).intValue();
+ return Integer.parseInt(str);
}
public Font getActionFont() {
@@ -547,21 +547,19 @@
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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=");
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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));
}
}
@@ -592,21 +590,19 @@
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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=");
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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));
}
}
@@ -637,21 +633,19 @@
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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=");
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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));
}
}
@@ -682,21 +676,19 @@
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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=");
if (pos2 >= 0) {
pos3 = str.indexOf(",", pos2);
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));
}
}
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/print/PagesView.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/print/PagesView.java 2007-10-25
00:21:14 UTC (rev 4490)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/editor/print/PagesView.java 2007-10-25
00:21:21 UTC (rev 4491)
@@ -313,7 +313,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;
@@ -321,7 +321,7 @@
while(tmp>0){
g2.drawLine(tmp - pW+zeroX,zeroY,tmp - pW+zeroX,ymax+zeroY);
tmp = tmp - pW;
- xx.add(new Integer(tmp));
+ xx.add(Integer.valueOf(tmp));
}
Vector rec = new Vector();