6. Draw2D 살펴보기
Figure?
Draw2D에서 표현 되어 지는 것.
반드시 하나의 Root Figure가 존재해야함.
부모 자식과의 관계가 가능 하며, 마우스 이벤트
등의 이벤트 가능
SWT의 Shell, Control, Composite등과 비슷함.
Class는 org.eclipse.draw2d.IFigurer
9. Figure
Figure?
Draw2D에서 표현 되어 지는 것.
반드시 하나의 Root Figure가 존재해야함.
부모 자식과의 관계가 가능 하며, 마우스 이벤트
등의 이벤트 가능
SWT의 Shell, Control, Composite등과 비슷함.
Class는 org.eclipse.draw2d.IFigurer
10. Figure – Common Figures
Shapes – rectangle, triangles, ellipse
Clickables – buttons, checkboxes
Containers – Panel, ScrollPane
Connections – figure간의 line
Layered – figure 들을 layer
Other – ImageFigure, Label등
26. Router
BendpointConnectionRouter
AbsoluteBendpoint : 절대 좌표 리턴
AbsoluteBendpoint(350, 10);
RelativeBendpoint :
RelativeBendpoint bp2 = new RelativeBendpoint(firstConnection);
bp2.setRelativeDimensions(new Dimension(-50, 20), new
Dimension(10, -40));
27. Connection Labels(Locator)
Locator
이 름 종 류
BendpointLocator BendpointConnectionRoutter의
텍스트
ConnectionEndpointLocator 선의 양끝 텍스트
MidpointLocator 선의 중앙 텍스트
ConnectionLocator
RelativeLocator
28. PolylineConnection ManhattanConnectionRouter
PolylineConnection connection = new PolylineConnection();
..
// source label decoration
ConnectionEndpointLocator locator = new
ConnectionEndpointLocator (connection, false);
Label label = new Label("Source");
connection.add(label, locator);
// target label decoration
locator = new ConnectionEndpointLocator (connection, true);
label = new Label("Target");
connection.add(label, locator);
//
ManhattanConnectionRouter router = new
ManhattanConnectionRouter ();
connection.setConnectionRouter (router);
// rootFigure에 추가합니다.
rootFigure.add(connection);