Normand Briere
2019-05-05 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4
CameraPane.java
....@@ -106,7 +106,7 @@
106106 static boolean OEIL = true;
107107 static boolean OEILONCE = false; // do oeilon then oeiloff
108108 static boolean LOOKAT = true;
109
-static boolean RANDOM = true; // false;
109
+static boolean SWITCH = true; // false;
110110 static boolean HANDLES = false; // selection doesn't work!!
111111 static boolean PAINTMODE = false;
112112
....@@ -2267,7 +2267,7 @@
22672267
22682268 void ToggleRandom()
22692269 {
2270
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22712271 }
22722272
22732273 void ToggleHandles()
....@@ -8075,12 +8075,16 @@
80758075 {
80768076 String texname = tex;
80778077
8078
- String[] split = tex.split("Textures");
8079
- if (split.length > 1)
8080
- texname = "/Users/nbriere/Textures" + split[split.length-1];
8081
- else
8082
- if (!texname.startsWith("/"))
8083
- texname = "/Users/nbriere/Textures/" + texname;
8078
+// String[] split = tex.split("Textures");
8079
+// if (split.length > 1)
8080
+// texname = "/Users/nbriere/Textures" + split[split.length-1];
8081
+// else
8082
+// if (!texname.startsWith("/"))
8083
+// texname = "/Users/nbriere/Textures/" + texname;
8084
+ if (!new File(tex).exists())
8085
+ {
8086
+ texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname;
8087
+ }
80848088
80858089 if (CACHETEXTURE)
80868090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -12754,7 +12758,7 @@
1275412758 "MUL final.y, fragment.texcoord[0].x, c256;" +
1275512759 "FLR final.x, final.y;" +
1275612760 "SUB final.y, final.y, final.x;" +
12757
- //"MUL final.x, final.x, c256i;" +
12761
+ "MUL final.x, final.x, c256i;" +
1275812762 "MOV final.z, zero.x;" +
1275912763 "MOV final.a, one.w;":""
1276012764 ) +
....@@ -12762,7 +12766,7 @@
1276212766 "MUL final.y, fragment.texcoord[0].y, c256;" +
1276312767 "FLR final.x, final.y;" +
1276412768 "SUB final.y, final.y, final.x;" +
12765
- //"MUL final.x, final.x, c256i;" +
12769
+ "MUL final.x, final.x, c256i;" +
1276612770 "MOV final.z, zero.x;" +
1276712771 "MOV final.a, one.w;":""
1276812772 ) +
....@@ -13515,7 +13519,7 @@
1351513519 public void mousePressed(MouseEvent e)
1351613520 {
1351713521 //System.out.println("mousePressed: " + e);
13518
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13522
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1351913523 }
1352013524
1352113525 static long prevtime = 0;
....@@ -13591,8 +13595,8 @@
1359113595 // mode |= META;
1359213596 //}
1359313597
13594
- SetMouseMode(WHEEL | e.getModifiersEx());
13595
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13598
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13599
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1359613600 anchorX = ax;
1359713601 anchorY = ay;
1359813602 prevX = px;
....@@ -13652,6 +13656,10 @@
1365213656 // wasliveok = true;
1365313657 // waslive = false;
1365413658
13659
+ // May 2019 Forget it:
13660
+ if (true)
13661
+ return;
13662
+
1365513663 // source == timer
1365613664 if (mouseDown)
1365713665 {
....@@ -13690,7 +13698,7 @@
1369013698
1369113699 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1369213700
13693
- void clickStart(int x, int y, int modifiers)
13701
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1369413702 {
1369513703 if (!wasliveok)
1369613704 return;
....@@ -13707,7 +13715,7 @@
1370713715 // touched = true; // main DL
1370813716 if (isRenderer)
1370913717 {
13710
- SetMouseMode(modifiers);
13718
+ SetMouseMode(modifiers, modifiersex);
1371113719 }
1371213720
1371313721 selectX = anchorX = x;
....@@ -13720,7 +13728,7 @@
1372013728 clicked = true;
1372113729 hold = false;
1372213730
13723
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13731
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1372413732 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1372513733 {
1372613734 // System.out.println("RESTART II " + modifiers);
....@@ -13751,7 +13759,7 @@
1375113759 info.camera = renderCamera;
1375213760 info.x = x;
1375313761 info.y = y;
13754
- info.modifiers = modifiers;
13762
+ info.modifiers = modifiersex;
1375513763 editObj = object.doEditClick(info, 0);
1375613764 if (!editObj)
1375713765 {
....@@ -13780,7 +13788,7 @@
1378013788 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1378113789 }
1378213790 else
13783
- drag(e.getX(), e.getY(), e.getModifiersEx());
13791
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1378413792
1378513793 //try { Thread.sleep(1); } catch (Exception ex) {}
1378613794 }
....@@ -14017,7 +14025,7 @@
1401714025 {
1401814026 Globals.lighttouched = true;
1401914027 }
14020
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14028
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1402114029 }
1402214030 //else
1402314031 }
....@@ -14117,7 +14125,7 @@
1411714125 int X, Y;
1411814126 boolean SX, SY;
1411914127
14120
- void drag(int x, int y, int modifiers)
14128
+ void drag(int x, int y, int modifiers, int modifiersex)
1412114129 {
1412214130 if (IsFrozen())
1412314131 {
....@@ -14126,17 +14134,17 @@
1412614134
1412714135 drag = true; // NEW
1412814136
14129
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14137
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1413014138
1413114139 X = x;
1413214140 Y = y;
1413314141 // floating state for animation
14134
- MODIFIERS = modifiers;
14135
- modifiers &= ~1024;
14142
+ MODIFIERS = modifiersex;
14143
+ modifiersex &= ~1024;
1413614144 if (false) // modifiers != 0)
1413714145 {
1413814146 //new Exception().printStackTrace();
14139
- System.out.println("mouseDragged: " + modifiers);
14147
+ System.out.println("mouseDragged: " + modifiersex);
1414014148 System.out.println("SHIFT = " + SHIFT);
1414114149 System.out.println("CONTROL = " + COMMAND);
1414214150 System.out.println("META = " + META);
....@@ -14156,7 +14164,7 @@
1415614164 info.camera = renderCamera;
1415714165 info.x = x;
1415814166 info.y = y;
14159
- object.editWindow.copy.doEditDrag(info);
14167
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1416014168 } else
1416114169 {
1416214170 if (x < startX)
....@@ -14355,9 +14363,9 @@
1435514363 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1435614364 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1435714365
14358
- if (control || command || IsFrozen())
14366
+// No delay if (control || command || IsFrozen())
1435914367 timeout = true;
14360
- else
14368
+// ?? May 2019 else
1436114369 // timer.setDelay((modifiers & 128) != 0?0:350);
1436214370 mouseDown = false;
1436314371 if (!control && !command) // june 2013
....@@ -14467,7 +14475,7 @@
1446714475 System.out.println("keyReleased: " + e);
1446814476 }
1446914477
14470
- void SetMouseMode(int modifiers)
14478
+ void SetMouseMode(int modifiers, int modifiersex)
1447114479 {
1447214480 //System.out.println("SetMouseMode = " + modifiers);
1447314481 //modifiers &= ~1024;
....@@ -14479,25 +14487,25 @@
1447914487 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1448014488 // return;
1448114489 //System.out.println("SetMode = " + modifiers);
14482
- if ((modifiers & WHEEL) == WHEEL)
14490
+ if ((modifiersex & WHEEL) == WHEEL)
1448314491 {
1448414492 mouseMode |= ZOOM;
1448514493 }
1448614494
1448714495 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14488
- if (capsLocked || (modifiers & META) == META)
14496
+ if (capsLocked) // || (modifiers & META) == META)
1448914497 {
1449014498 mouseMode |= VR; // BACKFORTH;
1449114499 }
14492
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14500
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1449314501 {
1449414502 mouseMode |= SELECT;
1449514503 }
14496
- if ((modifiers & COMMAND) == COMMAND)
14504
+ if ((modifiersex & COMMAND) == COMMAND)
1449714505 {
1449814506 mouseMode |= SELECT;
1449914507 }
14500
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14508
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1450114509 {
1450214510 mouseMode &= ~VR;
1450314511 mouseMode |= TRANSLATE;
....@@ -14526,7 +14534,7 @@
1452614534
1452714535 if (isRenderer) //
1452814536 {
14529
- SetMouseMode(modifiers);
14537
+ SetMouseMode(0, modifiers);
1453014538 }
1453114539
1453214540 Globals.theRenderer.keyPressed(key);
....@@ -14986,7 +14994,7 @@
1498614994 //mode = ROTATE;
1498714995 if ((MODIFIERS & COMMAND) == 0) // VR??
1498814996 {
14989
- SetMouseMode(modifiers);
14997
+ SetMouseMode(0, modifiers);
1499014998 }
1499114999 }
1499215000
....@@ -15122,7 +15130,7 @@
1512215130 {
1512315131 //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
1512415132 //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15125
- if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
15133
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1512615134 {
1512715135 mouseMoved(e);
1512815136 } else
....@@ -15559,6 +15567,7 @@
1555915567 public boolean mouseDown(Event evt, int x, int y)
1556015568 {
1556115569 System.out.println("mouseDown: " + evt);
15570
+ System.exit(0);
1556215571 /*
1556315572 locked = true;
1556415573 drag = false;
....@@ -15602,7 +15611,7 @@
1560215611 {
1560315612 keyPressed(0, modifiers);
1560415613 }
15605
- clickStart(x, y, modifiers);
15614
+ // clickStart(x, y, modifiers);
1560615615 return true;
1560715616 }
1560815617
....@@ -15720,7 +15729,7 @@
1572015729 {
1572115730 keyReleased(0, 0);
1572215731 }
15723
- drag(x, y, modifiers);
15732
+ drag(x, y, 0, modifiers);
1572415733 return true;
1572515734 }
1572615735