Back to project page android-augment-reality-framework.
The source code is released under:
GNU General Public License
If you think the Android project android-augment-reality-framework 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.jwetherell.augmented_reality.ui.objects; /*from w w w .j a v a 2 s . c o m*/ import android.graphics.Canvas; /** * This class extends PaintableObject to draw a line. * * @author Justin Wetherell <phishman3579@gmail.com> */ public class PaintableLine extends PaintableObject { private int color = 0; public PaintableLine(int color, float x, float y) { set(color, x, y); } /** * Set this objects parameters. This should be used instead of creating new * objects. * * @param color * Color of the line. * @param x * X coordinate of the line. * @param y * Y coordinate of the line. */ public void set(int color, float x, float y) { this.color = color; this.x = x; this.y = y; } /** * {@inheritDoc} */ @Override public void paint(Canvas canvas) { if (canvas == null) throw new NullPointerException(); setFill(false); setColor(color); paintLine(canvas, 0, 0, x, y); } /** * {@inheritDoc} */ @Override public float getWidth() { return x; } /** * {@inheritDoc} */ @Override public float getHeight() { return y; } }