Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
ObjEditor.java
....@@ -784,6 +784,7 @@
784784 // NumberSlider vDivsField;
785785 // JCheckBox endcaps;
786786 JCheckBox liveCB;
787
+ JCheckBox selectCB;
787788 JCheckBox hideCB;
788789 JCheckBox link2masterCB;
789790 JCheckBox markCB;
....@@ -986,9 +987,11 @@
986987
987988 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
988989 liveCB.setToolTipText("Animate object");
990
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
991
+ selectCB.setToolTipText("Make object selectable");
992
+// Return();
989993 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
990994 hideCB.setToolTipText("Hide object");
991
-// Return();
992995 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
993996 markCB.setToolTipText("Set the animation target transform");
994997
....@@ -1028,7 +1031,7 @@
10281031 oe.ctrlPanel.add(commandsPanel);
10291032 oe.ctrlPanel.Return();
10301033
1031
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1034
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
10321035 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
10331036 //Return();
10341037
....@@ -3007,6 +3010,10 @@
30073010 {
30083011 copy.live ^= true;
30093012 return;
3013
+ } else if (event.getSource() == selectCB)
3014
+ {
3015
+ copy.dontselect ^= true;
3016
+ return;
30103017 } else if (event.getSource() == hideCB)
30113018 {
30123019 copy.hide ^= true;
....@@ -3588,7 +3595,7 @@
35883595 }
35893596
35903597 if (normalpushField != null)
3591
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3598
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35923599 }
35933600
35943601 void SnapObject()
....@@ -4055,6 +4062,7 @@
40554062 }
40564063 }
40574064 }
4065
+
40584066 LoadGFDThread loadGFDThread;
40594067
40604068 void ReadGFD(String fullname, iCallBack cb)
....@@ -4075,7 +4083,8 @@
40754083 try
40764084 {
40774085 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4078
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4086
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4087
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40794088
40804089 readobj = (Object3D) p.readObject();
40814090 istream.close();
....@@ -4083,7 +4092,20 @@
40834092 readobj.ResetDisplayList();
40844093 } catch (Exception e)
40854094 {
4086
- e.printStackTrace();
4095
+ //e.printStackTrace();
4096
+ try
4097
+ {
4098
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4099
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4100
+
4101
+ readobj = (Object3D) p.readObject();
4102
+ istream.close();
4103
+
4104
+ readobj.ResetDisplayList();
4105
+ } catch (Exception e2)
4106
+ {
4107
+ e2.printStackTrace();
4108
+ }
40874109 }
40884110 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40894111 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4287,11 +4309,13 @@
42874309 try
42884310 {
42894311 FileOutputStream ostream = new FileOutputStream(lastname);
4290
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4312
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4313
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42914314
42924315 p.writeObject(copy);
42934316 p.flush();
42944317
4318
+ zstream.close();
42954319 ostream.close();
42964320
42974321 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4301,6 +4325,7 @@
43014325 {
43024326 }
43034327 }
4328
+
43044329 String lastname;
43054330
43064331 void saveAs()
....@@ -4410,8 +4435,8 @@
44104435 try
44114436 {
44124437 FileOutputStream ostream = new FileOutputStream(filename);
4413
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4414
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4438
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4439
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44154440
44164441 Object3D objectparent = obj.parent;
44174442 obj.parent = null;
....@@ -4428,8 +4453,8 @@
44284453 p.writeObject(object);
44294454 p.flush();
44304455
4456
+ zstream.close();
44314457 ostream.close();
4432
- // zstream.close();
44334458
44344459 // group.selection.get(0).parent = parent;
44354460 //FileOutputStream fos = new FileOutputStream(fullname);