Back to project page bil611bfs.
The source code is released under:
GNU General Public License
If you think the Android project bil611bfs listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.efeciftci.bil611bfsdemo; // w w w . j av a 2 s .c o m import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.Point; import android.widget.TextView; public class Vertex { private int data; private boolean visited; private List<Vertex> children; public TextView tv; public Vertex(int data, Context c, Point p) { this.data = data; this.visited = false; this.children = new ArrayList<Vertex>(); this.tv = new TextView(c); this.tv.setText(String.valueOf(this.data)); this.tv.setX(p.x); this.tv.setY(p.y); this.tv.setTextColor(0xff000000); this.tv.setTextSize(24); this.tv.setBackgroundColor(0xff888888); this.tv.setPadding(5, 5, 5, 5); } public List<Vertex> getChildren() { return this.children; } public int getData() { return this.data; } public void setData(int data) { this.data = data; this.tv.setText(String.valueOf(this.data)); } public void select() { this.tv.setBackgroundColor(0xffa4c0e4); } public void unselect() { this.tv.setBackgroundColor(0xffffffff); } public void addChild(Vertex v) { this.children.add(v); } public void setVisited(boolean visited) { this.visited = visited; if (visited) this.tv.setBackgroundColor(0xff888888); else this.tv.setBackgroundColor(0xffffffff); } public boolean getVisited() { return this.visited; } }