Przeglądaj źródła

Fixed layer edit again, and again, and again...

Thomas Buck 13 lat temu
rodzic
commit
e90c4cde92
2 zmienionych plików z 16 dodań i 6 usunięć
  1. 1
    1
      Cube Control/frame.java
  2. 15
    5
      Cube Control/layerEditFrame.java

+ 1
- 1
Cube Control/frame.java Wyświetl plik

@@ -507,7 +507,7 @@ public class frame extends JFrame implements ListSelectionListener {
507 507
   // Anfang Ereignisprozeduren
508 508
   public void editA_ActionPerformed(ActionEvent evt) {
509 509
 
510
-     layerEditFrame layerFrame1 = new layerEditFrame(worker.getFrame(animList.getSelectedIndex(), frameList.getSelectedIndex()), 0);
510
+     layerEditFrame layerFrame1 = new layerEditFrame(animList.getSelectedIndex(), frameList.getSelectedIndex(), 0, worker);
511 511
   }
512 512
 
513 513
   public void editB_ActionPerformed(ActionEvent evt) {

+ 15
- 5
Cube Control/layerEditFrame.java Wyświetl plik

@@ -21,13 +21,20 @@ public class layerEditFrame extends JFrame {
21 21
   boolean changedStateSinceSave = false;
22 22
   byte[] frame;
23 23
   int li;
24
+  boolean finish = false;
25
+  cubeWorker worker = null;
26
+  int animI;
27
+  int frameI;
24 28
 
25 29
   // Ende Attribute
26 30
 
27
-  public layerEditFrame(byte[] f, int layerIndex) {
31
+  public layerEditFrame(int animIndex, int frameIndex, int layerIndex, cubeWorker work) {
28 32
     // Frame-Initialisierung
29
-    super("Layer Edit");
30
-    frame = f;
33
+	super("Layer Edit");
34
+	worker = work;
35
+	animI = animIndex;
36
+	frameI = frameIndex;
37
+    frame = worker.getFrame(animIndex, frameIndex);
31 38
     li = layerIndex;
32 39
     setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
33 40
     int frameWidth = 180;
@@ -121,7 +128,10 @@ public class layerEditFrame extends JFrame {
121 128
   }
122 129
 
123 130
    byte[] getFinalFrame(){
124
-      return frame;
131
+	 if (finish == false) {
132
+		 return null;
133
+	 }
134
+	 return frame;
125 135
    }
126 136
 
127 137
   public void btnClicked(int i, int j){
@@ -156,7 +166,7 @@ public class layerEditFrame extends JFrame {
156 166
     }
157 167
       frame = tmpFrame;
158 168
       dispose();
159
-
169
+	  worker.setFrame(frame, animI, frameI);
160 170
   }
161 171
 
162 172
   private int saveExitDialog() {

Ładowanie…
Anuluj
Zapisz