Revision d04a4886
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/matrix3d/Matrix3DActivity.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.distorted.examples.R; |
34 | 34 |
import org.distorted.library.Distorted; |
35 |
import org.distorted.library.DistortedEffectQueues;
|
|
35 |
import org.distorted.library.DistortedEffects; |
|
36 | 36 |
import org.distorted.library.GridObject; |
37 | 37 |
import org.distorted.library.GridCubes; |
38 | 38 |
import org.distorted.library.DistortedTexture; |
... | ... | |
49 | 49 |
{ |
50 | 50 |
private DistortedTexture mTexture; |
51 | 51 |
private GridObject mGrid; |
52 |
private DistortedEffectQueues mQueues;
|
|
52 |
private DistortedEffects mEffects;
|
|
53 | 53 |
|
54 |
private ArrayList<Matrix3DEffect> mEffects;
|
|
54 |
private ArrayList<Matrix3DEffect> mList;
|
|
55 | 55 |
private int mEffectAdd; |
56 | 56 |
|
57 | 57 |
private EffectNames[] mEffectNames; |
... | ... | |
65 | 65 |
{ |
66 | 66 |
super.onCreate(savedState); |
67 | 67 |
|
68 |
mEffects = new ArrayList<>();
|
|
68 |
mList = new ArrayList<>();
|
|
69 | 69 |
|
70 | 70 |
createEffectNames(); |
71 | 71 |
|
72 |
mQueues = new DistortedEffectQueues();
|
|
72 |
mEffects = new DistortedEffects();
|
|
73 | 73 |
mGrid = new GridCubes(1,1,false); |
74 | 74 |
mTexture= new DistortedTexture(100,100); |
75 | 75 |
|
... | ... | |
102 | 102 |
|
103 | 103 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
104 | 104 |
|
105 |
public DistortedEffectQueues getQueues()
|
|
105 |
public DistortedEffects getEffects()
|
|
106 | 106 |
{ |
107 |
return mQueues;
|
|
107 |
return mEffects;
|
|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
277 | 277 |
public void newEffect(View v) |
278 | 278 |
{ |
279 | 279 |
Matrix3DEffect eff = new Matrix3DEffect(mEffectNames[mEffectAdd], this); |
280 |
mEffects.add(eff);
|
|
280 |
mList.add(eff);
|
|
281 | 281 |
|
282 | 282 |
LinearLayout layout = (LinearLayout)findViewById(R.id.matrix3dlayout); |
283 | 283 |
View view = eff.createView(); |
... | ... | |
289 | 289 |
layout.addView(center); |
290 | 290 |
} |
291 | 291 |
|
292 |
eff.apply(mQueues);
|
|
292 |
eff.apply(mEffects);
|
|
293 | 293 |
} |
294 | 294 |
|
295 | 295 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
296 | 296 |
|
297 | 297 |
public void removeAll(View v) |
298 | 298 |
{ |
299 |
mEffects.clear();
|
|
299 |
mList.clear();
|
|
300 | 300 |
LinearLayout layout = (LinearLayout)findViewById(R.id.matrix3dlayout); |
301 | 301 |
layout.removeAllViews(); |
302 |
mQueues.abortEffects(EffectTypes.MATRIX);
|
|
302 |
mEffects.abortEffects(EffectTypes.MATRIX);
|
|
303 | 303 |
|
304 | 304 |
resetData(); |
305 | 305 |
} |
... | ... | |
308 | 308 |
|
309 | 309 |
public void remove(View v) |
310 | 310 |
{ |
311 |
for(Matrix3DEffect effect: mEffects)
|
|
311 |
for(Matrix3DEffect effect: mList)
|
|
312 | 312 |
{ |
313 | 313 |
if( effect.thisView(v) ) |
314 | 314 |
{ |
... | ... | |
322 | 322 |
view = effect.getRegion(); |
323 | 323 |
if( view!=null ) layout.removeView(view); |
324 | 324 |
|
325 |
mQueues.abortEffect(effect.getId());
|
|
326 |
mEffects.remove(effect);
|
|
325 |
mEffects.abortEffect(effect.getId());
|
|
326 |
mList.remove(effect);
|
|
327 | 327 |
|
328 | 328 |
resetData(); |
329 | 329 |
|
Also available in: Unified diff
Change of names.