Hi all,i'm a newer on processing,develop a project to show relations of datanodes,like this:
the whole cavas revolves itself,and the nodes will be added .i redraw all the items every frame and i hope the framespeed is 28-30 frames/second. My trouble is:when the number of nodes is 5 or 6,it runs well;when the number of nodes more than 6,it runs too slowly.Hope somebody help me to make it runs well ,thanks a lot. Here is my code:::::::::::::
mainclass
import processing.opengl.*;
PImage maskImg;
//递减效果标示
boolean deleteLineFlag = false;
boolean deleteNodeFlag = false;
//外圈大圆半径
int BigR = 250;
//展示图片圆的半径
int smallr = 150;
//保存图片节点数据,key为图片名称,唯一;值为图片节点对象
HashMap htNodes = new HashMap();
//保存节点对象数据
ArrayList nodes = new ArrayList();
//保存节点关系连线数据对象
ArrayList edges = new ArrayList();
//整体画布重绘次数
int iLoop=0;
//已经绘制的节点的数目
int iDrawNodes=0;
//已经绘制的关系连接的数目
int iDrawLines=-50;
//需要显示的节点数目
int iNodeNumGroup = 10;
//已经绘制的节点的数目
int iNodeNum=0;
//节点相距角度
int iDelta = 0;
//每一帧的整体图片旋转角度
int iDeltaMod = 1;