MCPcopy Index your code
hub / github.com/processing/processing / setValue

Method setValue

java/src/processing/mode/java/tweak/Handle.java:157–181  ·  view source on GitHub ↗
(Number value)

Source from the content-addressed store, hash-verified

155
156
157 public void setValue(Number value) {
158 if ("int".equals(type)) {
159 newValue = value.intValue();
160 strNewValue = String.format(Locale.US, textFormat, newValue.intValue());
161
162 } else if ("hex".equals(type)) {
163 newValue = value.intValue();
164 strNewValue = String.format(Locale.US, textFormat, newValue.intValue());
165
166 } else if ("webcolor".equals(type)) {
167 newValue = value.intValue();
168 // keep only RGB
169 int val = (newValue.intValue() & 0xffffff);
170 strNewValue = String.format(Locale.US, textFormat, val);
171
172 } else if ("float".equals(type)) {
173 BigDecimal bd = new BigDecimal(value.floatValue());
174 bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP);
175 newValue = bd.floatValue();
176 strNewValue = String.format(Locale.US, textFormat, newValue.floatValue());
177 }
178
179 // send new data to the server in the sketch
180 sendNewValue();
181 }
182
183
184 public void updateColorBox() {

Callers 15

updateValueMethod · 0.95
runMethod · 0.45
propertyChangeMethod · 0.45
setProgressMethod · 0.45
setProgressMethod · 0.45
mouseWheelMovedMethod · 0.45
getSubKeysMethod · 0.45
getValuesMethod · 0.45
actionPerformedMethod · 0.45

Calls 3

sendNewValueMethod · 0.95
formatMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected