org.arakhne.afc.ui.android.zoom
public class DroidZoomableGraphics2D extends AbstractVectorGraphics2D implements ZoomableContext
| Modifier and Type | Field and Description |
|---|---|
protected Color |
background
Current background color.
|
protected android.graphics.Canvas |
canvas
Android canvas.
|
protected CenteringTransform |
centeringTransform
Transformation to apply to center the objects on the view.
|
protected Color |
defaultBackground
Default color to draw the background.
|
protected Color |
defaultFillColor
Default color to fill the shapes.
|
protected Graphics2DLOD |
defaultLevelOfDetail
Default Level-of-Detail.
|
protected Color |
defaultLineColor
Default color to outline the shapes.
|
protected android.graphics.Paint |
fillPainter
Android painter to use for filling the shapes.
|
protected float |
focusX
Coordinate of the point that is drawn at the center of the view.
|
protected float |
focusY
Coordinate of the point that is drawn at the center of the view.
|
protected android.graphics.Paint |
fontPainter
Android painter to use for drawing the texts.
|
protected Graphics2DLOD |
levelOfDetail
Current Level-of-Detail.
|
protected android.graphics.Paint |
linePainter
Android painter to use for drawing the outlines of the shapes.
|
protected float |
maxScale
Maximal value for the scale factor.
|
protected float |
minScale
Minimal value for the scale factor.
|
protected float |
scale
Scaling factor to apply when drawing.
|
protected float |
scalingSensitivity
Scaling sensitivity.
|
protected Rectangle2f |
tmpRect
Temp rectangle used in internal computations.
|
| Constructor and Description |
|---|
DroidZoomableGraphics2D(android.graphics.Canvas canvas,
Color defaultFillColor,
Color defaultLineColor,
float scaleFactor,
CenteringTransform centeringTransform,
Color background,
boolean isAntiAlias,
float scalingSensitivity,
float focusX,
float focusY,
float minScaleFactor,
float maxScaleFactor) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Shape2f s) |
void |
clip(Shape2f clip) |
static Transform2D |
convertMatrix(android.graphics.Matrix m,
float scale)
Convert the droid matrix to Arakhne transformation matrix.
|
static android.graphics.Matrix |
convertTransformation(Transform2D t,
float scale)
Convert the Arakhne transformation matrix to droid matrix.
|
void |
dispose() |
void |
draw(Shape2f s) |
boolean |
drawImage(URL imageURL,
Image img,
float dx1,
float dy1,
float dx2,
float dy2,
int sx1,
int sy1,
int sx2,
int sy2) |
boolean |
drawImage(URL imageURL,
Image img,
float dx1,
float dy1,
float dx2,
float dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer) |
void |
drawPoint(float x,
float y) |
Color |
getBackground() |
Shape2f |
getClip() |
Composite |
getComposite() |
float |
getFocusX() |
float |
getFocusY() |
Font |
getFont() |
FontMetrics |
getFontMetrics() |
FontMetrics |
getFontMetrics(Font f) |
Graphics2DLOD |
getLOD() |
float |
getMaxScalingFactor() |
float |
getMinScalingFactor() |
android.graphics.Canvas |
getNativeGraphics2D() |
float |
getScalingFactor() |
float |
getScalingSensitivity() |
StringAnchor |
getStringAnchor() |
Stroke |
getStroke() |
Transform2D |
getTransform() |
boolean |
isXAxisInverted() |
boolean |
isYAxisInverted() |
protected void |
log(String message) |
protected void |
log(String message,
Throwable exception) |
float |
logical2pixel_size(float l) |
float |
logical2pixel_x(float l) |
float |
logical2pixel_y(float l) |
void |
logical2pixel(Circle2f r) |
void |
logical2pixel(Ellipse2f e) |
PathIterator2f |
logical2pixel(PathIterator2f p) |
void |
logical2pixel(Point2f p) |
void |
logical2pixel(Rectangle2f r) |
void |
logical2pixel(RoundRectangle2f r) |
void |
logical2pixel(Segment2f s) |
Shape2f |
logical2pixel(Shape2f s) |
protected void |
paintString(String text,
float x,
float y,
Shape2f clip) |
float |
pixel2logical_size(float l) |
float |
pixel2logical_x(float l) |
float |
pixel2logical_y(float l) |
void |
pixel2logical(Circle2f r) |
void |
pixel2logical(Ellipse2f e) |
PathIterator2f |
pixel2logical(PathIterator2f p) |
void |
pixel2logical(Point2f p) |
void |
pixel2logical(Rectangle2f r) |
void |
pixel2logical(RoundRectangle2f r) |
void |
pixel2logical(Segment2f s) |
Shape2f |
pixel2logical(Shape2f s) |
void |
reset() |
protected void |
resetPainters()
Reset the painters to the default attribute values.
|
void |
rotate(float theta) |
void |
scale(float sx,
float sy) |
void |
setBackground(Color color) |
void |
setClip(Shape2f clip) |
protected static void |
setColor(android.graphics.Paint paint,
Color color)
Set the color of the given paint to the given color.
|
void |
setComposite(Composite composite) |
Color |
setFillColor(Color color) |
void |
setFont(Font font) |
void |
setLOD(Graphics2DLOD lod)
Change the LOD of the graphics2D.
|
Color |
setOutlineColor(Color color) |
void |
setStroke(Stroke stroke) |
Transform2D |
setTransform(Transform2D Tx) |
void |
shear(float shx,
float shy) |
void |
transform(Transform2D Tx) |
void |
translate(float tx,
float ty) |
computeTextPosition, drawDefaultImage, drawString, drawString, getDefaultFont, getFillColor, getInteriorText, getOutlineColor, getPaint, isInteriorPainted, isOutlineDrawn, paintString, postDrawing, preDrawing, setColors, setInteriorPainted, setInteriorText, setOutlineDrawn, setPaintprotected final android.graphics.Canvas canvas
protected final Color defaultBackground
backgroundprotected final Graphics2DLOD defaultLevelOfDetail
levelOfDetailprotected Graphics2DLOD levelOfDetail
defaultLevelOfDetailprotected android.graphics.Paint fillPainter
protected android.graphics.Paint linePainter
protected android.graphics.Paint fontPainter
protected Color background
defaultBackgroundprotected final float scale
protected final CenteringTransform centeringTransform
protected final Rectangle2f tmpRect
protected final Color defaultFillColor
fillPainterprotected final Color defaultLineColor
linePainterprotected final float scalingSensitivity
protected final float focusX
protected final float focusY
protected final float maxScale
protected final float minScale
public DroidZoomableGraphics2D(android.graphics.Canvas canvas,
Color defaultFillColor,
Color defaultLineColor,
float scaleFactor,
CenteringTransform centeringTransform,
Color background,
boolean isAntiAlias,
float scalingSensitivity,
float focusX,
float focusY,
float minScaleFactor,
float maxScaleFactor)
canvas - defaultFillColor - is the default color for filling.defaultLineColor - is the default color for the lines.scaleFactor - is the scaling factor to apply.centeringTransform - is the transformation used to draw the objects at the center of the view.background - is the background color.isAntiAlias - indicates if antialiasing is used when drawing.scalingSensitivity - is the sensitivity of the scaling actions.focusX - is the coordinate of the focus point.focusY - is the coordinate of the focus point.minScaleFactor - is the minimal allowed scaling factor.maxScaleFactor - is the maximal allowed scaling factor.public static Transform2D convertMatrix(android.graphics.Matrix m, float scale)
m - is the matrix to convert to a transformation.scale - is the scaling factor to apply.public static android.graphics.Matrix convertTransformation(Transform2D t, float scale)
t - is the transformation to convert to a matrix.scale - is the scaling factor to apply.protected static void setColor(android.graphics.Paint paint,
Color color)
paint - color - public android.graphics.Canvas getNativeGraphics2D()
getNativeGraphics2D in interface VectorGraphics2Dpublic void dispose()
dispose in interface VectorGraphics2Ddispose in class AbstractVectorGraphics2Dpublic void reset()
reset in interface VectorGraphics2Dreset in class AbstractVectorGraphics2Dprotected void resetPainters()
protected void log(String message)
log in class AbstractVectorGraphics2Dprotected void log(String message, Throwable exception)
log in class AbstractVectorGraphics2Dpublic Color setOutlineColor(Color color)
setOutlineColor in interface VectorGraphics2DsetOutlineColor in class AbstractVectorGraphics2Dpublic Color setFillColor(Color color)
setFillColor in interface VectorGraphics2DsetFillColor in class AbstractVectorGraphics2Dpublic Graphics2DLOD getLOD()
getLOD in interface VectorGraphics2Dpublic void setLOD(Graphics2DLOD lod)
lod - public StringAnchor getStringAnchor()
getStringAnchor in interface VectorGraphics2Dpublic void drawPoint(float x,
float y)
drawPoint in interface VectorGraphics2Dpublic Font getFont()
getFont in interface VectorGraphics2Dpublic void setFont(Font font)
setFont in interface VectorGraphics2Dpublic FontMetrics getFontMetrics()
getFontMetrics in interface VectorGraphics2Dpublic FontMetrics getFontMetrics(Font f)
getFontMetrics in interface VectorGraphics2Dpublic Shape2f getClip()
getClip in interface VectorGraphics2Dpublic void setClip(Shape2f clip)
setClip in interface VectorGraphics2Dpublic void clip(Shape2f clip)
clip in interface VectorGraphics2Dpublic boolean drawImage(URL imageURL, Image img, float dx1, float dy1, float dx2, float dy2, int sx1, int sy1, int sx2, int sy2)
drawImage in interface VectorGraphics2Dpublic boolean drawImage(URL imageURL, Image img, float dx1, float dy1, float dx2, float dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
drawImage in interface VectorGraphics2Dpublic void clear(Shape2f s)
clear in interface VectorGraphics2Dpublic void draw(Shape2f s)
draw in interface VectorGraphics2Dprotected void paintString(String text, float x, float y, Shape2f clip)
paintString in class AbstractVectorGraphics2Dpublic void translate(float tx,
float ty)
translate in interface VectorGraphics2Dpublic void scale(float sx,
float sy)
scale in interface VectorGraphics2Dpublic void rotate(float theta)
rotate in interface VectorGraphics2Dpublic void shear(float shx,
float shy)
shear in interface VectorGraphics2Dpublic void transform(Transform2D Tx)
transform in interface VectorGraphics2Dpublic Transform2D setTransform(Transform2D Tx)
setTransform in interface VectorGraphics2Dpublic Transform2D getTransform()
getTransform in interface VectorGraphics2Dpublic void setBackground(Color color)
setBackground in interface VectorGraphics2Dpublic Color getBackground()
getBackground in interface VectorGraphics2Dpublic void setComposite(Composite composite)
setComposite in interface VectorGraphics2Dpublic Composite getComposite()
getComposite in interface VectorGraphics2Dpublic void setStroke(Stroke stroke)
setStroke in interface VectorGraphics2Dpublic Stroke getStroke()
getStroke in interface VectorGraphics2Dpublic float logical2pixel_size(float l)
logical2pixel_size in interface ZoomableContextpublic float logical2pixel_x(float l)
logical2pixel_x in interface ZoomableContextpublic float logical2pixel_y(float l)
logical2pixel_y in interface ZoomableContextpublic float pixel2logical_size(float l)
pixel2logical_size in interface ZoomableContextpublic float pixel2logical_x(float l)
pixel2logical_x in interface ZoomableContextpublic float pixel2logical_y(float l)
pixel2logical_y in interface ZoomableContextpublic PathIterator2f logical2pixel(PathIterator2f p)
logical2pixel in interface ZoomableContextpublic PathIterator2f pixel2logical(PathIterator2f p)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Segment2f s)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Segment2f s)
pixel2logical in interface ZoomableContextpublic void logical2pixel(RoundRectangle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(RoundRectangle2f r)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Point2f p)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Point2f p)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Ellipse2f e)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Ellipse2f e)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Circle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Circle2f r)
pixel2logical in interface ZoomableContextpublic void logical2pixel(Rectangle2f r)
logical2pixel in interface ZoomableContextpublic void pixel2logical(Rectangle2f r)
pixel2logical in interface ZoomableContextpublic Shape2f logical2pixel(Shape2f s)
logical2pixel in interface ZoomableContextpublic Shape2f pixel2logical(Shape2f s)
pixel2logical in interface ZoomableContextpublic float getScalingSensitivity()
getScalingSensitivity in interface ZoomableContextpublic float getFocusX()
getFocusX in interface ZoomableContextpublic float getFocusY()
getFocusY in interface ZoomableContextpublic float getScalingFactor()
getScalingFactor in interface ZoomableContextpublic float getMaxScalingFactor()
getMaxScalingFactor in interface ZoomableContextpublic float getMinScalingFactor()
getMinScalingFactor in interface ZoomableContextpublic boolean isXAxisInverted()
isXAxisInverted in interface ZoomableContextpublic boolean isYAxisInverted()
isYAxisInverted in interface ZoomableContextCopyright © 2001-2013 NetEditor Developers. 
NetEditor API Documentation by NetEditor Developers is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.arakhne.org/neteditor