Initial commit from non tracked working directory

This commit is contained in:
Giovanni Harting
2015-08-13 03:27:24 +02:00
parent 7fbc976571
commit 792cc20cd1
74 changed files with 2990 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
package com.idlegandalf.ledd.components;
import org.json.JSONException;
import java.io.IOException;
import java.util.ArrayList;
public class StripeGroup {
private String mNiceName;
private String mDescription;
private ArrayList<RGBStripe> mStripes;
public String getNiceName() {
return mNiceName;
}
public void setNiceName(String mNiceName) {
this.mNiceName = mNiceName;
}
public String getDescription() {
return mDescription;
}
public void setDescription(String mDescription) {
this.mDescription = mDescription;
}
public RGBStripe getStripeByPos(int pos) {
return mStripes.get(pos);
}
public RGBStripe getStripeById(int sid) {
for (int i = 0; i < mStripes.size(); i++) {
if (mStripes.get(i).getId() == sid) {
return mStripes.get(i);
}
}
return null;
}
public void setRGB(int r, int g, int b, LEDDHelper api) throws JSONException, IOException {
for (int i = 0; i < mStripes.size(); i++) {
//mStripes.get(i).setRGB(r, g, b, api);
}
}
public int addStripe(RGBStripe stripe) {
mStripes.add(stripe);
return mStripes.size()-1;
}
public void removeStripeByObject(RGBStripe stripe) {
for (int i = 0; i < mStripes.size(); i++) {
if (mStripes.get(i).getId() == stripe.getId()) {
mStripes.remove(i);
return;
}
}
}
}