// ! 构造绘图视图,允许在Activity的onCreate(Bundle)或onRestoreInstanceState(Bundle)中调用 public StdGraphView(Context context, Bundle savedInstanceState) { super(context); mImageCache = new ImageCache(); createAdapter(context, savedInstanceState); mCoreView = GiCoreView.createView(mViewAdapter); initView(context); ViewUtil.onAddView(this); }
// ! 放大镜视图(mainView有效)或临时视图(mainView=nil)的构造函数 public StdGraphView(Context context, BaseGraphView mainView) { super(context); mImageCache = mainView != null ? mainView.getImageCache() : new ImageCache(); createAdapter(context, null); mMainView = mainView; if (mainView != null) { mCoreView = GiCoreView.createMagnifierView(mViewAdapter, mainView.coreView(), mainView.viewAdapter()); } else { mCoreView = GiCoreView.createView(mViewAdapter, GiCoreView.kNoCmdType); } initView(context); }