propane 3.10.0-java → 3.11.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  3. data/CHANGELOG.md +2 -0
  4. data/README.md +7 -7
  5. data/lib/propane/app.rb +2 -5
  6. data/lib/propane/helper_methods.rb +6 -6
  7. data/lib/propane/version.rb +1 -1
  8. data/lib/{propane-3.10.0.jar → propane-3.11.0.jar} +0 -0
  9. data/pom.rb +6 -6
  10. data/pom.xml +6 -6
  11. data/propane.gemspec +3 -3
  12. data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
  13. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -13
  14. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +14 -28
  15. data/src/main/java/processing/awt/PImageAWT.java +6 -4
  16. data/src/main/java/processing/core/PApplet.java +71 -59
  17. data/src/main/java/processing/core/PImage.java +14 -14
  18. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  19. data/src/main/java/processing/opengl/PShader.java +1 -6
  20. data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
  21. data/{lib/java/processing/opengl → src/main/resources}/cursors/arrow.png +0 -0
  22. data/{lib/java/processing/opengl → src/main/resources}/cursors/cross.png +0 -0
  23. data/{lib/java/processing/opengl → src/main/resources}/cursors/hand.png +0 -0
  24. data/{lib/java/processing/opengl → src/main/resources}/cursors/license.txt +0 -0
  25. data/{lib/java/processing/opengl → src/main/resources}/cursors/move.png +0 -0
  26. data/{lib/java/processing/opengl → src/main/resources}/cursors/text.png +0 -0
  27. data/{lib/java/processing/opengl → src/main/resources}/cursors/wait.png +0 -0
  28. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorFrag.glsl +0 -0
  29. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorVert.glsl +0 -0
  30. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightFrag.glsl +0 -0
  31. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightVert.glsl +0 -0
  32. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineFrag.glsl +0 -0
  33. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineVert.glsl +0 -0
  34. data/{lib/java/processing/opengl → src/main/resources}/shaders/MaskFrag.glsl +0 -0
  35. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointFrag.glsl +0 -0
  36. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointVert.glsl +0 -0
  37. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexFrag.glsl +0 -0
  38. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightFrag.glsl +0 -0
  39. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightVert.glsl +0 -0
  40. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexVert.glsl +0 -0
  41. data/test/test_helper.rb +1 -0
  42. data/vendors/Rakefile +1 -1
  43. metadata +29 -155
  44. data/lib/java/japplemenubar/JAppleMenuBar.java +0 -88
  45. data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  46. data/lib/java/monkstone/ColorUtil.java +0 -127
  47. data/lib/java/monkstone/MathToolModule.java +0 -287
  48. data/lib/java/monkstone/PropaneLibrary.java +0 -46
  49. data/lib/java/monkstone/core/LibraryProxy.java +0 -136
  50. data/lib/java/monkstone/fastmath/DegLutTables.java +0 -111
  51. data/lib/java/monkstone/fastmath/Deglut.java +0 -71
  52. data/lib/java/monkstone/fastmath/package-info.java +0 -6
  53. data/lib/java/monkstone/filechooser/Chooser.java +0 -39
  54. data/lib/java/monkstone/noise/FastTerrain.java +0 -874
  55. data/lib/java/monkstone/noise/Noise.java +0 -90
  56. data/lib/java/monkstone/noise/NoiseGenerator.java +0 -75
  57. data/lib/java/monkstone/noise/NoiseMode.java +0 -28
  58. data/lib/java/monkstone/noise/OpenSimplex2F.java +0 -881
  59. data/lib/java/monkstone/noise/OpenSimplex2S.java +0 -1106
  60. data/lib/java/monkstone/noise/SmoothTerrain.java +0 -1099
  61. data/lib/java/monkstone/slider/CustomHorizontalSlider.java +0 -164
  62. data/lib/java/monkstone/slider/CustomVerticalSlider.java +0 -178
  63. data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +0 -145
  64. data/lib/java/monkstone/slider/SimpleSlider.java +0 -166
  65. data/lib/java/monkstone/slider/SimpleVerticalSlider.java +0 -157
  66. data/lib/java/monkstone/slider/Slider.java +0 -61
  67. data/lib/java/monkstone/slider/SliderBar.java +0 -245
  68. data/lib/java/monkstone/slider/SliderGroup.java +0 -56
  69. data/lib/java/monkstone/slider/WheelHandler.java +0 -35
  70. data/lib/java/monkstone/vecmath/GfxRender.java +0 -86
  71. data/lib/java/monkstone/vecmath/JRender.java +0 -56
  72. data/lib/java/monkstone/vecmath/ShapeRender.java +0 -87
  73. data/lib/java/monkstone/vecmath/package-info.java +0 -20
  74. data/lib/java/monkstone/vecmath/vec2/Vec2.java +0 -802
  75. data/lib/java/monkstone/vecmath/vec2/package-info.java +0 -6
  76. data/lib/java/monkstone/vecmath/vec3/Vec3.java +0 -727
  77. data/lib/java/monkstone/vecmath/vec3/package-info.java +0 -6
  78. data/lib/java/monkstone/videoevent/CaptureEvent.java +0 -27
  79. data/lib/java/monkstone/videoevent/MovieEvent.java +0 -32
  80. data/lib/java/monkstone/videoevent/package-info.java +0 -20
  81. data/lib/java/processing/awt/PGraphicsJava2D.java +0 -3040
  82. data/lib/java/processing/awt/PImageAWT.java +0 -377
  83. data/lib/java/processing/awt/PShapeJava2D.java +0 -387
  84. data/lib/java/processing/awt/PSurfaceAWT.java +0 -1581
  85. data/lib/java/processing/awt/ShimAWT.java +0 -581
  86. data/lib/java/processing/core/PApplet.java +0 -15156
  87. data/lib/java/processing/core/PConstants.java +0 -523
  88. data/lib/java/processing/core/PFont.java +0 -1126
  89. data/lib/java/processing/core/PGraphics.java +0 -8600
  90. data/lib/java/processing/core/PImage.java +0 -3377
  91. data/lib/java/processing/core/PMatrix.java +0 -208
  92. data/lib/java/processing/core/PMatrix2D.java +0 -562
  93. data/lib/java/processing/core/PMatrix3D.java +0 -890
  94. data/lib/java/processing/core/PShape.java +0 -3561
  95. data/lib/java/processing/core/PShapeOBJ.java +0 -483
  96. data/lib/java/processing/core/PShapeSVG.java +0 -2016
  97. data/lib/java/processing/core/PStyle.java +0 -63
  98. data/lib/java/processing/core/PSurface.java +0 -198
  99. data/lib/java/processing/core/PSurfaceNone.java +0 -431
  100. data/lib/java/processing/core/PVector.java +0 -1066
  101. data/lib/java/processing/core/ThinkDifferent.java +0 -115
  102. data/lib/java/processing/data/DoubleDict.java +0 -850
  103. data/lib/java/processing/data/DoubleList.java +0 -928
  104. data/lib/java/processing/data/FloatDict.java +0 -847
  105. data/lib/java/processing/data/FloatList.java +0 -936
  106. data/lib/java/processing/data/IntDict.java +0 -807
  107. data/lib/java/processing/data/IntList.java +0 -936
  108. data/lib/java/processing/data/JSONArray.java +0 -1260
  109. data/lib/java/processing/data/JSONObject.java +0 -2282
  110. data/lib/java/processing/data/JSONTokener.java +0 -435
  111. data/lib/java/processing/data/LongDict.java +0 -802
  112. data/lib/java/processing/data/LongList.java +0 -937
  113. data/lib/java/processing/data/Sort.java +0 -46
  114. data/lib/java/processing/data/StringDict.java +0 -613
  115. data/lib/java/processing/data/StringList.java +0 -800
  116. data/lib/java/processing/data/Table.java +0 -4936
  117. data/lib/java/processing/data/TableRow.java +0 -198
  118. data/lib/java/processing/data/XML.java +0 -1156
  119. data/lib/java/processing/dxf/RawDXF.java +0 -404
  120. data/lib/java/processing/event/Event.java +0 -125
  121. data/lib/java/processing/event/KeyEvent.java +0 -70
  122. data/lib/java/processing/event/MouseEvent.java +0 -114
  123. data/lib/java/processing/event/TouchEvent.java +0 -57
  124. data/lib/java/processing/javafx/PGraphicsFX2D.java +0 -32
  125. data/lib/java/processing/javafx/PSurfaceFX.java +0 -173
  126. data/lib/java/processing/net/Client.java +0 -744
  127. data/lib/java/processing/net/Server.java +0 -388
  128. data/lib/java/processing/opengl/FontTexture.java +0 -378
  129. data/lib/java/processing/opengl/FrameBuffer.java +0 -513
  130. data/lib/java/processing/opengl/LinePath.java +0 -627
  131. data/lib/java/processing/opengl/LineStroker.java +0 -681
  132. data/lib/java/processing/opengl/PGL.java +0 -3483
  133. data/lib/java/processing/opengl/PGraphics2D.java +0 -615
  134. data/lib/java/processing/opengl/PGraphics3D.java +0 -281
  135. data/lib/java/processing/opengl/PGraphicsOpenGL.java +0 -13753
  136. data/lib/java/processing/opengl/PJOGL.java +0 -2008
  137. data/lib/java/processing/opengl/PShader.java +0 -1484
  138. data/lib/java/processing/opengl/PShapeOpenGL.java +0 -5269
  139. data/lib/java/processing/opengl/PSurfaceJOGL.java +0 -1385
  140. data/lib/java/processing/opengl/Texture.java +0 -1696
  141. data/lib/java/processing/opengl/VertexBuffer.java +0 -88
  142. data/lib/java/processing/pdf/PGraphicsPDF.java +0 -581
  143. data/lib/java/processing/svg/PGraphicsSVG.java +0 -378
  144. data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
  145. data/src/main/java/processing/opengl/cursors/cross.png +0 -0
  146. data/src/main/java/processing/opengl/cursors/hand.png +0 -0
  147. data/src/main/java/processing/opengl/cursors/license.txt +0 -27
  148. data/src/main/java/processing/opengl/cursors/move.png +0 -0
  149. data/src/main/java/processing/opengl/cursors/text.png +0 -0
  150. data/src/main/java/processing/opengl/cursors/wait.png +0 -0
  151. data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +0 -32
  152. data/src/main/java/processing/opengl/shaders/ColorVert.glsl +0 -34
  153. data/src/main/java/processing/opengl/shaders/LightFrag.glsl +0 -33
  154. data/src/main/java/processing/opengl/shaders/LightVert.glsl +0 -151
  155. data/src/main/java/processing/opengl/shaders/LineFrag.glsl +0 -32
  156. data/src/main/java/processing/opengl/shaders/LineVert.glsl +0 -100
  157. data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +0 -40
  158. data/src/main/java/processing/opengl/shaders/PointFrag.glsl +0 -32
  159. data/src/main/java/processing/opengl/shaders/PointVert.glsl +0 -56
  160. data/src/main/java/processing/opengl/shaders/TexFrag.glsl +0 -37
  161. data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +0 -37
  162. data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +0 -157
  163. data/src/main/java/processing/opengl/shaders/TexVert.glsl +0 -38
@@ -1,157 +0,0 @@
1
- /*
2
- * Copyright (c) 2015-20 Martin Prout
3
- *
4
- * This library is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU Lesser General Public
6
- * License as published by the Free Software Foundation; either
7
- * version 2.1 of the License, or (at your option) any later version.
8
- *
9
- * http://creativecommons.org/licenses/LGPL/2.1/
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
- */
20
- package monkstone.slider;
21
-
22
- import processing.core.PApplet;
23
- import processing.core.PConstants;
24
- import static processing.core.PConstants.HALF_PI;
25
-
26
- public class SimpleVerticalSlider extends SimpleSlider {
27
-
28
- final int SPACING = 20;
29
- final int TOP_SPC = SPACING * 2;
30
- final int BOTTOM_SPC = SPACING * 4;
31
-
32
- /**
33
- *
34
- * @param outer
35
- * @param beginRange start range
36
- * @param endRange end range
37
- * @param initial
38
- * @param count
39
- */
40
- public SimpleVerticalSlider(final PApplet outer, float beginRange, float endRange, float initial, int count) {
41
- this.applet = outer;
42
- setActive(true);
43
- pX = outer.width - (TOP_SPC + count * SPACING);
44
- pY = TOP_SPC;
45
- pW = outer.height - BOTTOM_SPC;
46
- pH = 10;
47
- ID = Integer.toString(count + 1);
48
- limits(beginRange, endRange);
49
-
50
- }
51
-
52
- @Override
53
- boolean mouseOver() {
54
- return (applet.mouseX >= pX && applet.mouseX <= pX + pH && applet.mouseY >= pY && applet.mouseY <= pY + pW);
55
- }
56
-
57
- private void setActive(boolean active) {
58
- if (active) {
59
- applet.registerMethod("dispose", this);
60
- applet.registerMethod("draw", this);
61
- } else {
62
- applet.unregisterMethod("draw", this);
63
- }
64
- }
65
-
66
- @Override
67
- void displayText() {
68
- String lFormat = "%d";
69
- if (displayLabel) {
70
- applet.fill(labelColor);
71
- applet.textSize(labelSize);
72
- applet.textAlign(PConstants.CENTER);
73
- applet.pushMatrix();
74
- applet.translate(pX + pH / 2, pY + pW / 2);
75
- applet.rotate(HALF_PI);
76
- applet.text(Integer.toString((int) pValue), 0, 0 + labelSize / 2 - 2);
77
- applet.popMatrix();
78
- }
79
- if (displayValue) {
80
- applet.textSize(numberSize);
81
- applet.fill(numbersColor);
82
- applet.pushMatrix();
83
- applet.textAlign(PConstants.RIGHT);
84
- applet.translate(pX - numberSize / 2, pY);
85
- applet.rotate(HALF_PI);
86
- applet.text(String.format(lFormat, (int) vMax), 0, 0);
87
- applet.popMatrix();
88
- applet.pushMatrix();
89
- applet.textAlign(PConstants.LEFT);
90
- applet.translate(pX - numberSize / 2, pY + pW);
91
- applet.rotate(HALF_PI);
92
- applet.text(String.format(lFormat, (int) vMin), 0, 0);
93
- applet.popMatrix();
94
- }
95
- }
96
-
97
- @Override
98
- void drawGui() {
99
- if (backgroundVisible) {
100
- applet.fill(sliderBack);
101
- applet.rect(pX, pY, pH, pW);
102
- }
103
- applet.fill(sliderFill);
104
- applet.ellipse(pX + pH / 2, pY + pScaled, 10, 10);
105
- }
106
-
107
- /**
108
- *
109
- * @param value
110
- */
111
- @Override
112
- public void setValue(float value) {
113
- if (value > vMax) {
114
- value = vMax;
115
- }
116
- if (value < vMin) {
117
- value = vMin;
118
- }
119
- pValue = value;
120
- pScaled = map(pValue, vMin, vMax, pW, 0);
121
- }
122
-
123
- @Override
124
- void checkKeyboard() {
125
- if (mouseOver()) {
126
- if (applet.mousePressed && applet.mouseButton == PConstants.LEFT) {
127
- pValue = constrainMap(applet.mouseY - pY, pW, 0, vMin, vMax);
128
- }
129
- if (applet.keyPressed && pressOnlyOnce) {
130
- if (applet.keyCode == PConstants.LEFT || applet.keyCode == PConstants.DOWN) {
131
- pValue--;
132
- }
133
- if (applet.keyCode == PConstants.RIGHT || applet.keyCode == PConstants.UP) {
134
- pValue++;
135
- }
136
- if (pValue > vMax) {
137
- pValue = vMax;
138
- } else {
139
- pValue = (pValue < vMin) ? vMin : pValue;
140
- }
141
- pressOnlyOnce = false;
142
- }
143
- deBounce(5);
144
- pScaled = map(pValue, vMin, vMax, pW, 0);
145
- }
146
- }
147
-
148
- /**
149
- *
150
- * @return
151
- */
152
- @Override
153
- public String toString() {
154
- String geomF = "SimpleHSliderBar.new(%d, %d, %d, %.2f, %.2f, \"%s\")";
155
- return String.format(geomF, pX, pY, pW, vMin, vMax, ID);
156
- }
157
- }
@@ -1,61 +0,0 @@
1
- /*
2
- * To change this license header, choose License Headers in Project Properties.
3
- * To change this template file, choose Tools | Templates
4
- * and open the template in the editor.
5
- */
6
- package monkstone.slider;
7
-
8
- /**
9
- *
10
- * @author tux
11
- */
12
- public interface Slider {
13
-
14
- void dispose();
15
-
16
- void draw();
17
-
18
- /**
19
- *
20
- */
21
- void hideBackground();
22
-
23
- /**
24
- *
25
- */
26
- void hideLabel();
27
-
28
- /**
29
- *
30
- */
31
- void hideNumbers();
32
-
33
- /**
34
- *
35
- * @param s
36
- */
37
- void labelSize(int s);
38
-
39
- /**
40
- *
41
- * @return
42
- */
43
- float readValue();
44
-
45
- /**
46
- *
47
- * @param value
48
- */
49
- void setValue(float value);
50
-
51
- /**
52
- *
53
- */
54
- void showLabel();
55
-
56
- /**
57
- *
58
- */
59
- void showNumbers();
60
-
61
- }
@@ -1,245 +0,0 @@
1
- /*
2
- * Copyright (c) 2015-20 Martin Prout
3
- *
4
- * This library is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU Lesser General Public
6
- * License as published by the Free Software Foundation; either
7
- * version 2.1 of the License, or (at your option) any later version.
8
- *
9
- * http://creativecommons.org/licenses/LGPL/2.1/
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
- */
20
- package monkstone.slider;
21
-
22
- import processing.core.PApplet;
23
- import processing.event.MouseEvent;
24
-
25
- public abstract class SliderBar implements Slider {
26
-
27
- int MIN_BAR_WIDTH = 10;
28
- int MAX_BAR_WIDTH = 30;
29
- int sliderBack = 0xff909090;
30
- int sliderFill = 0xff696969;
31
- int borderColor = 0;
32
- int numbersColor = 0;
33
- int labelColor = 0;
34
- int externalBorder = 0;
35
- boolean backgroundVisible = true;
36
- int labelSize = 18;
37
- int numberSize = 14;
38
- boolean displayLabel = false;
39
- boolean displayValue = true;
40
- int pX;
41
- int pY;
42
- int pW;
43
- int pH;
44
- float pScaled = 0;
45
- float pValue = 0;
46
- String ID;
47
- boolean pressOnlyOnce = true;
48
- int deb = 0;
49
- short wheelCount = 0;
50
- float vMin = 0;
51
- float vMax = 15;
52
- PApplet applet;
53
- WheelHandler scrollWheelHandler;
54
-
55
- /**
56
- *
57
- * @return
58
- */
59
- public float value() {
60
- return pValue;
61
- }
62
-
63
- /**
64
- *
65
- * @param w
66
- */
67
- public void barWidth(int w) {
68
- if (w < MIN_BAR_WIDTH) {
69
- pH = MIN_BAR_WIDTH;
70
- } else {
71
- pH = (w > MAX_BAR_WIDTH) ? MAX_BAR_WIDTH : w;
72
- }
73
- }
74
-
75
- final void limits(float iv, float fv) {
76
- vMin = iv;
77
- vMax = fv;
78
- SliderBar.this.setValue(iv);
79
- }
80
-
81
- /**
82
- *
83
- */
84
- @Override
85
- public void showLabel() {
86
- displayLabel = true;
87
- }
88
-
89
- /**
90
- *
91
- */
92
- @Override
93
- public void hideLabel() {
94
- displayLabel = false;
95
- }
96
-
97
- /**
98
- *
99
- */
100
- @Override
101
- public void showNumbers() {
102
- displayValue = true;
103
- }
104
-
105
- /**
106
- *
107
- */
108
- @Override
109
- public void hideNumbers() {
110
- displayValue = false;
111
- }
112
-
113
- /**
114
- *
115
- * @param b
116
- */
117
- public void externalBorder(int b) {
118
- externalBorder = b;
119
- }
120
-
121
- /**
122
- *
123
- */
124
- @Override
125
- public void hideBackground() {
126
- backgroundVisible = false;
127
- }
128
-
129
- /**
130
- *
131
- */
132
- public void showBackground() {
133
- backgroundVisible = true;
134
- }
135
-
136
- /**
137
- *
138
- * @param s
139
- */
140
- @Override
141
- public void labelSize(int s) {
142
- labelSize = (s < 4) ? 4 : s;
143
- }
144
-
145
- /**
146
- * @param back color of the bar
147
- * @param fill background color of the slider
148
- */
149
- public void widgetColors(int back, int fill) {
150
- sliderBack = back;
151
- sliderFill = fill;
152
- }
153
-
154
- abstract boolean mouseOver();
155
-
156
- private void setActive(boolean active) {
157
- if (active) {
158
- applet.registerMethod("dispose", this);
159
- applet.registerMethod("draw", this);
160
- applet.registerMethod("mouseEvent", this);
161
- } else {
162
- applet.unregisterMethod("draw", this);
163
- applet.unregisterMethod("mouseEvent", this);
164
- }
165
- }
166
-
167
- abstract void displayText();
168
-
169
- abstract void drawGui();
170
-
171
- @Override
172
- public void draw() {
173
- applet.pushStyle();
174
- applet.noStroke();
175
- drawGui();
176
- displayText();
177
- applet.popStyle();
178
- change();
179
- }
180
-
181
- public void mouseEvent(MouseEvent evt) {
182
- if (evt.getAction() == MouseEvent.WHEEL) {
183
- if (scrollWheelHandler != null) {
184
- scrollWheelHandler.handleWheel((short) evt.getCount());
185
- }
186
- }
187
- }
188
-
189
- /**
190
- *
191
- * @param value
192
- */
193
- @Override
194
- public abstract void setValue(float value);
195
-
196
- abstract void checkKeyboard();
197
-
198
- void change() {
199
- checkKeyboard();
200
- }
201
-
202
- /**
203
- *
204
- * @return
205
- */
206
- @Override
207
- public float readValue() {
208
- return pValue;
209
- }
210
-
211
- /**
212
- *
213
- * @param delta
214
- */
215
- abstract void changeWithWheel(int delta);
216
-
217
- void deBounce(int n) {
218
- if (pressOnlyOnce) {
219
- } else if (deb++ > n) {
220
- deb = 0;
221
- pressOnlyOnce = true;
222
- }
223
- }
224
-
225
- protected float map(float val, float begIn, float endIn, float beginOut, float endOut) {
226
- return (beginOut + (endOut - beginOut) * ((val - begIn) / (endIn - begIn)));
227
- }
228
-
229
- protected int constrainMap(double val, double begIn, double endIn, double beginOut, double endOut) {
230
- double max = Math.max(begIn, endIn);
231
- double min = Math.min(begIn, endIn);
232
- if (val < min) {
233
- val = min;
234
- }
235
- if (val > max) {
236
- val = max;
237
- }
238
- return (int) ((beginOut + (endOut - beginOut) * ((val - begIn) / (endIn - begIn))));
239
- }
240
-
241
- @Override
242
- public void dispose() {
243
- setActive(false);
244
- }
245
- }
@@ -1,56 +0,0 @@
1
- /*
2
- * Copyright (c) 2015-20 Martin Prout
3
- *
4
- * This library is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU Lesser General Public
6
- * License as published by the Free Software Foundation; either
7
- * version 2.1 of the License, or (at your option) any later version.
8
- *
9
- * http://creativecommons.org/licenses/LGPL/2.1/
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
- */
20
- package monkstone.slider;
21
-
22
- import java.util.ArrayList;
23
- import java.util.List;
24
- import processing.core.PApplet;
25
-
26
- public class SliderGroup {
27
-
28
- int count = 0;
29
- List<Slider> sliders;
30
- PApplet applet;
31
- boolean vertical;
32
-
33
- public SliderGroup(final PApplet outer) {
34
- applet = outer;
35
- sliders = new ArrayList<>();
36
- vertical = false;
37
- }
38
-
39
- public void vertical() {
40
- vertical = true;
41
- }
42
-
43
- public void addSlider(float beginRange, float endRange, float initial) {
44
- if (vertical) {
45
- sliders.add(new SimpleVerticalSlider(applet, beginRange, endRange, initial, count));
46
- } else {
47
- sliders.add(new SimpleHorizontalSlider(applet, beginRange, endRange, initial, count));
48
- }
49
- count = sliders.size();
50
- }
51
-
52
- public float readValue(int count) {
53
- return sliders.get(count).readValue();
54
- }
55
-
56
- }
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright (c) 2015-20 Martin Prout
3
- *
4
- * This library is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU Lesser General Public
6
- * License as published by the Free Software Foundation; either
7
- * version 2.1 of the License, or (at your option) any later version.
8
- *
9
- * http://creativecommons.org/licenses/LGPL/2.1/
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
- */
20
- package monkstone.slider;
21
-
22
- /**
23
- * @author Martin Prout from a borrowed pattern seen in Jonathan Feinbergs
24
- * Peasycam when I was struggling with non functioning browser applet, probably
25
- * superfluous here.
26
- */
27
- @FunctionalInterface
28
- public interface WheelHandler {
29
-
30
- /**
31
- *
32
- * @param amount int
33
- */
34
- public void handleWheel(final short amount);
35
- }
@@ -1,86 +0,0 @@
1
- package monkstone.vecmath;
2
-
3
- import processing.core.PGraphics;
4
-
5
- /**
6
- *
7
- * @author Martin Prout
8
- */
9
- public class GfxRender implements JRender {
10
-
11
- final PGraphics graphics;
12
-
13
- /**
14
- *
15
- * @param graphics PGraphics
16
- */
17
- public GfxRender(final PGraphics graphics) {
18
- this.graphics = graphics;
19
- }
20
-
21
- /**
22
- *
23
- * @param x double
24
- * @param y double
25
- */
26
- @Override
27
- public void vertex(double x, double y) {
28
- graphics.vertex((float) x, (float) y);
29
- }
30
-
31
- /**
32
- *
33
- * @param x double
34
- * @param y double
35
- */
36
- @Override
37
- public void curveVertex(double x, double y) {
38
- graphics.curveVertex((float) x, (float) y);
39
- }
40
-
41
- /**
42
- *
43
- * @param x double
44
- * @param y double
45
- * @param z double
46
- */
47
- @Override
48
- public void vertex(double x, double y, double z) {
49
- graphics.vertex((float) x, (float) y, (float) z);
50
- }
51
-
52
- /**
53
- *
54
- * @param x double
55
- * @param y double
56
- * @param z double
57
- */
58
- @Override
59
- public void normal(double x, double y, double z) {
60
- graphics.normal((float) x, (float) y, (float) z);
61
- }
62
-
63
- /**
64
- *
65
- * @param x double
66
- * @param y double
67
- * @param z double
68
- * @param u double
69
- * @param v double
70
- */
71
- @Override
72
- public void vertex(double x, double y, double z, double u, double v) {
73
- graphics.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
74
- }
75
-
76
- /**
77
- *
78
- * @param x double
79
- * @param y double
80
- * @param z double
81
- */
82
- @Override
83
- public void curveVertex(double x, double y, double z) {
84
- graphics.curveVertex((float) x, (float) y, (float) z);
85
- }
86
- }
@@ -1,56 +0,0 @@
1
- package monkstone.vecmath;
2
-
3
- /**
4
- *
5
- * @author Martin Prout
6
- */
7
- public interface JRender {
8
-
9
- /**
10
- *
11
- * @param x double
12
- * @param y double
13
- */
14
- public void vertex(double x, double y);
15
-
16
- /**
17
- *
18
- * @param x double
19
- * @param y double
20
- */
21
- public void curveVertex(double x, double y);
22
-
23
- /**
24
- *
25
- * @param x double
26
- * @param y double
27
- * @param z double
28
- */
29
- public void vertex(double x, double y, double z);
30
-
31
- /**
32
- *
33
- * @param x double
34
- * @param y double
35
- * @param z double
36
- * @param u double
37
- * @param v double
38
- */
39
- public void vertex(double x, double y, double z, double u, double v);
40
-
41
- /**
42
- *
43
- * @param x double
44
- * @param y double
45
- * @param z double
46
- */
47
- public void curveVertex(double x, double y, double z);
48
-
49
- /**
50
- *
51
- * @param x double
52
- * @param y double
53
- * @param z double
54
- */
55
- public void normal(double x, double y, double z);
56
- }