Android Open Source - drive-android-svg My Ellipse






From Project

Back to project page drive-android-svg.

License

The source code is released under:

Apache License

If you think the Android project drive-android-svg listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.goodow.drive.android.svg.graphics;
//from  w w  w  .j  a v a2s  .co m
import android.graphics.Path;
import android.graphics.RectF;

/**
 * Created by liudenghui on 14-5-27.
 */
public class MyEllipse extends MyBaseShape {
  private int cx;
  private int cy;
  private int rx;
  private int ry;

  public int getRx() {
    return rx;
  }

  public void setRx(int rx) {
    this.rx = rx;
  }

  public int getRy() {
    return ry;
  }

  public void setRy(int ry) {
    this.ry = ry;
  }

  private RectF rectF = new RectF();

  public int getCx() {
    return cx;
  }

  public void setCx(int cx) {
    this.cx = cx;
  }

  public int getCy() {
    return cy;
  }

  public void setCy(int cy) {
    this.cy = cy;
  }

  public RectF getRectF() {
    return rectF;
  }

  public void setRectF(RectF rectF) {
    this.rectF = rectF;
  }

  public void generatePath(int cx, int cy, int rx, int ry, int rotate) {
    path.reset();
    path.addOval(new RectF(cx - rx, cy - ry, cx + rx, cy + ry), Path.Direction.CW);
    matrix.setRotate(rotate, cx, cy);
    path.transform(matrix);
    path.computeBounds(bounds, true);
  }

  @Override
  public void generatePath() {
    generatePath(cx, cy, rx, ry, rotate);
  }

}




Java Source Code List

com.goodow.drive.android.svg.DriveAndroidSvgModule.java
com.goodow.drive.android.svg.OnRemoteChangeListener.java
com.goodow.drive.android.svg.OnShowPopupListener.java
com.goodow.drive.android.svg.SvgMainActivity.java
com.goodow.drive.android.svg.SvgModule.java
com.goodow.drive.android.svg.graphics.MyBaseShape.java
com.goodow.drive.android.svg.graphics.MyEllipse.java
com.goodow.drive.android.svg.graphics.MyLine.java
com.goodow.drive.android.svg.graphics.MyPath.java
com.goodow.drive.android.svg.graphics.MyRect.java
com.goodow.drive.android.svg.samples.demo.MainActivity.java
com.goodow.drive.android.svg.utils.CoordinateUtil.java
com.goodow.drive.android.svg.utils.DrawUtil.java
com.goodow.drive.android.svg.utils.ParseUtil.java
com.goodow.drive.android.svg.utils.SwitchUtil.java
com.goodow.drive.android.svg.view.FillColorDialog.java
com.goodow.drive.android.svg.view.LeftMenuLayout.java
com.goodow.drive.android.svg.view.MyDrawable.java
com.goodow.drive.android.svg.view.MySurfaceView.java
com.goodow.drive.android.svg.view.MyViewGroup.java
com.goodow.drive.android.svg.view.MyView.java
com.goodow.drive.android.svg.view.StrokeColorDialog.java
com.goodow.drive.android.svg.view.StrokeWidthDialog.java