public void paint(Graphics g) {
		// 
		stack.push(root);
		BTreeNode temp;
		while (!stack.empty()) {
			temp = stack.pop();
			if (temp != null) {
				for (int i = 0; i <= temp.numOfElements; i++) {
					stack.push(temp.children[i]);
				}
				for (int i = 1; i <= temp.numOfElements; i++) {
					System.out.print(temp.value[i] + " ");
				}
				System.out.println("total:" + temp.numOfElements);
			}
		}

		super.paint(g);
		// ʾ
		g.setColor(Color.BLUE);
		g.setFont(new Font("", 0, 20));
		switch (state) {
		case wait:
			g.drawString("ȴ", 10, 50);
			break;
		case insert:
			g.drawString("ڲ  " + data, 10, 50);
			break;
		case search:
			g.drawString("  " + data, 10, 50);
			break;
		case delete:
			g.drawString("ɾ  " + data, 10, 50);
			break;
		case go:
			g.drawString("ǰ " + (node + 1) + " ڵ", 10, 50);
			break;
		case inserted:
			g.drawString("ɲ룡", 10, 50);
			break;
		case searched:
			g.drawString("", 10, 50);
			break;
		case deleted:
			g.drawString("ɾ", 10, 50);
			break;
		case split:
			g.drawString("ѽڵ", 10, 50);
			break;
		case merge:
			g.drawString("ϲڵ", 10, 50);
			break;
		case borrow:
			g.drawString("ֵܽһԪ", 10, 50);
			break;
		case largest:
			g.drawString("ڴѰֵ", 10, 50);
		case smallest:
			g.drawString("ڴѰСֵ", 10, 50);
		}

		BTreeNode p;
		stack.push(root);
		while (!stack.empty()) {
			p = stack.pop();
			if (p == null)
				return;

			int x = p.getPoint().getX();
			int y = p.getPoint().getY();

			if (p.numOfElements > 0) {
				// ڵp
				g.setColor(p.color);
				g.drawRect(x, y, LENGTH * p.numOfElements, HEIGHT);

				// ڵеԪ
				int x2 = x + LENGTH / 8; // x2,y2ΪԪڵx꣬x,yԱֲ
				int y2 = y + HEIGHT * 7 / 8;

				for (int i = 1; i <= p.numOfElements; i++) {
					if (i == p.ElementHighlightIdx)
						g.setColor(Color.RED);
					else
						g.setColor(Color.BLACK);
					g.drawString(p.value[i] + "", x2, y2);
					x2 += LENGTH;
				}
				// ýڵӽڵ
				if (!p.isLeaf) {
					// x,yΪֱʼ꣬x2,y2Ϊֱĩ
					y = y + HEIGHT;
					for (int i = 0; i <= p.numOfElements; i++) {
						stack.push(p.children[i]);
						x2 = x + cnt.getEndPos(i);
						y2 = y + 2 * HEIGHT;
						if (i == p.lineHighlightIdx)
							g.setColor(Color.RED);
						else
							g.setColor(Color.BLACK);
						g.drawLine(x + cnt.getStartPos(i), y, x2, y2);

					}
				}

			}
		}

	}