public class BaseReportFigure extends Figure {
//这个方法表示这个figure上的孩子将使用相对坐标
protected boolean useLocalCoordinates() {
return true;
}
}
public Command getCommand(Request request) {
Command command = super.getCommand(request);
if (command!=null &&
request.getType().equals(RequestConstants.REQ_CREATE))
{
Point location = ((CreateRequest)request).getLocation().getCopy();
//转换鼠标绝对位置到该Figure的相对位置
getFigure().translateToRelative(location);
getFigure().translateFromParent(location);
// System.out.println(location);
request.getExtendedData().put(RELATIVELOCATION, location);
}
return command;
}