jgraph note(5-30)

 Chapter 3

1. All graph cells have at least one associated cell view that deals with various visual functionality and the process of updating the visualization of that cell. Cell views associate a renderer, and editor and a cell handle.

2. Renderers are part of the Swing design, they abstract the drawing functionality of a component into a single static class instance, a pattern also known as the flyweight design. when a graph cell is rendered the attributes of the cell view are fetched and inserted into the renderer instance, a process known as configuring the renderer.

3. the default editor provided is a simple, single-line editor called DefaultGraphCellEditor, that extends CellEditor

 4. Handles are based on the Composite pattern in JGraph. interface: CellHandle Class.  composite: RootHandle. The cellHandle interface defines the basic functionality a handle must provide, note that the CellHandle interface is very similar to that of MouseMotionListener and MouseListener.

5. The getRendererComponent(), getHandle(), getEditor() methods return the renderer, the handle and the editor asscoiated with the cell view.

6. the refresh() method updates the cell view attributes, but does not cause the cell view to repaint. the 3 editing methods automatically call refresh and repaint for all views affected by the change.

7. hold a single static renderer instance for each type of cell view to reduce the memory footprint.-----flyweight pattern.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值