Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
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;
....@@ -13690,7 +13694,7 @@
1369013694
1369113695 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1369213696
13693
- void clickStart(int x, int y, int modifiers)
13697
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1369413698 {
1369513699 if (!wasliveok)
1369613700 return;
....@@ -13707,7 +13711,7 @@
1370713711 // touched = true; // main DL
1370813712 if (isRenderer)
1370913713 {
13710
- SetMouseMode(modifiers);
13714
+ SetMouseMode(modifiers, modifiersex);
1371113715 }
1371213716
1371313717 selectX = anchorX = x;
....@@ -13720,7 +13724,7 @@
1372013724 clicked = true;
1372113725 hold = false;
1372213726
13723
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13727
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1372413728 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1372513729 {
1372613730 // System.out.println("RESTART II " + modifiers);
....@@ -13751,7 +13755,7 @@
1375113755 info.camera = renderCamera;
1375213756 info.x = x;
1375313757 info.y = y;
13754
- info.modifiers = modifiers;
13758
+ info.modifiers = modifiersex;
1375513759 editObj = object.doEditClick(info, 0);
1375613760 if (!editObj)
1375713761 {
....@@ -13780,7 +13784,7 @@
1378013784 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1378113785 }
1378213786 else
13783
- drag(e.getX(), e.getY(), e.getModifiersEx());
13787
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1378413788
1378513789 //try { Thread.sleep(1); } catch (Exception ex) {}
1378613790 }
....@@ -14017,7 +14021,7 @@
1401714021 {
1401814022 Globals.lighttouched = true;
1401914023 }
14020
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14024
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1402114025 }
1402214026 //else
1402314027 }
....@@ -14117,7 +14121,7 @@
1411714121 int X, Y;
1411814122 boolean SX, SY;
1411914123
14120
- void drag(int x, int y, int modifiers)
14124
+ void drag(int x, int y, int modifiers, int modifiersex)
1412114125 {
1412214126 if (IsFrozen())
1412314127 {
....@@ -14126,17 +14130,17 @@
1412614130
1412714131 drag = true; // NEW
1412814132
14129
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14133
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1413014134
1413114135 X = x;
1413214136 Y = y;
1413314137 // floating state for animation
14134
- MODIFIERS = modifiers;
14135
- modifiers &= ~1024;
14138
+ MODIFIERS = modifiersex;
14139
+ modifiersex &= ~1024;
1413614140 if (false) // modifiers != 0)
1413714141 {
1413814142 //new Exception().printStackTrace();
14139
- System.out.println("mouseDragged: " + modifiers);
14143
+ System.out.println("mouseDragged: " + modifiersex);
1414014144 System.out.println("SHIFT = " + SHIFT);
1414114145 System.out.println("CONTROL = " + COMMAND);
1414214146 System.out.println("META = " + META);
....@@ -14156,7 +14160,7 @@
1415614160 info.camera = renderCamera;
1415714161 info.x = x;
1415814162 info.y = y;
14159
- object.editWindow.copy.doEditDrag(info);
14163
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1416014164 } else
1416114165 {
1416214166 if (x < startX)
....@@ -14357,7 +14361,7 @@
1435714361
1435814362 if (control || command || IsFrozen())
1435914363 timeout = true;
14360
- else
14364
+// ?? May 2019 else
1436114365 // timer.setDelay((modifiers & 128) != 0?0:350);
1436214366 mouseDown = false;
1436314367 if (!control && !command) // june 2013
....@@ -14467,7 +14471,7 @@
1446714471 System.out.println("keyReleased: " + e);
1446814472 }
1446914473
14470
- void SetMouseMode(int modifiers)
14474
+ void SetMouseMode(int modifiers, int modifiersex)
1447114475 {
1447214476 //System.out.println("SetMouseMode = " + modifiers);
1447314477 //modifiers &= ~1024;
....@@ -14479,25 +14483,25 @@
1447914483 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1448014484 // return;
1448114485 //System.out.println("SetMode = " + modifiers);
14482
- if ((modifiers & WHEEL) == WHEEL)
14486
+ if ((modifiersex & WHEEL) == WHEEL)
1448314487 {
1448414488 mouseMode |= ZOOM;
1448514489 }
1448614490
1448714491 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14488
- if (capsLocked || (modifiers & META) == META)
14492
+ if (capsLocked) // || (modifiers & META) == META)
1448914493 {
1449014494 mouseMode |= VR; // BACKFORTH;
1449114495 }
14492
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14496
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1449314497 {
1449414498 mouseMode |= SELECT;
1449514499 }
14496
- if ((modifiers & COMMAND) == COMMAND)
14500
+ if ((modifiersex & COMMAND) == COMMAND)
1449714501 {
1449814502 mouseMode |= SELECT;
1449914503 }
14500
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14504
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1450114505 {
1450214506 mouseMode &= ~VR;
1450314507 mouseMode |= TRANSLATE;
....@@ -14526,7 +14530,7 @@
1452614530
1452714531 if (isRenderer) //
1452814532 {
14529
- SetMouseMode(modifiers);
14533
+ SetMouseMode(0, modifiers);
1453014534 }
1453114535
1453214536 Globals.theRenderer.keyPressed(key);
....@@ -14986,7 +14990,7 @@
1498614990 //mode = ROTATE;
1498714991 if ((MODIFIERS & COMMAND) == 0) // VR??
1498814992 {
14989
- SetMouseMode(modifiers);
14993
+ SetMouseMode(0, modifiers);
1499014994 }
1499114995 }
1499214996
....@@ -15122,7 +15126,7 @@
1512215126 {
1512315127 //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
1512415128 //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15125
- if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
15129
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1512615130 {
1512715131 mouseMoved(e);
1512815132 } else
....@@ -15559,6 +15563,7 @@
1555915563 public boolean mouseDown(Event evt, int x, int y)
1556015564 {
1556115565 System.out.println("mouseDown: " + evt);
15566
+ System.exit(0);
1556215567 /*
1556315568 locked = true;
1556415569 drag = false;
....@@ -15602,7 +15607,7 @@
1560215607 {
1560315608 keyPressed(0, modifiers);
1560415609 }
15605
- clickStart(x, y, modifiers);
15610
+ // clickStart(x, y, modifiers);
1560615611 return true;
1560715612 }
1560815613
....@@ -15720,7 +15725,7 @@
1572015725 {
1572115726 keyReleased(0, 0);
1572215727 }
15723
- drag(x, y, modifiers);
15728
+ drag(x, y, 0, modifiers);
1572415729 return true;
1572515730 }
1572615731