yes, I did that.
my class looks like that:
Code:
public class RadialDiagramTest extends PApplet {
public static RadialDiagramTest run;
private RadialDiagram klasse;
private RadialDiagram klasse2;
private HashMap<String, Float> testMap = new HashMap<String, Float>();
private Vector<ILoop> loopElements = new Vector<ILoop>();
public void setup(){
run = this;
createTestMap();
klasse = new RadialDiagram(this);
klasse2 = new RadialDiagram(this);
klasse.setData(testMap);
klasse2.setData(testMap);
klasse.setValueByCountry("AAA", 0.1f);
}
public void draw(){
background(54,58,66);
klasse.loop();
loopElements();
image(klasse.getDrawable(),mouseX-klasse.getCenter()[0],mouseY-klasse.getCenter()[1]);
image(klasse2.getDrawable(),100,100);
}
private void loopElements(){
for(int i = 0; i<loopElements.size(); i++){
loopElements.get(i).loop();
}
}
// loops anmelden ueber interface ILoop
public void addLoopElement(ILoop theElement){
loopElements.add(theElement);
}
// loops entfernen ueber interface ILoop
public void removeLoopElement(ILoop theElement){
loopElements.remove(theElement);
}
public void tweenEndedEvent(Tween _t) {
System.out.println(_t+" ended");
}
public void tweenStartedEvent(Tween _t) {
System.out.println(_t+" started");
}
The Tween happens inside the RadialDiagram class:
Code:tweenElements.add(new BalkenTween(new Tween(app, "tween_"+country, balkenMap.get(country).getSize(), Value, tweenDuration,Tween.SECONDS, 0f,Tween.LINEAR_EASE_IN),balkenMap.get(country)));