Browse Source

Fixed editLayerFrame

Max Nuding 12 years ago
parent
commit
be7ccffaf5
2 changed files with 14 additions and 25 deletions
  1. 13
    14
      Cube Control/cubeWorker.java
  2. 1
    11
      Cube Control/layerEditFrame.java

+ 13
- 14
Cube Control/cubeWorker.java View File

@@ -132,7 +132,7 @@ public class cubeWorker {
132 132
       //animation moved down
133 133
     if (selectedAnimation < (animations.size() - 1)) {
134 134
       Collections.swap(animations, selectedAnimation, selectedAnimation + 1);
135
-	}
135
+  }
136 136
     }
137 137
   }
138 138
 
@@ -214,7 +214,7 @@ public class cubeWorker {
214 214
     try {
215 215
       animations = AnimationUtility.readFile(path);
216 216
     } catch (Exception e) {
217
-	  System.out.println("Did not load!");
217
+    System.out.println("Did not load!");
218 218
       e.printStackTrace(System.out);
219 219
       return -1;
220 220
     }
@@ -279,13 +279,13 @@ class AnimationUtility {
279 279
   ArrayList<Animation> animations = new ArrayList<Animation>();
280 280
 
281 281
   do {
282
-	Animation tmp = readAnimation(sc);
283
-	if (tmp == null) {
284
-		return animations;
285
-	}
286
-	if (sc.hasNextLine()) {
287
-		sc.nextLine();
288
-	}
282
+  Animation tmp = readAnimation(sc);
283
+  if (tmp == null) {
284
+    return animations;
285
+  }
286
+  if (sc.hasNextLine()) {
287
+    sc.nextLine();
288
+  }
289 289
     animations.add(tmp);
290 290
   } while (sc.hasNextLine());
291 291
 
@@ -335,7 +335,7 @@ class AnimationUtility {
335 335
   int index = 0;
336 336
   String tmpSize = sc.nextLine().replaceAll("\\n", "");
337 337
   if (tmpSize.equals("")) {
338
-	  return null;
338
+    return null;
339 339
   }
340 340
   Integer tmpSizeAgain = new Integer(tmpSize);
341 341
   int size = tmpSizeAgain.intValue();
@@ -383,13 +383,13 @@ class AnimationUtility {
383 383
       writeFrame(anim.get(i), f);
384 384
     }
385 385
     if (!last) {
386
-		f.write("\n");
387
-	}
386
+    f.write("\n");
387
+  }
388 388
   }
389 389
 
390 390
   private static void writeFrame(AFrame fr, FileWriter f) throws IOException {
391 391
     f.write(fr.getName() + "\n");
392
-	for (int i = 0; i < 8; i++) {
392
+  for (int i = 0; i < 8; i++) {
393 393
       writeLayer(fr.getLayer(i), f);
394 394
     }
395 395
     f.write(Integer.toString( (fr.getTime() & 0xff) + 0x100, 16).substring(1) + "\n");
@@ -424,7 +424,6 @@ class AFrame {
424 424
   }
425 425
 
426 426
   byte[] getData() {
427
-    data[0] = 3;
428 427
     return data;
429 428
   }
430 429
 

+ 1
- 11
Cube Control/layerEditFrame.java View File

@@ -149,23 +149,13 @@ public class layerEditFrame extends JFrame {
149 149
     for(int j = 0; j < 8; j++){
150 150
       for(int i = 0; i < 8; i++){
151 151
         reihe += ((int) Math.pow(2, i)) * ledStatus[i][j];
152
-        System.out.println("LED-Status: " + ledStatus[i][j]);
153
-        System.out.println("Reihe: " + i);
154
-        System.out.println("Spalte: " + j);
155
-        System.out.println("Wertigkeit: " + ((int) Math.pow(2, i)));
156
-        System.out.println("Zusammen: " + ((int) Math.pow(2, j)) * ledStatus[i][j]);
157
-        System.out.println("Reihe nacher: " + reihe);
158
-        System.out.println();
159 152
         ctr++;
160 153
       }
161 154
       tmpFrame[j] = (byte)reihe;
162 155
       reihe = 0;
163
-      System.out.println("----");
164
-      System.out.println("Frame-Array, Position " + j + " = " + tmpFrame[j]);
165
-      System.out.println("----");
166 156
     }
167 157
       frame = tmpFrame;
168
-
158
+      dispose();
169 159
 
170 160
   }
171 161
 

Loading…
Cancel
Save