Draws this ellipse.

@param context the {@link Context2D} used to draw this ellipse.
162145
@Override
    protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
    {
        final double w = attr.getWidth();

        final double h = attr.getHeight();

        if ((w > 0) && (h > 0))
        {
            context.beginPath();

            context.ellipse(0, 0, w / 2, h / 2, 0, 0, Math.PI * 2, true);

            context.closePath();

            return true;
        }
        return false;
    }
314239
@com.fasterxml.jackson.annotation.JsonProperty("Context")
    public void setContext(String context) {
        this.context = context;
    }
571116
@Override
    public void draw(Graphics2D g, int width, int height)
    {
        Rectangle bounds = getOwner().getAbsoluteBackgroundBounds();
        computeCoordinates(bounds);
        drawScaledImage(g, image, bounds.x + imgx, bounds.y + imgy, observer);
    }
1005212
private void draw() throws GeometryIndexNotFoundException {
		if (Geometry.POINT.equals(editService.getGeometry().getGeometryType())) {
			drawPoint(null);
		} else if (Geometry.LINE_STRING.equals(editService.getGeometry().getGeometryType())
				|| Geometry.LINEAR_RING.equals(editService.getGeometry().getGeometryType())) {
			drawLineString(null);
		} else if (Geometry.POLYGON.equals(editService.getGeometry().getGeometryType())) {
			drawPolygon(null);
		}
	}
877176
protected final void setContext(@NonNull final Context context) {
        Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
        this.context = context;
    }
115321
public static void init(@NonNull final Context context, IInnerImageSetter innerImageSetter,
        Class<? extends ImageView> imageClazz) {
        if (sInitialized) {
            return;
        }
        //noinspection ConstantConditions
        Preconditions.checkArgument(context != null, "context should not be null");
        Preconditions
            .checkArgument(innerImageSetter != null, "innerImageSetter should not be null");
        Preconditions.checkArgument(imageClazz != null, "imageClazz should not be null");
        TangramViewMetrics.initWith(context.getApplicationContext());
        ImageUtils.sImageClass = imageClazz;
        ImageUtils.setImageSetter(innerImageSetter);
        sInitialized = true;
    }
884648
function drawLinearTick(context, x1, y1, x2, y2) {
    context.beginPath();

    context.moveTo(x1, y1);
    context.lineTo(x2, y2);
    context.stroke();

    context.closePath();
    context.save();
}
798973
@Override
    public void draw(GraphicContext graphicContext) {
        graphicContext.fillColor(this.displayModel.getBackgroundColor());

        // Swap bitmaps before the Canvas.drawBitmap to prevent flickering as much as possible
        swapBitmaps();

        if (this.odBitmap != null) {
            graphicContext.drawBitmap(this.odBitmap, this.matrix);
        }
    }
300585
public void setContext(Context context) {
        context.put(JavacElements.class, this);
        javaCompiler = JavaCompiler.instance(context);
        syms = Symtab.instance(context);
        names = Names.instance(context);
        types = Types.instance(context);
        enter = Enter.instance(context);
    }
951081
public void drawFrame(int textureId, float[] texMatrix) {
        // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.
        mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0,
                mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(),
                mRectDrawable.getVertexStride(),
                texMatrix, TEX_COORDS_BUF, textureId, TEX_COORDS_STRIDE);
    }
497722
@Override
    protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
    {
        final double r = attr.getRadius();

        if (r > 0)
        {
            context.beginPath();

            context.arc(0, 0, r, attr.getStartAngle(), attr.getEndAngle(), attr.isCounterClockwise());

            return true;
        }
        return false;
    }
520832
@Override
	public void draw(Canvas c, Projection projection) {

		final double zoomLevel = projection.getZoomLevel();

		if (zoomLevel < minZoom) {
			return;
		}
		final Rect rect = projection.getIntrinsicScreenRect();
		int _screenWidth = rect.width();
		int _screenHeight = rect.height();
		boolean screenSizeChanged = _screenHeight!=screenHeight || _screenWidth != screenWidth;
		screenHeight = _screenHeight;
		screenWidth = _screenWidth;
		final IGeoPoint center = projection.fromPixels(screenWidth / 2, screenHeight / 2, null);
		if (zoomLevel != lastZoomLevel || center.getLatitude() != lastLatitude || screenSizeChanged) {
			lastZoomLevel = zoomLevel;
			lastLatitude = center.getLatitude();
			rebuildBarPath(projection);
		}

		int offsetX = xOffset;
		int offsetY = yOffset;
		if (alignBottom) offsetY *=-1;
		if (alignRight ) offsetX *=-1;
		if (centred && latitudeBar)
			offsetX += -latitudeBarRect.width() / 2;
		if (centred && longitudeBar)
			offsetY += -longitudeBarRect.height() / 2;

		projection.save(c, false, true);
		c.translate(offsetX, offsetY);

		if (latitudeBar && bgPaint != null)
			c.drawRect(latitudeBarRect, bgPaint);
		if (longitudeBar && bgPaint != null) {
			// Don't draw on top of latitude background...
			int offsetTop = latitudeBar ? latitudeBarRect.height() : 0;
			c.drawRect(longitudeBarRect.left, longitudeBarRect.top + offsetTop,
					longitudeBarRect.right, longitudeBarRect.bottom, bgPaint);
		}
		c.drawPath(barPath, barPaint);
		if (latitudeBar) {
			drawLatitudeText(c, projection);
		}
		if (longitudeBar) {
			drawLongitudeText(c, projection);
		}
		projection.restore(c, true);
	}
208377
@Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(canvas);
        if (onClickedDrawable != null) {
            onClickedDrawable.draw(canvas);
        }
    }
368641
@Override
    protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
    {
        final double end = attr.getEndAngle();

        final double beg = attr.getStartAngle();

        if (beg == end)
        {
            return false;
        }
        final double ord = attr.getOuterRadius();

        final double ird = attr.getInnerRadius();

        final boolean ccw = attr.isCounterClockwise();

        if ((ord > 0) && (ird > 0))
        {
            context.beginPath();

            context.arc(0, 0, ord, beg, end, ccw);

            context.arc(0, 0, ird, end, beg, (false == ccw));

            context.closePath();

            return true;
        }
        return false;
    }
1035835
public void generate(Context context) {
        Appendable target = context.getTarget();

        for (ProcTemplateElement element : elements) {
            try {
                target.append(element.generate(context));
            } catch (IOException e) {
                // Nothing! Because StringBuilder doesn't catch IOException
            }
        }
    }
1202211
protected void paint(SynthContext context, Graphics g) {
        paintContext = (SeaGlassContext)context;

        updateLeadSelectionRow();

        Rectangle paintBounds = g.getClipBounds();
        Insets insets = tree.getInsets();
        TreePath initialPath = getClosestPathForLocation(tree, 0, paintBounds.y);
        Enumeration paintingEnumerator = treeState.getVisiblePathsFrom(initialPath);
        int row = treeState.getRowForPath(initialPath);
        int endY = paintBounds.y + paintBounds.height;
        TreeModel treeModel = tree.getModel();
        SeaGlassContext cellContext = getContext(tree, Region.TREE_CELL);

        drawingCache.clear();

        setHashColor(context.getStyle().getColor(context, ColorType.FOREGROUND));

        if (paintingEnumerator != null) {
            // First pass, draw the rows

            boolean done = false;
            boolean isExpanded;
            boolean hasBeenExpanded;
            boolean isLeaf;
            Rectangle rowBounds = new Rectangle(0, 0, tree.getWidth(), 0);
            Rectangle bounds;
            TreePath path;
            TreeCellRenderer renderer = tree.getCellRenderer();
            DefaultTreeCellRenderer dtcr = (renderer instanceof DefaultTreeCellRenderer) ? (DefaultTreeCellRenderer) renderer : null;

            configureRenderer(cellContext);
            while (!done && paintingEnumerator.hasMoreElements()) {
                path = (TreePath) paintingEnumerator.nextElement();
                if (path != null) {
                    isLeaf = treeModel.isLeaf(path.getLastPathComponent());
                    if (isLeaf) {
                        isExpanded = hasBeenExpanded = false;
                    } else {
                        isExpanded = treeState.getExpandedState(path);
                        hasBeenExpanded = tree.hasBeenExpanded(path);
                    }
                    bounds = getPathBounds(tree, path);
                    rowBounds.y = bounds.y;
                    rowBounds.height = bounds.height;
                    paintRow(renderer, dtcr, paintContext, cellContext, g, paintBounds, insets, bounds, rowBounds, path, row, isExpanded,
                        hasBeenExpanded, isLeaf);
                    if ((bounds.y + bounds.height) >= endY) {
                        done = true;
                    }
                } else {
                    done = true;
                }
                row++;
            }

            // Draw the connecting lines and controls.
            // Find each parent and have them draw a line to their last child
            boolean rootVisible = tree.isRootVisible();
            TreePath parentPath = initialPath;
            parentPath = parentPath.getParentPath();
            while (parentPath != null) {
                paintVerticalPartOfLeg(g, paintBounds, insets, parentPath);
                drawingCache.put(parentPath, Boolean.TRUE);
                parentPath = parentPath.getParentPath();
            }
            done = false;
            paintingEnumerator = treeState.getVisiblePathsFrom(initialPath);
            while (!done && paintingEnumerator.hasMoreElements()) {
                path = (TreePath) paintingEnumerator.nextElement();
                if (path != null) {
                    isLeaf = treeModel.isLeaf(path.getLastPathComponent());
                    if (isLeaf) {
                        isExpanded = hasBeenExpanded = false;
                    } else {
                        isExpanded = treeState.getExpandedState(path);
                        hasBeenExpanded = tree.hasBeenExpanded(path);
                    }
                    bounds = getPathBounds(tree, path);
                    // See if the vertical line to the parent has been drawn.
                    parentPath = path.getParentPath();
                    if (parentPath != null) {
                        if (drawingCache.get(parentPath) == null) {
                            paintVerticalPartOfLeg(g, paintBounds, insets, parentPath);
                            drawingCache.put(parentPath, Boolean.TRUE);
                        }
                        paintHorizontalPartOfLeg(g, paintBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf);
                    } else if (rootVisible && row == 0) {
                        paintHorizontalPartOfLeg(g, paintBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf);
                    }
                    if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) {
                        paintExpandControl(g, paintBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf);
                    }
                    if ((bounds.y + bounds.height) >= endY) {
                        done = true;
                    }
                } else {
                    done = true;
                }
                row++;
            }
        }
        cellContext.dispose();

        paintDropLine(g);

        // Empty out the renderer pane, allowing renderers to be gc'ed.
        rendererPane.removeAll();

        paintContext = null;
    }
823110
private void init(Context context) {
    try {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.beginSection("DraweeView#init");
      }
      if (mInitialised) {
        return;
      }
      mInitialised = true;
      mDraweeHolder = DraweeHolder.create(null, context);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ColorStateList imageTintList = getImageTintList();
        if (imageTintList == null) {
          return;
        }
        setColorFilter(imageTintList.getDefaultColor());
      }
      // In Android N and above, visibility handling for Drawables has been changed, which breaks
      // activity transitions with DraweeViews.
      mLegacyVisibilityHandlingEnabled =
          sGlobalLegacyVisibilityHandlingEnabled
              && context.getApplicationInfo().targetSdkVersion >= 24; // Build.VERSION_CODES.N
    } finally {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.endSection();
      }
    }
  }