📄 receivethread.java
字号:
boolean bFound = false;
for(int j = 0; j < m_applet.m_quoteList.length; j++)
{
if(!m_applet.m_quoteList[j].code.equals(dataList[i].code))
continue;
m_applet.m_quoteList[j] = dataList[i];
bFound = true;
break;
}
if(!bFound)
{
ProductDataVO dataListNew[] = new ProductDataVO[m_applet.m_quoteList.length + 1];
for(int j = 0; j < m_applet.m_quoteList.length; j++)
dataListNew[j] = m_applet.m_quoteList[j];
dataListNew[dataListNew.length - 1] = dataList[i];
m_applet.m_quoteList = dataListNew;
}
}
}
if(m_applet.iCurrentPage != 0)
{
return;
} else
{
Page_MultiQuote page = (Page_MultiQuote)m_applet.mainGraph;
page.sortItems();
m_applet.repaint();
return;
}
}
private void ReceiveMarketSort(DataInputStream reader)
throws IOException
{
int num = reader.readInt();
gnnt.util.service.HQVO.MarketStatusVO values[] = CMDMarketSortVO.getObj(reader);
if(5 != m_applet.iCurrentPage)
{
return;
} else
{
Page_MarketStatus page = (Page_MarketStatus)m_applet.mainGraph;
page.packetInfo = new Packet_MarketStatus();
page.packetInfo.iCount = num;
page.statusData = values;
m_applet.repaint();
return;
}
}
private void ReceiveBillData(DataInputStream reader)
throws IOException
{
String code = reader.readUTF();
byte type = reader.readByte();
int time = reader.readInt();
BillDataVO data[] = CMDBillVO.getObj(reader);
ProductData stock = m_applet.GetProductData(code);
if(stock == null)
{
if(m_applet.vProductData.size() > 50)
m_applet.vProductData.removeElementAt(50);
stock = new ProductData();
stock.sCode = code;
m_applet.vProductData.insertElementAt(stock, 0);
}
switch(type)
{
default:
break;
case 0: // '\0'
MakeLastBills(stock, time, data);
break;
case 1: // '\001'
stock.vBill = new Vector();
for(int i = 0; i < data.length; i++)
stock.vBill.addElement(data[i]);
if(data.length != 0 && 1 == m_applet.iCurrentPage && m_applet.strCurrentCode.equals(code))
m_applet.repaint();
break;
}
}
private void ReceiveMinLineData(DataInputStream reader)
throws IOException
{
String code = reader.readUTF();
byte type = reader.readByte();
int time = reader.readInt();
MinDataVO values[] = CMDMinVO.getObj(reader);
ProductData stock = m_applet.GetProductData(code);
if(stock == null)
{
if(m_applet.vProductData.size() > 50)
m_applet.vProductData.removeElementAt(50);
stock = new ProductData();
stock.sCode = code;
m_applet.vProductData.insertElementAt(stock, 0);
}
stock.vMinLine = new Vector();
int jMin = 0;
for(int i = 0; i < values.length; i++)
{
int iIndex = Common.GetMinLineIndexFromTime(values[i].time, m_applet.m_timeRange, m_applet.m_iMinLineInterval);
for(int j = jMin; j < iIndex; j++)
{
MinDataVO min = new MinDataVO();
if(j > 0)
{
min.curPrice = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).curPrice;
min.totalAmount = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).totalAmount;
min.totalMoney = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).totalMoney;
min.averPrice = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).averPrice;
min.reserveCount = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).reserveCount;
} else
if(stock.realData != null)
{
min.curPrice = stock.realData.yesterBalancePrice;
min.averPrice = stock.realData.yesterBalancePrice;
}
stock.vMinLine.addElement(min);
}
if(iIndex >= stock.vMinLine.size() - 1)
{
MinDataVO min = null;
if(iIndex == stock.vMinLine.size() - 1)
{
min = (MinDataVO)stock.vMinLine.lastElement();
} else
{
min = new MinDataVO();
stock.vMinLine.addElement(min);
}
min.curPrice = values[i].curPrice;
min.totalAmount = values[i].totalAmount;
min.reserveCount = values[i].reserveCount;
min.averPrice = values[i].averPrice;
jMin = iIndex + 1;
}
}
if((2 == m_applet.iCurrentPage || 1 == m_applet.iCurrentPage) && m_applet.strCurrentCode.equals(stock.sCode))
m_applet.repaint();
}
private void MakeLastBills(ProductData stock, int time, BillDataVO values[])
{
if(values.length <= 0)
return;
if(time == 0)
{
stock.vBill = new Vector();
for(int i = 0; i < values.length; i++)
stock.vBill.addElement(values[i]);
if(4 == m_applet.iCurrentPage)
m_applet.repaint();
return;
}
if(stock.vBill == null)
stock.vBill = new Vector();
if(stock.vBill.size() > 0 && ((BillDataVO)stock.vBill.lastElement()).time >= values[0].time)
return;
for(int i = 0; i < values.length; i++)
stock.vBill.addElement(values[i]);
if(stock.vMinLine == null)
stock.vMinLine = new Vector();
for(int i = 0; i < values.length; i++)
{
int iIndex = Common.GetMinLineIndexFromTime(values[i].time, m_applet.m_timeRange, m_applet.m_iMinLineInterval);
if(iIndex < stock.vMinLine.size() - 1)
break;
MinDataVO min = null;
if(iIndex == stock.vMinLine.size() - 1)
{
min = (MinDataVO)stock.vMinLine.elementAt(iIndex);
} else
{
for(int j = stock.vMinLine.size(); j <= iIndex; j++)
{
min = new MinDataVO();
if(j > 0)
{
min.curPrice = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).curPrice;
min.totalAmount = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).totalAmount;
min.totalMoney = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).totalMoney;
min.reserveCount = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).reserveCount;
min.averPrice = ((MinDataVO)stock.vMinLine.elementAt(j - 1)).averPrice;
}
stock.vMinLine.addElement(min);
}
}
min.curPrice = values[i].curPrice;
min.totalAmount = values[i].totalAmount;
min.totalMoney = values[i].totalMoney;
min.reserveCount = values[i].reserveCount;
min.averPrice = values[i].balancePrice;
}
if(values[values.length - 1].time > m_applet.m_iTime)
m_applet.m_iTime = values[values.length - 1].time;
if((2 == m_applet.iCurrentPage || 1 == m_applet.iCurrentPage) && m_applet.strCurrentCode.equals(stock.sCode))
m_applet.repaint();
}
private void ReceiveCodeTable(DataInputStream reader)
throws IOException
{
ProductInfoListVO list = CMDProductInfoVO.getObj(reader);
for(int i = 0; i < list.productInfos.length; i++)
{
boolean bFound = false;
for(int j = 0; j < m_applet.m_codeList.size(); j++)
{
if(!list.productInfos[i].code.equalsIgnoreCase((String)m_applet.m_codeList.elementAt(j)))
continue;
bFound = true;
break;
}
if(!bFound)
m_applet.m_codeList.addElement(list.productInfos[i].code);
CodeTable codeTable = new CodeTable();
codeTable.sName = list.productInfos[i].name;
codeTable.sPinyin = list.productInfos[i].pyName;
codeTable.status = list.productInfos[i].status;
codeTable.fUnit = list.productInfos[i].fUnit;
codeTable.tradeSecNo = list.productInfos[i].tradeSecNo;
m_applet.m_htProduct.put(list.productInfos[i].code, codeTable);
m_applet.m_iCodeDate = list.date;
m_applet.m_iCodeTime = list.time;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -