forked from LupusNobilis/java-org.hwo.ui
49 lines
918 B
Java
49 lines
918 B
Java
|
package org.hwo.ui.diagram;
|
||
|
|
||
|
public class ArrayDiagramDataProvider implements DiagramDataProvider {
|
||
|
|
||
|
private Object[] values;
|
||
|
private Float[] indeces;
|
||
|
|
||
|
public ArrayDiagramDataProvider() {
|
||
|
this.values = new Object[0];
|
||
|
this.indeces = new Float[0];
|
||
|
}
|
||
|
|
||
|
public void setValues(Object[] values) {
|
||
|
this.values = values;
|
||
|
|
||
|
this.indeces = new Float[values.length];
|
||
|
for (int i=0;i<values.length;i++){
|
||
|
this.indeces[i] = new Float(i);
|
||
|
}
|
||
|
}
|
||
|
public void setValues(Object[] values,Float f) {
|
||
|
this.values = values;
|
||
|
|
||
|
this.indeces = new Float[values.length];
|
||
|
for (int i=0;i<values.length;i++){
|
||
|
this.indeces[i] = new Float(i) * f;
|
||
|
}
|
||
|
}
|
||
|
public Object[] getValues() {
|
||
|
return values;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Float[] getPlotKeys() {
|
||
|
return this.indeces;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Object[] getPlotData() {
|
||
|
return this.values;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getKeyLabel(Float key) {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
}
|