Changeset 11525 in josm for trunk/src/com/kitfox/svg/Gradient.java
- Timestamp:
- 2017-02-02T00:08:08+01:00 (9 years ago)
- File:
-
- 1 edited
-
trunk/src/com/kitfox/svg/Gradient.java (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/kitfox/svg/Gradient.java
r8084 r11525 41 41 import java.net.URI; 42 42 import java.util.ArrayList; 43 import java.util.Iterator;44 43 import java.util.logging.Level; 45 44 import java.util.logging.Logger; … … 62 61 //Either this gradient contains a list of stops, or it will take it's 63 62 // stops from the referenced gradient 64 ArrayList stops = new ArrayList(); 63 ArrayList<Stop> stops = new ArrayList<>(); 65 64 URI stopRef = null; 66 65 protected AffineTransform gradientTransform = null; … … 77 76 } 78 77 78 @Override 79 79 public String getTagName() 80 80 { … … 86 86 * each child tag that has been processed 87 87 */ 88 @Override 88 89 public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException 89 90 { … … 97 98 } 98 99 100 @Override 99 101 protected void build() throws SVGException 100 102 { … … 173 175 stopFractions = new float[stops.size()]; 174 176 int idx = 0; 175 for (Iterator it = stops.iterator(); it.hasNext();) 176 { 177 Stop stop = (Stop) it.next(); 177 for (Stop stop : stops) { 178 178 float val = stop.offset; 179 179 if (idx != 0 && val < stopFractions[idx - 1]) … … 202 202 stopColors = new Color[stops.size()]; 203 203 int idx = 0; 204 for (Iterator it = stops.iterator(); it.hasNext();) 205 { 206 Stop stop = (Stop) it.next(); 204 for (Stop stop : stops) { 207 205 int stopColorVal = stop.color.getRGB(); 208 206 Color stopColor = new Color((stopColorVal >> 16) & 0xff, (stopColorVal >> 8) & 0xff, stopColorVal & 0xff, clamp((int) (stop.opacity * 255), 0, 255)); … … 255 253 * update 256 254 */ 255 @Override 257 256 public boolean updateTime(double curTime) throws SVGException 258 257 { … … 262 261 //Get current values for parameters 263 262 StyleAttribute sty = new StyleAttribute(); 264 boolean shapeChange = false;265 263 String strn; 266 264 … … 335 333 336 334 //Check stops, if any 337 for (Iterator it = stops.iterator(); it.hasNext();) 338 { 339 Stop stop = (Stop) it.next(); 335 for (Stop stop : stops) { 340 336 if (stop.updateTime(curTime)) 341 337 {
Note:
See TracChangeset
for help on using the changeset viewer.
