本文整理汇总了Java中com.echo.holographlibrary.LineGraph类的典型用法代码示例。如果您正苦于以下问题:Java LineGraph类的具体用法?Java LineGraph怎么用?Java LineGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineGraph类属于com.echo.holographlibrary包,在下文中一共展示了LineGraph类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLineGrapth
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
/**
* 折れ線グラフを初期化する。
*/
private void initLineGrapth() {
LineGraph lineGraph = (LineGraph) findViewById(R.id.linegraph);
Line line = new Line();
line.addPoint(createPointForLine(0, 5));
line.addPoint(createPointForLine(2, 8));
line.addPoint(createPointForLine(4, 6));
line.addPoint(createPointForLine(8, 10));
line.addPoint(createPointForLine(10, 4));
line.setColor(Color.parseColor("#FFBB33"));
lineGraph.addLine(line);
lineGraph.setRangeY(0, 10);
lineGraph.setOnPointClickedListener(new OnPointClickedListener() {
@Override
public void onClick(int lineIndex, int pointIndex) {
}
});
}
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:25,代码来源:HoloGraphLibrarySampleActivity.java
示例2: addStatPoint
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
public static void addStatPoint(int X, int Y, Line line, LineGraph graph) {
LinePoint point = new LinePoint();
point.setX(X);
point.setY(Y);
line.addPoint(point);
graph.addLine(line);
}
示例3: getViews
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
private void getViews() {
li = (LineGraph)findViewById(R.id.linegraph);
btnAdd = (Button)findViewById(R.id.btnAdd);
btnShift = (Button)findViewById(R.id.btnShift);
btnScan = (Button)findViewById(R.id.btnScan);
tvNetresult = (TextView)findViewById(R.id.tvNetresult);
btnFetch = (Button)findViewById(R.id.btnFetch);
tvTemp = (TextView)findViewById(R.id.tvTemp);
tvPres = (TextView)findViewById(R.id.tvPres);
tvHumi = (TextView)findViewById(R.id.tvHumi);
}
示例4: getViews
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
private void getViews() {
lineGraph = (LineGraph)findViewById(R.id.tempGraph);
btnSingle = (Button)findViewById(R.id.btnSingle);
btnHistory = (Button)findViewById(R.id.btnHistory);
btnContinuous = (Button)findViewById(R.id.btnContinuous);
btnConnect = (Button)findViewById(R.id.btnConnect);
tvResult = (TextView)findViewById(R.id.tvResult);
tvTemp = (TextView)findViewById(R.id.tvTemp);
tvHumi = (TextView)findViewById(R.id.tvHumi);
tvTempMax = (TextView)findViewById(R.id.tvTempMax);
tvHumiMax = (TextView)findViewById(R.id.tvHumiMax);
tvTempMin = (TextView)findViewById(R.id.tvTempMin);
tvHumiMin = (TextView)findViewById(R.id.tvHumiMin);
}
示例5: getViews
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
private void getViews() {
lineGraph = (LineGraph)findViewById(R.id.tempGraph);
btnSingle = (Button)findViewById(R.id.btnSingle);
btnContinuous = (Button)findViewById(R.id.btnContinuous);
btnConnect = (Button)findViewById(R.id.btnConnect);
tvResult = (TextView)findViewById(R.id.tvResult);
tvTemp = (TextView)findViewById(R.id.tvTemp);
tvHumi = (TextView)findViewById(R.id.tvHumi);
pbBusy = (ProgressBar)findViewById(R.id.pbBusy);
}
示例6: initData
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
private void initData() {
SubjectTest firstDegreeTest = mSubject.getTestByDegree(SubjectTest.Degree.FIRST_DEGREE);
Float firstDegreeTestGrade = (firstDegreeTest != null) ? firstDegreeTest.grade : null;
SubjectTest secondDegreeTest = mSubject.getTestByDegree(SubjectTest.Degree.SECOND_DEGREE);
Float secondDegreeTestGrade = (secondDegreeTest != null) ? secondDegreeTest.grade : null;
SubjectTest finalDegreeTest = mSubject.getTestByDegree(SubjectTest.Degree.FINAL_DEGREE);
Float finalDegreeTestGrade = (finalDegreeTest != null) ? finalDegreeTest.grade : null;
ArrayList<Float> grades = new ArrayList<Float>();
grades.add(firstDegreeTestGrade);
grades.add(secondDegreeTestGrade);
grades.add(finalDegreeTestGrade);
// Creating graph structure
LineGraph graph = (LineGraph) findViewById(R.id.linegraph);
graph.setUsingDips(true);
graph.setRangeY(0, 10);
graph.setRangeX(0, grades.size() - 1);
graph.setLineToFill(1);
// Creating Grade Line
Line gradeLine = new Line();
gradeLine.setUsingDips(true);
gradeLine.setColor(getContext().getResources().getColor(R.color.unicap_base));
for (int i = 0; i < grades.size(); i++) {
if (grades.get(i) != null) {
gradeLine.addPoint(createGradePoint(i, grades.get(i)));
}
}
graph.addLine(gradeLine);
// Creating Average Line
Line averageLine = new Line();
averageLine.setColor(getContext().getResources().getColor(android.R.color.darker_gray));
averageLine.setUsingDips(true);
averageLine.setStrokeWidth(1);
averageLine.setShowingPoints(false);
averageLine.addPoint(createAveragePoint(0));
averageLine.addPoint(createAveragePoint(grades.size() - 1));
graph.addLine(averageLine);
}
示例7: onCreate
import com.echo.holographlibrary.LineGraph; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//ready
graph = (LineGraph) findViewById(R.id.holo_graph_view);
graphButton1 = (Button) findViewById(R.id.btn_emg1);
graphButton2 = (Button) findViewById(R.id.btn_emg2);
graphButton3 = (Button) findViewById(R.id.btn_emg3);
graphButton4 = (Button) findViewById(R.id.btn_emg4);
graphButton5 = (Button) findViewById(R.id.btn_emg5);
graphButton6 = (Button) findViewById(R.id.btn_emg6);
graphButton7 = (Button) findViewById(R.id.btn_emg7);
graphButton8 = (Button) findViewById(R.id.btn_emg8);
//set color
graphButton1.setBackgroundColor(Color.argb(0x66, 0xff, 0, 0xff));
graphButton2.setBackgroundColor(Color.argb(0x66, 0xff, 0x00, 0x00));
graphButton3.setBackgroundColor(Color.argb(0x66, 0x66, 0x33, 0xff));
graphButton4.setBackgroundColor(Color.argb(0x66, 0xff, 0x66, 0x33));
graphButton5.setBackgroundColor(Color.argb(0x66, 0xff, 0x33, 0x66));
graphButton6.setBackgroundColor(Color.argb(0x66, 0x00, 0x33, 0xff));
graphButton7.setBackgroundColor(Color.argb(0x66, 0x00, 0x33, 0x33));
graphButton8.setBackgroundColor(Color.argb(0x66, 0x66, 0xcc, 0x66));
emgDataText = (TextView)findViewById(R.id.emgDataTextView);
gestureText = (TextView)findViewById(R.id.gestureTextView);
mHandler = new Handler();
startNopModel();
BluetoothManager mBluetoothManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
mBluetoothAdapter = mBluetoothManager.getAdapter();
Intent intent = getIntent();
deviceName = intent.getStringExtra(ListActivity.TAG);
if (deviceName != null) {
// Ensures Bluetooth is available on the device and it is enabled. If not,
// displays a dialog requesting user permission to enable Bluetooth.
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
} else {
// Scanning Time out by Handler.
// The device scanning needs high energy.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mBluetoothAdapter.stopLeScan(MainActivity.this);
}
}, SCAN_PERIOD);
mBluetoothAdapter.startLeScan(this);
}
}
}