⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page_bill.jad

📁 java 写的股票技术分析;软件
💻 JAD
📖 第 1 页 / 共 2 页
字号:
                        if((float)sell > buy)
                            ask = 1;
                        else
                            ask = 2;
                    }
                    if(ask == 0)
                    {
                        str = "\u2191";
                        g.setColor(HQApplet.rhColor.clIncrease);
                    } else
                    if(ask == 1)
                    {
                        str = "\u2193";
                        g.setColor(HQApplet.rhColor.clDecrease);
                    } else
                    {
                        str = "\u2013";
                        g.setColor(HQApplet.rhColor.clEqual);
                    }
                    g.drawString(str, x, y);
                }
            }
            if(fieldInfo[3].visible)
            {
                String str = String.valueOf(bill.openAmount);
                x = (int)((float)x + (float)fieldInfo[3].width * zoomRate);
                g.setColor(HQApplet.rhColor.clNumber);
                g.drawString(str, x - fm.stringWidth(str), y);
            }
            if(fieldInfo[4].visible)
            {
                String str = String.valueOf(bill.closeAmount);
                x = (int)((float)x + (float)fieldInfo[4].width * zoomRate);
                g.setColor(HQApplet.rhColor.clNumber);
                g.drawString(str, x - fm.stringWidth(str), y);
            }
            y += rowHeight;
        }

    }

    boolean KeyPressed(KeyEvent e)
    {
        int iKeyCode = e.getKeyCode();
        switch(iKeyCode)
        {
        default:
            break;

        case 34: // '"'
            if(curPageNo > 0)
            {
                curPageNo--;
                return true;
            }
            break;

        case 33: // '!'
            if(curPageNo < totalPages - 1)
            {
                curPageNo++;
                return true;
            }
            break;
        }
        return false;
    }

    void initPageInfo(Graphics g)
    {
        stock = super.m_applet.GetProductData(super.m_applet.strCurrentCode);
        if(stock == null || stock.realData == null || stock.vBill == null)
            return;
        int iSize = stock.vBill.size();
        if(iSize <= 0)
            return;
        FontMetrics fm = g.getFontMetrics(fntTitle);
        int titleHeight = fm.getHeight();
        fm = g.getFontMetrics(fntText);
        int fontHeight = fm.getHeight();
        rowHeight = fontHeight + 2;
        iRows = (super.m_rc.height - titleHeight - fontHeight - 6) / rowHeight;
        int totalPages = (iSize - 1) / (iRows * 3);
        if((iSize - 1) % (iRows * 3) != 0)
            totalPages++;
        if(totalPages != this.totalPages)
        {
            this.totalPages = totalPages;
            curPageNo = 0;
        }
    }

    void initVisibleField()
    {
        int maxWidth = super.m_rc.width / 3 - 4;
        if(maxWidth < 0)
            maxWidth = 0;
        int usedWidth = 0;
        int visibleFieldCount = 0;
        int fieldNum = fieldInfo.length;
        for(int i = 0; i < fieldNum; i++)
        {
            if(usedWidth + fieldInfo[i].width < maxWidth)
            {
                fieldInfo[i].visible = true;
                visibleFieldCount++;
                usedWidth += fieldInfo[i].width;
                continue;
            }
            for(int j = i; j < fieldNum; j++)
                fieldInfo[j].visible = false;

            break;
        }

        if(visibleFieldCount <= 0)
            visibleFieldCount = 1;
        if(visibleFieldCount == fieldNum)
            zoomRate = (float)maxWidth / (float)usedWidth;
    }

    private void makeMenus()
    {
        menuPageMinLine = new MenuItem(super.m_applet.getShowString("MinLine") + "  F5");
        menuPageMinLine.setActionCommand("minline");
        menuPageMinLine.addActionListener(this);
        menuPageKLine = new MenuItem(super.m_applet.getShowString("Analysis"));
        menuPageKLine.setActionCommand("kline");
        menuPageKLine.addActionListener(this);
        menuQuote = new MenuItem(super.m_applet.getShowString("MultiQuote") + "  F2");
        menuQuote.setActionCommand("cmd_quote");
        menuQuote.addActionListener(this);
        menuMarket = new MenuItem(super.m_applet.getShowString("ClassedList") + "  F4");
        menuMarket.setActionCommand("cmd_market");
        menuMarket.addActionListener(this);
    }

    public void processMenuEvent(PopupMenu popupMenu, int x, int y)
    {
        popupMenu.removeAll();
        popupMenu.add(menuPageMinLine);
        popupMenu.add(menuPageKLine);
        popupMenu.addSeparator();
        popupMenu.add(menuQuote);
        popupMenu.add(menuMarket);
        processCommonMenuEvent(popupMenu, this);
        popupMenu.show(super.m_applet, x, y);
    }

    public void actionPerformed(ActionEvent e)
    {
        String cmd = e.getActionCommand();
        if(cmd.indexOf("cmd_") >= 0)
        {
            String requestType = cmd.substring(4);
            if(requestType.equals("quote"))
                executeQuoteCommand();
            else
            if(requestType.equals("market"))
                executeMarketCommand();
        } else
        if(cmd.equals("minline"))
            super.m_applet.showPageMinLine();
        else
        if(cmd.equals("kline"))
            super.m_applet.showPageKLine();
        else
            super.actionPerformed(e);
    }

    private void executeQuoteCommand()
    {
        switch(iProductType)
        {
        case 1: // '\001'
            super.m_applet.UserCommand("60");
            break;

        default:
            super.m_applet.UserCommand("60");
            break;
        }
    }

    private void executeMarketCommand()
    {
        switch(iProductType)
        {
        case 1: // '\001'
            super.m_applet.UserCommand("80");
            break;

        default:
            super.m_applet.UserCommand("80");
            break;
        }
    }

    static final int ROW_NUM = 3;
    BillFieldInfo fieldInfo[];
    float zoomRate;
    int fieldWidth;
    int totalPages;
    int curPageNo;
    int iRows;
    ProductData stock;
    static final Font fntTitle = new Font("\u6977\u4F53", 1, 20);
    static final Font fntText = new Font("\u5B8B\u4F53", 0, 16);
    int rowHeight;
    int startY;
    int iProductType;
    MenuItem menuPageMinLine;
    MenuItem menuPageKLine;
    MenuItem menuQuote;
    MenuItem menuMarket;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -