Author: dgolovin
Date: 2007-10-24 20:21:34 -0400 (Wed, 24 Oct 2007)
New Revision: 4494
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/edit/xpl/JSFConnectionRouter.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/print/PagesView.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/bean/AddManagedBeanScreenTwo.java
Log:
Code clean up.
new Integer() replaced for Integer.valueOf()
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/edit/xpl/JSFConnectionRouter.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/edit/xpl/JSFConnectionRouter.java 2007-10-25
00:21:28 UTC (rev 4493)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/edit/xpl/JSFConnectionRouter.java 2007-10-25
00:21:34 UTC (rev 4494)
@@ -90,7 +90,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(conn, 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);
@@ -297,7 +297,7 @@
conn.translateToRelative(startPoint);
List<Integer> positions = new ArrayList<Integer>(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);
@@ -335,12 +335,12 @@
List<Integer> positions = new ArrayList<Integer>(5);
boolean horizontal = true;
// 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(10)));
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
if(conn.getSourceAnchor().getOwner() == null){
@@ -351,19 +351,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(10)));
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(10)));
i -= i%STEP;
- positions.add(new Integer(i));
+ positions.add(Integer.valueOf(i));
horizontal = !horizontal;
}
@@ -371,19 +371,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(10)));
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));
processPositions(start, end, positions,true, conn);
((ConnectionFigure)conn).setOldPoints(startPoint, endPoint);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java 2007-10-25
00:21:28 UTC (rev 4493)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java 2007-10-25
00:21:34 UTC (rev 4494)
@@ -578,7 +578,7 @@
public int getVisualGridStep() {
String str = optionsObject.getAttributeValue("Grid Step");
- return new Integer(str).intValue();
+ return Integer.parseInt(str);
}
public Font getLinkPathFont() {
@@ -595,21 +595,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));
}
}
@@ -640,21 +638,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/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/print/PagesView.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/print/PagesView.java 2007-10-25
00:21:28 UTC (rev 4493)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/print/PagesView.java 2007-10-25
00:21:34 UTC (rev 4494)
@@ -284,7 +284,7 @@
.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;
@@ -294,7 +294,7 @@
.drawLine(tmp - pW + zeroX, zeroY, tmp - pW + zeroX, ymax
+ zeroY);
tmp = tmp - pW;
- xx.add(new Integer(tmp));
+ xx.add(Integer.valueOf(tmp));
}
List<Rectangle> rec = new ArrayList<Rectangle>();
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/bean/AddManagedBeanScreenTwo.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/bean/AddManagedBeanScreenTwo.java 2007-10-25
00:21:28 UTC (rev 4493)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/bean/AddManagedBeanScreenTwo.java 2007-10-25
00:21:34 UTC (rev 4494)
@@ -171,7 +171,7 @@
}
public Object getDataAt(int r) {
- return new Integer(r);
+ return Integer.valueOf(r);
}
public Color getColor(int r) {