Changeset 1102 for trunk/src/org/expeditee/items/JSItem.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/JSItem.java
r1080 r1102 19 19 package org.expeditee.items; 20 20 21 import java.awt.Graphics2D;22 import java.awt.Polygon;23 21 import java.util.LinkedList; 24 22 import java.util.List; … … 29 27 import javax.script.ScriptException; 30 28 31 import org.expeditee.gui.DisplayIO; 32 import org.expeditee.items.widgets.InteractiveWidget; 29 import org.expeditee.Util; 30 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 31 import org.expeditee.gui.DisplayController; 33 32 34 33 public class JSItem extends XRayable implements JSThreadable { … … 64 63 65 64 private static Text getSauce(int width, int height) { 66 Text source = new Text(Display IO.getCurrentFrame().getNextItemID(), "@js: " + width + " " + height);67 source.setParent(Display IO.getCurrentFrame());65 Text source = new Text(DisplayController.getCurrentFrame().getNextItemID(), "@js: " + width + " " + height); 66 source.setParent(DisplayController.getCurrentFrame()); 68 67 return source; 69 68 } … … 115 114 116 115 @Override 117 public void paint(Graphics2D g) { 118 try { 119 this.invocable.invokeFunction("paint", (Object)g); 116 public void paint(/*Graphics2D g*/) { 117 try { 118 // Not sure of the consequences of changing this? cts16 119 //this.invocable.invokeFunction("paint", (Object)g); 120 this.invocable.invokeFunction("paint"); 120 121 } catch (Exception e) { 121 122 e.printStackTrace(); … … 130 131 131 132 @Override 132 public void updatePolygon() { 133 _poly = new Polygon(); 134 _poly.addPoint(getX(), getY()); 135 _poly.addPoint(getX() + _width, getY()); 136 _poly.addPoint(getX() + _width, getY() + _height); 137 _poly.addPoint(getX(), getY() + _height); 133 public AxisAlignedBoxBounds updateBounds() 134 { 135 return new AxisAlignedBoxBounds(getX(), getY(), _width, _height); 138 136 } 139 137 … … 158 156 return; 159 157 } 160 String[] args = InteractiveWidget.parseArgs(text.substring(index));158 String[] args = Util.parseArgs(text.substring(index)); 161 159 try { 162 160 this.scriptEngine.eval("load = " + this.load); … … 189 187 newText.append(_width).append(" ").append(_height); 190 188 191 String stateArgs = InteractiveWidget.formatArgs(saveArgs());189 String stateArgs = Util.formatArgs(saveArgs()); 192 190 if (stateArgs != null) { 193 191 newText.append(':'); … … 239 237 } 240 238 239 @Override 240 public float getSize() { 241 // TODO Auto-generated method stub 242 return 0; 243 } 244 241 245 }
Note:
See TracChangeset
for help on using the changeset viewer.