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; /* ww w . java 2 s. co m*/ import android.graphics.Canvas; /** * This class extends PaintableObject and draws a small rectangle. * * @author Justin Wetherell <phishman3579@gmail.com> */ public class PaintablePoint extends PaintableObject { private static int width = 2; private static int height = 2; private int color = 0; private boolean fill = false; public PaintablePoint(int color, boolean fill) { set(color, fill); } /** * Set this objects parameters. This should be used instead of creating new * objects. * * @param color * Color to set the rectangle representing this Point. * @param fill * Fill color to set the rectangle representing this Point. */ public void set(int color, boolean fill) { this.color = color; this.fill = fill; } /** * {@inheritDoc} */ @Override public void paint(Canvas canvas) { if (canvas == null) throw new NullPointerException(); canvas.save(); canvas.translate(-width/2, -height/2); setFill(fill); setColor(color); paintRect(canvas, x, y, width, height); canvas.restore(); } /** * {@inheritDoc} */ @Override public float getWidth() { return width; } /** * {@inheritDoc} */ @Override public float getHeight() { return height; } }