Author: scabanovich
Date: 2008-08-13 11:40:28 -0400 (Wed, 13 Aug 2008)
New Revision: 9703
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
Log:
JBIDE-2611
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java 2008-08-13
15:34:48 UTC (rev 9702)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java 2008-08-13
15:40:28 UTC (rev 9703)
@@ -13,16 +13,16 @@
import org.jboss.tools.common.model.*;
public class AutoLayout {
- LayuotConstants constants = new LayuotConstants();
+ LayuotConstants constants;
protected Items items;
public AutoLayout() {
- constants.update();
}
-
+
public void setItems(Items items) {
this.items = items;
- items.constants = constants;
+ constants = items.constants;
+ constants.update();
}
public void setOverride(boolean b) {
@@ -50,7 +50,9 @@
XModelObject o = is[i].object;
int x = is[i].ix * constants.deltaX + constants.indentX;
int y = is[i].iy * constants.deltaY + constants.indentY;
- if(is[i].ix % 2 == 1) y += 16;
+ if(items.isZigzagging()) {
+ if(is[i].ix % 2 == 1) y += 16;
+ }
x += is[i].group.xDeltas[is[i].ix] * constants.incX;
y += yDeltas[is[i].iy] * constants.incY + is[i].yIndent;
o.setAttributeValue("shape", "" + x + "," + y +
",0,0");
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2008-08-13
15:34:48 UTC (rev 9702)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2008-08-13
15:40:28 UTC (rev 9703)
@@ -17,7 +17,7 @@
import org.jboss.tools.jst.web.model.process.WebProcessConstants;
public class Items implements WebProcessConstants {
- protected LayuotConstants constants;
+ protected LayuotConstants constants = createConstants();
protected WebProcessStructureHelper h = new WebProcessStructureHelper();
protected XModelObject process;
protected Item[] items;
@@ -27,6 +27,14 @@
public Items() {}
+ protected LayuotConstants createConstants() {
+ return new LayuotConstants();
+ }
+
+ public boolean isZigzagging() {
+ return true;
+ }
+
public void setOverride(boolean b) {
override = b;
}
Show replies by date