Exemplo n.º 1
0
        void _renderToView(String code, xGraphics g, xBaseControl view)
        {
            mCode    = code;
            graphics = g;

            Rectangle rc = new Rectangle(view.getX(), view.getY(), view.getW(), view.getH());

            _renderToView(code, g, rc);
        }
Exemplo n.º 2
0
        override public void setSize(xBaseControl c)
        {
            base.setSize(c.getW(), c.getH());
            clearModifyKey();

            if (mDrawer != null)
            {
                mDrawer.recalcPosition();
            }
        }
Exemplo n.º 3
0
        void onPageSelected(int pageIdx)
        {
            mContext.setMarketControlTab(mMarketID, pageIdx);

            int      idx  = TAB_INDEX[pageIdx];
            xTabPage page = mTab.getPageAtIndex(pageIdx);

            if (idx == ID_ONLINE_CHART)
            {
                mRealtimeChart.invalidate();
            }
            else if (idx == ID_CANDLE)
            {
                xContainer c = new xContainer();
                c.setSize(mCurrentChart);

                TodayCandle            candle = new TodayCandle();
                stPriceboardStateIndex pi     = mContext.mPriceboard.getPriceboardIndexOfMarket(mMarketID);
                Share share = mContext.mShareManager.getShare(pi.code);
                candle.setShare(share);

                int w  = mCurrentChart.getW();
                int h  = mCurrentChart.getH();
                int cw = w * 3 / 7;
                if (cw > 160)
                {
                    cw = 160;
                }
                candle.setSize(cw, h);

                c.addControl(candle);

                //  summary
                xBaseControl summary = createMarketSummary(w - cw, h);
                summary.setPosition(cw, 0);
                c.addControl(summary);

                mCurrentChart = c;
                //==============================
                page.resetContent();
                page.addControl(c);
            }
            else if (idx == ID_MONEY_CHART)
            {
                page.resetContent();

                ChartStatistics moneyChart = new ChartStatistics(mMarketID, mListener);
                moneyChart.setSize(mRealtimeChart.getW(), mRealtimeChart.getH() - 18);
                moneyChart.setPosition(mRealtimeChart.getX(), mRealtimeChart.getY());
                moneyChart.setChartType(ChartStatistics.BUBBLE_TRADE_MONEY);

                moneyChart.doCalcChanged();

                page.addControl(moneyChart);

                mCurrentChart = moneyChart;
            }
            else if (idx == ID_VOLUMN_CHART)
            {
                page.resetContent();

                ChartStatistics moneyChart = new ChartStatistics(mMarketID, mListener);
                moneyChart.setSize(mRealtimeChart.getW(), mRealtimeChart.getH() - 18);
                moneyChart.setPosition(mRealtimeChart.getX(), mRealtimeChart.getY());
                moneyChart.setChartType(ChartStatistics.BUBBLE_VOLUME_WEIGHT);

                moneyChart.doCalcChanged();

                page.addControl(moneyChart);

                mCurrentChart = moneyChart;
            }
            else if (idx == ID_INDEX_EFFECT_INC)
            {
                page.resetContent();

                ChartStatistics moneyChart = new ChartStatistics(mMarketID, mListener);
                moneyChart.setSize(mRealtimeChart.getW(), mRealtimeChart.getH() - 18);
                moneyChart.setPosition(mRealtimeChart.getX(), mRealtimeChart.getY());
                moneyChart.setChartType(ChartStatistics.BUBBLE_INDEX_WEIGHT_RATIO_INC);

                moneyChart.doCalcChanged();

                page.addControl(moneyChart);

                mCurrentChart = moneyChart;
            }
            else if (idx == ID_INDEX_EFFECT_DEC)
            {
                page.resetContent();

                ChartStatistics moneyChart = new ChartStatistics(mMarketID, mListener);
                moneyChart.setSize(mRealtimeChart.getW(), mRealtimeChart.getH() - 18);
                moneyChart.setPosition(mRealtimeChart.getX(), mRealtimeChart.getY());
                moneyChart.setChartType(ChartStatistics.BUBBLE_INDEX_WEIGHT_RATIO_DEC);

                moneyChart.doCalcChanged();

                page.addControl(moneyChart);

                mCurrentChart = moneyChart;
            }
        }