q**c 发帖数: 179 | 1 basically have two parts.
One is a window, having buttons etc. and also loading data,
which is extended from frame.
The other is a 'Plot', to plot data depending on the types,
which is extended from canvas.
The thing is I want to make this Plot more independent, so
what's the best way to communicate between the window and
the Plot?
have checked some examples by googling. however most are
very small programs with Plot itself dealing with I/O data. | KG 发帖数: 515 | 2 Independent of what? If you r looking for help, you better make your question
more clear to others.
【在 q**c 的大作中提到】 : basically have two parts. : One is a window, having buttons etc. and also loading data, : which is extended from frame. : The other is a 'Plot', to plot data depending on the types, : which is extended from canvas. : The thing is I want to make this Plot more independent, so : what's the best way to communicate between the window and : the Plot? : have checked some examples by googling. however most are : very small programs with Plot itself dealing with I/O data.
| g*s 发帖数: 2277 | 3 encapsulation吧. 把data作为Plot的Attribute,在Plot里定义setData去设置data,
override paint or repaint(Canvas的method吧?忘了)去画点啊线啊.
【在 KG 的大作中提到】 : Independent of what? If you r looking for help, you better make your question : more clear to others.
| w*r 发帖数: 2421 | 4 I think you question is that you want to make a 'generic' plot package
which can take varioius forms of data.
I am working on my project by letting the chart/plot package accept the
XML form of data. Basically most of my plot is 2D plot, then I just define
the data as
.......
by letting this generic structure , you can write your parser to parse it
into your chart's data object, then you can draw
you are free to exten
【在 q**c 的大作中提到】 : basically have two parts. : One is a window, having buttons etc. and also loading data, : which is extended from frame. : The other is a 'Plot', to plot data depending on the types, : which is extended from canvas. : The thing is I want to make this Plot more independent, so : what's the best way to communicate between the window and : the Plot? : have checked some examples by googling. however most are : very small programs with Plot itself dealing with I/O data.
|
|