picrate 0.2.0-java → 0.3.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -5
- data/Rakefile +10 -2
- data/docs/_posts/2018-06-26-auto_install_picrate.md +15 -0
- data/lib/export.txt +8 -0
- data/lib/picrate/app.rb +4 -4
- data/lib/picrate/version.rb +1 -1
- data/picrate.gemspec +1 -1
- data/pom.rb +1 -1
- data/pom.xml +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +16 -85
- data/src/main/java/processing/awt/PShapeJava2D.java +9 -33
- data/src/main/java/processing/awt/PSurfaceAWT.java +76 -169
- data/src/main/java/processing/core/PApplet.java +14019 -15963
- data/src/main/java/processing/core/PConstants.java +475 -981
- data/src/main/java/processing/core/PFont.java +50 -202
- data/src/main/java/processing/core/PGraphics.java +7330 -8477
- data/src/main/java/processing/core/PImage.java +42 -212
- data/src/main/java/processing/core/PMatrix.java +21 -160
- data/src/main/java/processing/core/PMatrix2D.java +18 -178
- data/src/main/java/processing/core/PMatrix3D.java +48 -324
- data/src/main/java/processing/core/PShape.java +294 -1181
- data/src/main/java/processing/core/PShapeOBJ.java +16 -91
- data/src/main/java/processing/core/PShapeSVG.java +53 -253
- data/src/main/java/processing/core/PStyle.java +34 -179
- data/src/main/java/processing/core/PSurface.java +13 -94
- data/src/main/java/processing/core/PSurfaceNone.java +35 -140
- data/src/main/java/processing/core/PVector.java +10 -87
- data/src/main/java/processing/event/Event.java +86 -69
- data/src/main/java/processing/event/MouseEvent.java +102 -102
- data/src/main/java/processing/opengl/PGL.java +23 -16
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -10
- data/src/main/java/processing/opengl/PJOGL.java +32 -12
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +154 -0
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +2 -2
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +160 -0
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +2 -2
- metadata +7 -3
@@ -138,8 +138,6 @@ public class PVector implements Serializable {
|
|
138
138
|
|
139
139
|
/**
|
140
140
|
* Constructor for a 2D vector: z coordinate is set to 0.
|
141
|
-
* @param x
|
142
|
-
* @param y
|
143
141
|
*/
|
144
142
|
public PVector(float x, float y) {
|
145
143
|
this.x = x;
|
@@ -155,7 +153,6 @@ public class PVector implements Serializable {
|
|
155
153
|
*
|
156
154
|
* ( end auto-generated )
|
157
155
|
*
|
158
|
-
* @return
|
159
156
|
* @webref pvector:method
|
160
157
|
* @param x the x component of the vector
|
161
158
|
* @param y the y component of the vector
|
@@ -173,7 +170,6 @@ public class PVector implements Serializable {
|
|
173
170
|
/**
|
174
171
|
* @param x the x component of the vector
|
175
172
|
* @param y the y component of the vector
|
176
|
-
* @return
|
177
173
|
*/
|
178
174
|
public PVector set(float x, float y) {
|
179
175
|
this.x = x;
|
@@ -185,7 +181,6 @@ public class PVector implements Serializable {
|
|
185
181
|
|
186
182
|
/**
|
187
183
|
* @param v any variable of type PVector
|
188
|
-
* @return
|
189
184
|
*/
|
190
185
|
public PVector set(PVector v) {
|
191
186
|
x = v.x;
|
@@ -198,7 +193,6 @@ public class PVector implements Serializable {
|
|
198
193
|
/**
|
199
194
|
* Set the x, y (and maybe z) coordinates using a float[] array as the source.
|
200
195
|
* @param source array to copy from
|
201
|
-
* @return
|
202
196
|
*/
|
203
197
|
public PVector set(float[] source) {
|
204
198
|
if (source.length >= 2) {
|
@@ -256,8 +250,6 @@ public class PVector implements Serializable {
|
|
256
250
|
* Make a new 2D unit vector with a random direction. Pass in the parent
|
257
251
|
* PApplet if you want randomSeed() to work (and be predictable). Or leave
|
258
252
|
* it null and be... random.
|
259
|
-
* @param target
|
260
|
-
* @param parent
|
261
253
|
* @return the random PVector
|
262
254
|
*/
|
263
255
|
static public PVector random2D(PVector target, PApplet parent) {
|
@@ -308,8 +300,6 @@ public class PVector implements Serializable {
|
|
308
300
|
|
309
301
|
/**
|
310
302
|
* Make a new 3D unit vector with a random direction
|
311
|
-
* @param target
|
312
|
-
* @param parent
|
313
303
|
* @return the random PVector
|
314
304
|
*/
|
315
305
|
static public PVector random3D(PVector target, PApplet parent) {
|
@@ -355,7 +345,6 @@ public class PVector implements Serializable {
|
|
355
345
|
/**
|
356
346
|
* Make a new 2D unit vector from an angle
|
357
347
|
*
|
358
|
-
* @param angle
|
359
348
|
* @param target the target vector (if null, a new vector will be created)
|
360
349
|
* @return the PVector
|
361
350
|
*/
|
@@ -376,7 +365,6 @@ public class PVector implements Serializable {
|
|
376
365
|
*
|
377
366
|
* ( end auto-generated )
|
378
367
|
*
|
379
|
-
* @return
|
380
368
|
* @webref pvector:method
|
381
369
|
* @usage web_application
|
382
370
|
* @brief Get a copy of the vector
|
@@ -385,12 +373,8 @@ public class PVector implements Serializable {
|
|
385
373
|
return new PVector(x, y, z);
|
386
374
|
}
|
387
375
|
|
388
|
-
|
389
|
-
|
390
|
-
* @return
|
391
|
-
* @deprecated
|
392
|
-
*/
|
393
|
-
@Deprecated
|
376
|
+
|
377
|
+
@Deprecated
|
394
378
|
public PVector get() {
|
395
379
|
return copy();
|
396
380
|
}
|
@@ -398,7 +382,6 @@ public class PVector implements Serializable {
|
|
398
382
|
|
399
383
|
/**
|
400
384
|
* @param target
|
401
|
-
* @return
|
402
385
|
*/
|
403
386
|
public float[] get(float[] target) {
|
404
387
|
if (target == null) {
|
@@ -466,7 +449,6 @@ public class PVector implements Serializable {
|
|
466
449
|
*
|
467
450
|
* ( end auto-generated )
|
468
451
|
*
|
469
|
-
* @return
|
470
452
|
* @webref pvector:method
|
471
453
|
* @usage web_application
|
472
454
|
* @param v the vector to be added
|
@@ -483,7 +465,6 @@ public class PVector implements Serializable {
|
|
483
465
|
/**
|
484
466
|
* @param x x component of the vector
|
485
467
|
* @param y y component of the vector
|
486
|
-
* @return
|
487
468
|
*/
|
488
469
|
public PVector add(float x, float y) {
|
489
470
|
this.x += x;
|
@@ -493,10 +474,7 @@ public class PVector implements Serializable {
|
|
493
474
|
|
494
475
|
|
495
476
|
/**
|
496
|
-
* @param x
|
497
|
-
* @param y
|
498
477
|
* @param z z component of the vector
|
499
|
-
* @return
|
500
478
|
*/
|
501
479
|
public PVector add(float x, float y, float z) {
|
502
480
|
this.x += x;
|
@@ -510,7 +488,6 @@ public class PVector implements Serializable {
|
|
510
488
|
* Add two vectors
|
511
489
|
* @param v1 a vector
|
512
490
|
* @param v2 another vector
|
513
|
-
* @return
|
514
491
|
*/
|
515
492
|
static public PVector add(PVector v1, PVector v2) {
|
516
493
|
return add(v1, v2, null);
|
@@ -519,10 +496,7 @@ public class PVector implements Serializable {
|
|
519
496
|
|
520
497
|
/**
|
521
498
|
* Add two vectors into a target vector
|
522
|
-
* @param v1
|
523
499
|
* @param target the target vector (if null, a new vector will be created)
|
524
|
-
* @param v2
|
525
|
-
* @return
|
526
500
|
*/
|
527
501
|
static public PVector add(PVector v1, PVector v2, PVector target) {
|
528
502
|
if (target == null) {
|
@@ -545,7 +519,6 @@ public class PVector implements Serializable {
|
|
545
519
|
*
|
546
520
|
* ( end auto-generated )
|
547
521
|
*
|
548
|
-
* @return
|
549
522
|
* @webref pvector:method
|
550
523
|
* @usage web_application
|
551
524
|
* @param v any variable of type PVector
|
@@ -562,7 +535,6 @@ public class PVector implements Serializable {
|
|
562
535
|
/**
|
563
536
|
* @param x the x component of the vector
|
564
537
|
* @param y the y component of the vector
|
565
|
-
* @return
|
566
538
|
*/
|
567
539
|
public PVector sub(float x, float y) {
|
568
540
|
this.x -= x;
|
@@ -572,10 +544,7 @@ public class PVector implements Serializable {
|
|
572
544
|
|
573
545
|
|
574
546
|
/**
|
575
|
-
* @param x
|
576
|
-
* @param y
|
577
547
|
* @param z the z component of the vector
|
578
|
-
* @return
|
579
548
|
*/
|
580
549
|
public PVector sub(float x, float y, float z) {
|
581
550
|
this.x -= x;
|
@@ -589,7 +558,6 @@ public class PVector implements Serializable {
|
|
589
558
|
* Subtract one vector from another
|
590
559
|
* @param v1 the x, y, and z components of a PVector object
|
591
560
|
* @param v2 the x, y, and z components of a PVector object
|
592
|
-
* @return
|
593
561
|
*/
|
594
562
|
static public PVector sub(PVector v1, PVector v2) {
|
595
563
|
return sub(v1, v2, null);
|
@@ -598,10 +566,7 @@ public class PVector implements Serializable {
|
|
598
566
|
|
599
567
|
/**
|
600
568
|
* Subtract one vector from another and store in another vector
|
601
|
-
* @param v1
|
602
|
-
* @param v2
|
603
569
|
* @param target PVector in which to store the result
|
604
|
-
* @return
|
605
570
|
*/
|
606
571
|
static public PVector sub(PVector v1, PVector v2, PVector target) {
|
607
572
|
if (target == null) {
|
@@ -620,7 +585,6 @@ public class PVector implements Serializable {
|
|
620
585
|
*
|
621
586
|
* ( end auto-generated )
|
622
587
|
*
|
623
|
-
* @return
|
624
588
|
* @webref pvector:method
|
625
589
|
* @usage web_application
|
626
590
|
* @brief Multiply a vector by a scalar
|
@@ -636,8 +600,6 @@ public class PVector implements Serializable {
|
|
636
600
|
|
637
601
|
/**
|
638
602
|
* @param v the vector to multiply by the scalar
|
639
|
-
* @param n
|
640
|
-
* @return
|
641
603
|
*/
|
642
604
|
static public PVector mult(PVector v, float n) {
|
643
605
|
return mult(v, n, null);
|
@@ -646,10 +608,7 @@ public class PVector implements Serializable {
|
|
646
608
|
|
647
609
|
/**
|
648
610
|
* Multiply a vector by a scalar, and write the result into a target PVector.
|
649
|
-
* @param v
|
650
611
|
* @param target PVector in which to store the result
|
651
|
-
* @param n
|
652
|
-
* @return
|
653
612
|
*/
|
654
613
|
static public PVector mult(PVector v, float n, PVector target) {
|
655
614
|
if (target == null) {
|
@@ -668,7 +627,6 @@ public class PVector implements Serializable {
|
|
668
627
|
*
|
669
628
|
* ( end auto-generated )
|
670
629
|
*
|
671
|
-
* @return
|
672
630
|
* @webref pvector:method
|
673
631
|
* @usage web_application
|
674
632
|
* @brief Divide a vector by a scalar
|
@@ -685,7 +643,6 @@ public class PVector implements Serializable {
|
|
685
643
|
/**
|
686
644
|
* Divide a vector by a scalar and return the result in a new vector.
|
687
645
|
* @param v the vector to divide by the scalar
|
688
|
-
* @param n
|
689
646
|
* @return a new vector that is v1 / n
|
690
647
|
*/
|
691
648
|
static public PVector div(PVector v, float n) {
|
@@ -695,10 +652,7 @@ public class PVector implements Serializable {
|
|
695
652
|
|
696
653
|
/**
|
697
654
|
* Divide a vector by a scalar and store the result in another vector.
|
698
|
-
* @param v
|
699
655
|
* @param target PVector in which to store the result
|
700
|
-
* @param n
|
701
|
-
* @return
|
702
656
|
*/
|
703
657
|
static public PVector div(PVector v, float n, PVector target) {
|
704
658
|
if (target == null) {
|
@@ -718,7 +672,6 @@ public class PVector implements Serializable {
|
|
718
672
|
*
|
719
673
|
* ( end auto-generated )
|
720
674
|
*
|
721
|
-
* @return
|
722
675
|
* @webref pvector:method
|
723
676
|
* @usage web_application
|
724
677
|
* @param v the x, y, and z coordinates of a PVector
|
@@ -767,7 +720,6 @@ public class PVector implements Serializable {
|
|
767
720
|
* @param x x component of the vector
|
768
721
|
* @param y y component of the vector
|
769
722
|
* @param z z component of the vector
|
770
|
-
* @return
|
771
723
|
*/
|
772
724
|
public float dot(float x, float y, float z) {
|
773
725
|
return this.x*x + this.y*y + this.z*z;
|
@@ -777,7 +729,6 @@ public class PVector implements Serializable {
|
|
777
729
|
/**
|
778
730
|
* @param v1 any variable of type PVector
|
779
731
|
* @param v2 any variable of type PVector
|
780
|
-
* @return
|
781
732
|
*/
|
782
733
|
static public float dot(PVector v1, PVector v2) {
|
783
734
|
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
|
@@ -792,7 +743,6 @@ public class PVector implements Serializable {
|
|
792
743
|
*
|
793
744
|
* ( end auto-generated )
|
794
745
|
*
|
795
|
-
* @return
|
796
746
|
* @webref pvector:method
|
797
747
|
* @param v the vector to calculate the cross product
|
798
748
|
* @brief Calculate and return the cross product
|
@@ -805,7 +755,6 @@ public class PVector implements Serializable {
|
|
805
755
|
/**
|
806
756
|
* @param v any variable of type PVector
|
807
757
|
* @param target PVector to store the result
|
808
|
-
* @return
|
809
758
|
*/
|
810
759
|
public PVector cross(PVector v, PVector target) {
|
811
760
|
float crossX = y * v.z - v.y * z;
|
@@ -825,7 +774,6 @@ public class PVector implements Serializable {
|
|
825
774
|
* @param v1 any variable of type PVector
|
826
775
|
* @param v2 any variable of type PVector
|
827
776
|
* @param target PVector to store the result
|
828
|
-
* @return
|
829
777
|
*/
|
830
778
|
static public PVector cross(PVector v1, PVector v2, PVector target) {
|
831
779
|
float crossX = v1.y * v2.z - v2.y * v1.z;
|
@@ -848,7 +796,6 @@ public class PVector implements Serializable {
|
|
848
796
|
*
|
849
797
|
* ( end auto-generated )
|
850
798
|
*
|
851
|
-
* @return
|
852
799
|
* @webref pvector:method
|
853
800
|
* @usage web_application
|
854
801
|
* @brief Normalize the vector to a length of 1
|
@@ -887,7 +834,6 @@ public class PVector implements Serializable {
|
|
887
834
|
*
|
888
835
|
* ( end auto-generated )
|
889
836
|
*
|
890
|
-
* @return
|
891
837
|
* @webref pvector:method
|
892
838
|
* @usage web_application
|
893
839
|
* @param max the maximum magnitude for the vector
|
@@ -909,7 +855,6 @@ public class PVector implements Serializable {
|
|
909
855
|
*
|
910
856
|
* ( end auto-generated )
|
911
857
|
*
|
912
|
-
* @return
|
913
858
|
* @webref pvector:method
|
914
859
|
* @usage web_application
|
915
860
|
* @param len the new length for this vector
|
@@ -952,12 +897,8 @@ public class PVector implements Serializable {
|
|
952
897
|
return angle;
|
953
898
|
}
|
954
899
|
|
955
|
-
|
956
|
-
|
957
|
-
* @return
|
958
|
-
* @deprecated
|
959
|
-
*/
|
960
|
-
@Deprecated
|
900
|
+
|
901
|
+
@Deprecated
|
961
902
|
public float heading2D() {
|
962
903
|
return heading();
|
963
904
|
}
|
@@ -970,7 +911,6 @@ public class PVector implements Serializable {
|
|
970
911
|
*
|
971
912
|
* ( end auto-generated )
|
972
913
|
*
|
973
|
-
* @return
|
974
914
|
* @webref pvector:method
|
975
915
|
* @usage web_application
|
976
916
|
* @brief Rotate the vector by an angle (2D only)
|
@@ -992,7 +932,6 @@ public class PVector implements Serializable {
|
|
992
932
|
*
|
993
933
|
* ( end auto-generated )
|
994
934
|
*
|
995
|
-
* @return
|
996
935
|
* @webref pvector:method
|
997
936
|
* @usage web_application
|
998
937
|
* @brief Linear interpolate the vector to another vector
|
@@ -1012,8 +951,6 @@ public class PVector implements Serializable {
|
|
1012
951
|
* Linear interpolate between two vectors (returns a new PVector object)
|
1013
952
|
* @param v1 the vector to start from
|
1014
953
|
* @param v2 the vector to lerp to
|
1015
|
-
* @param amt
|
1016
|
-
* @return
|
1017
954
|
*/
|
1018
955
|
public static PVector lerp(PVector v1, PVector v2, float amt) {
|
1019
956
|
PVector v = v1.copy();
|
@@ -1027,8 +964,6 @@ public class PVector implements Serializable {
|
|
1027
964
|
* @param x the x component to lerp to
|
1028
965
|
* @param y the y component to lerp to
|
1029
966
|
* @param z the z component to lerp to
|
1030
|
-
* @param amt
|
1031
|
-
* @return
|
1032
967
|
*/
|
1033
968
|
public PVector lerp(float x, float y, float z, float amt) {
|
1034
969
|
this.x = PApplet.lerp(this.x, x, amt);
|
@@ -1045,7 +980,6 @@ public class PVector implements Serializable {
|
|
1045
980
|
*
|
1046
981
|
* ( end auto-generated )
|
1047
982
|
*
|
1048
|
-
* @return
|
1049
983
|
* @webref pvector:method
|
1050
984
|
* @usage web_application
|
1051
985
|
* @param v1 the x, y, and z components of a PVector
|
@@ -1077,11 +1011,8 @@ public class PVector implements Serializable {
|
|
1077
1011
|
return (float) Math.acos(amt);
|
1078
1012
|
}
|
1079
1013
|
|
1080
|
-
|
1081
|
-
|
1082
|
-
* @return
|
1083
|
-
*/
|
1084
|
-
@Override
|
1014
|
+
|
1015
|
+
@Override
|
1085
1016
|
public String toString() {
|
1086
1017
|
return "[ " + x + ", " + y + ", " + z + " ]";
|
1087
1018
|
}
|
@@ -1096,7 +1027,6 @@ public class PVector implements Serializable {
|
|
1096
1027
|
*
|
1097
1028
|
* ( end auto-generated )
|
1098
1029
|
*
|
1099
|
-
* @return
|
1100
1030
|
* @webref pvector:method
|
1101
1031
|
* @usage: web_application
|
1102
1032
|
* @brief Return a representation of the vector as a float array
|
@@ -1111,12 +1041,8 @@ public class PVector implements Serializable {
|
|
1111
1041
|
return array;
|
1112
1042
|
}
|
1113
1043
|
|
1114
|
-
|
1115
|
-
|
1116
|
-
* @param obj
|
1117
|
-
* @return
|
1118
|
-
*/
|
1119
|
-
@Override
|
1044
|
+
|
1045
|
+
@Override
|
1120
1046
|
public boolean equals(Object obj) {
|
1121
1047
|
if (!(obj instanceof PVector)) {
|
1122
1048
|
return false;
|
@@ -1125,11 +1051,8 @@ public class PVector implements Serializable {
|
|
1125
1051
|
return x == p.x && y == p.y && z == p.z;
|
1126
1052
|
}
|
1127
1053
|
|
1128
|
-
|
1129
|
-
|
1130
|
-
* @return
|
1131
|
-
*/
|
1132
|
-
@Override
|
1054
|
+
|
1055
|
+
@Override
|
1133
1056
|
public int hashCode() {
|
1134
1057
|
int result = 1;
|
1135
1058
|
result = 31 * result + Float.floatToIntBits(x);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
2
|
|
3
|
-
|
3
|
+
/*
|
4
4
|
Part of the Processing project - http://processing.org
|
5
5
|
|
6
6
|
Copyright (c) 2012 The Processing Foundation
|
@@ -18,91 +18,108 @@
|
|
18
18
|
Public License along with this library; if not, write to the
|
19
19
|
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
20
20
|
Boston, MA 02111-1307 USA
|
21
|
-
|
21
|
+
*/
|
22
|
+
|
22
23
|
package processing.event;
|
23
24
|
|
25
|
+
|
24
26
|
public class Event {
|
27
|
+
protected Object nativeObject;
|
28
|
+
|
29
|
+
protected long millis;
|
30
|
+
protected int action;
|
31
|
+
|
32
|
+
// These correspond to the java.awt.Event modifiers (not to be confused with
|
33
|
+
// the newer getModifiersEx), though they're not guaranteed to in the future.
|
34
|
+
static public final int SHIFT = 1 << 0;
|
35
|
+
static public final int CTRL = 1 << 1;
|
36
|
+
static public final int META = 1 << 2;
|
37
|
+
static public final int ALT = 1 << 3;
|
38
|
+
protected int modifiers;
|
39
|
+
|
40
|
+
// Types of events. As with all constants in Processing, brevity's preferred.
|
41
|
+
static public final int KEY = 1;
|
42
|
+
static public final int MOUSE = 2;
|
43
|
+
static public final int TOUCH = 3;
|
44
|
+
protected int flavor;
|
45
|
+
|
46
|
+
|
47
|
+
public Event(Object nativeObject, long millis, int action, int modifiers) {
|
48
|
+
this.nativeObject = nativeObject;
|
49
|
+
this.millis = millis;
|
50
|
+
this.action = action;
|
51
|
+
this.modifiers = modifiers;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
public int getFlavor() {
|
56
|
+
return flavor;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Get the platform-native event object. This might be the java.awt event
|
62
|
+
* on the desktop, though if you're using OpenGL on the desktop it'll be a
|
63
|
+
* NEWT event that JOGL uses. Android events are something else altogether.
|
64
|
+
* Bottom line, use this only if you know what you're doing, and don't make
|
65
|
+
* assumptions about the class type.
|
66
|
+
*/
|
67
|
+
public Object getNative() {
|
68
|
+
return nativeObject;
|
69
|
+
}
|
25
70
|
|
26
|
-
protected Object nativeObject;
|
27
|
-
|
28
|
-
protected long millis;
|
29
|
-
protected int action;
|
30
|
-
|
31
|
-
// These correspond to the java.awt.Event modifiers (not to be confused with
|
32
|
-
// the newer getModifiersEx), though they're not guaranteed to in the future.
|
33
|
-
static public final int SHIFT = 1;
|
34
|
-
static public final int CTRL = 1 << 1;
|
35
|
-
static public final int META = 1 << 2;
|
36
|
-
static public final int ALT = 1 << 3;
|
37
|
-
protected int modifiers;
|
38
|
-
|
39
|
-
// Types of events. As with all constants in Processing, brevity's preferred.
|
40
|
-
static public final int KEY = 1;
|
41
|
-
static public final int MOUSE = 2;
|
42
|
-
static public final int TOUCH = 3;
|
43
|
-
protected int flavor;
|
44
|
-
|
45
|
-
public Event(Object nativeObject, long millis, int action, int modifiers) {
|
46
|
-
this.nativeObject = nativeObject;
|
47
|
-
this.millis = millis;
|
48
|
-
this.action = action;
|
49
|
-
this.modifiers = modifiers;
|
50
|
-
}
|
51
|
-
|
52
|
-
public int getFlavor() {
|
53
|
-
return flavor;
|
54
|
-
}
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Get the platform-native event object. This might be the java.awt event on
|
58
|
-
* the desktop, though if you're using OpenGL on the desktop it'll be a NEWT
|
59
|
-
* event that JOGL uses. Android events are something else altogether.
|
60
|
-
* Bottom line, use this only if you know what you're doing, and don't make
|
61
|
-
* assumptions about the class type.
|
62
|
-
*
|
63
|
-
* @return
|
64
|
-
*/
|
65
|
-
public Object getNative() {
|
66
|
-
return nativeObject;
|
67
|
-
}
|
68
71
|
|
69
72
|
// public void setNative(Object nativeObject) {
|
70
73
|
// this.nativeObject = nativeObject;
|
71
74
|
// }
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
|
76
|
+
|
77
|
+
public long getMillis() {
|
78
|
+
return millis;
|
79
|
+
}
|
80
|
+
|
75
81
|
|
76
82
|
// public void setMillis(long millis) {
|
77
83
|
// this.millis = millis;
|
78
84
|
// }
|
79
|
-
|
80
|
-
|
81
|
-
|
85
|
+
|
86
|
+
|
87
|
+
public int getAction() {
|
88
|
+
return action;
|
89
|
+
}
|
90
|
+
|
82
91
|
|
83
92
|
// public void setAction(int action) {
|
84
93
|
// this.action = action;
|
85
94
|
// }
|
86
|
-
|
87
|
-
|
88
|
-
|
95
|
+
|
96
|
+
|
97
|
+
public int getModifiers() {
|
98
|
+
return modifiers;
|
99
|
+
}
|
100
|
+
|
89
101
|
|
90
102
|
// public void setModifiers(int modifiers) {
|
91
103
|
// this.modifiers = modifiers;
|
92
104
|
// }
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
|
106
|
+
|
107
|
+
public boolean isShiftDown() {
|
108
|
+
return (modifiers & SHIFT) != 0;
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
public boolean isControlDown() {
|
113
|
+
return (modifiers & CTRL) != 0;
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
public boolean isMetaDown() {
|
118
|
+
return (modifiers & META) != 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
public boolean isAltDown() {
|
123
|
+
return (modifiers & ALT) != 0;
|
124
|
+
}
|
125
|
+
}
|