2009-11-25 4 views
0

아래 테스트 클래스를 작성했지만 com.smartgwt.client.widgets.Window에 추가 할 수 없습니다.gwt-connectors를 smartgwt에 추가하십시오.

누구나 도움이 될 수 있습니까? 미리 감사드립니다!

package com.smartgwt.sample.showcase.client; 

import pl.tecna.gwt.connectors.client.ConnectionPoint; 가져 오기 pl.tecna.gwt.connectors.client.Connector; 가져 오기 pl.tecna.gwt.connectors.client.Diagram; 가져 오기 pl.tecna.gwt.connectors.client.SectionDecoration; 가져 오기 pl.tecna.gwt.connectors.client.Shape;

import com.google.gwt.user.client.ui.AbsolutePanel; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Image; import com.smartgwt.client.widgets.Label;

Public 클래스 NetworkMap {

공개 NetworkMap() { AbsolutePanel 위젯 = 새로운 AbsolutePanel();

final Diagram diagram = new Diagram(widget); 

    final Label label = new Label("LABEL"); 

최종 이미지 이미지 = new Image ("http://code.google.com/images/code_sm.png"); image.setPixelSize (153, 55);

widget.add (label, 50, 250); widget.add (image, 200, 300);

도형 shapeForLabel = 새 도형 (레이블); shapeForLabel.showOnDiagram (diagram);

도형 shapeForImage = 새 도형 (이미지); shapeForImage.showOnDiagram (diagram);

ConnectionPoint labelConnectionPoint = shapeForLabel.connectionPoints [Shape.E]; ConnectionPoint imageConnectionPoint = shapeForImage.connectionPoints [Shape.W];

Connector label2image = new Connector 
    (labelConnectionPoint.getAbsoluteLeft(), 
        labelConnectionPoint.getAbsoluteTop(), 
        imageConnectionPoint.getAbsoluteLeft(), 
        imageConnectionPoint.getAbsoluteTop(), 
        null, 
        new SectionDecoration(SectionDecoration.DECORATE_ARROW)); 

label2image.startEndPoint.glueToConnectionPoint(labelConnectionPoint); 
label2image.endEndPoint.glueToConnectionPoint(imageConnectionPoint); 

label2image.showOnDiagram(diagram); 
    /* // Create boundary panel 

AbsolutePanel boundaryPanel = new AbsolutePanel();

initWidget (boundaryPanel); boundaryPanel.setSize ("700px", "700px"); RootPanel.get(). add (boundaryPanel, 10, 10);

최종 다이어그램 다이어그램 = new 다이어그램 (boundaryPanel);

boundaryPanel.add (새 레이블 ("GWT 1.7의 커넥터 예제"), 10, 2);

// 연결할 수있는 요소를 추가하십시오. final Label label = new Label ("LABEL"); 최종 이미지 이미지 = 새 이미지 ("http://code.google.com/images/code_sm.png"); image.setPixelSize (153, 55);

boundaryPanel.add (label, 50, 250); boundaryPanel.add (image, 200, 300);

도형 shapeForLabel = 새 도형 (레이블); shapeForLabel.showOnDiagram (다이어그램);

도형 shapeForImage = 새 도형 (이미지); shapeForImage.showOnDiagram (diagram);

// 레이블 및 이미지 연결 연결 지점 labelConnectionPoint = shapeForLabel.connectionPoints [Shape.E]; ConnectionPoint imageConnectionPoint = shapeForImage.connectionPoints [Shape.W];

Connector label2image = new Connector 
    (labelConnectionPoint.getAbsoluteLeft(), 
        labelConnectionPoint.getAbsoluteTop(), 
        imageConnectionPoint.getAbsoluteLeft(), 
        imageConnectionPoint.getAbsoluteTop(), 
        null, 
        new SectionDecoration(SectionDecoration.DECORATE_ARROW)); 

label2image.startEndPoint.glueToConnectionPoint(labelConnectionPoint); 
label2image.endEndPoint.glueToConnectionPoint(imageConnectionPoint); 

label2image.showOnDiagram(diagram); 
*/ 

}

}

답변

0

지금까지 내가 당신이 창 위젯에 NetworkMap를 넣어하려고 이해. NetworkMap 클래스는 Composite 인터페이스를 구현하여 창, 패널 등에서 위젯으로 간주 할 수 있어야합니다. Composite 인터페이스를 구현하면 기본 패널/패널을 제공하여 initWidget() 함수를 호출해야합니다. 레이아웃은 NetworkMap 클래스 내부에 위젯을 포함하고 있습니다. 그러므로 당신은 글을 써야합니다.

public class NetworkMap extends Composite { ... } 
관련 문제