소스 검색

Fixed editLayerFrame

Max Nuding 12 년 전
부모
커밋
be7ccffaf5
2개의 변경된 파일14개의 추가작업 그리고 25개의 파일을 삭제
  1. 13
    14
      Cube Control/cubeWorker.java
  2. 1
    11
      Cube Control/layerEditFrame.java

+ 13
- 14
Cube Control/cubeWorker.java 파일 보기

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

+ 1
- 11
Cube Control/layerEditFrame.java 파일 보기

149
     for(int j = 0; j < 8; j++){
149
     for(int j = 0; j < 8; j++){
150
       for(int i = 0; i < 8; i++){
150
       for(int i = 0; i < 8; i++){
151
         reihe += ((int) Math.pow(2, i)) * ledStatus[i][j];
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
         ctr++;
152
         ctr++;
160
       }
153
       }
161
       tmpFrame[j] = (byte)reihe;
154
       tmpFrame[j] = (byte)reihe;
162
       reihe = 0;
155
       reihe = 0;
163
-      System.out.println("----");
164
-      System.out.println("Frame-Array, Position " + j + " = " + tmpFrame[j]);
165
-      System.out.println("----");
166
     }
156
     }
167
       frame = tmpFrame;
157
       frame = tmpFrame;
168
-
158
+      dispose();
169
 
159
 
170
   }
160
   }
171
 
161
 

Loading…
취소
저장