btnRedo.setDisabled(true);
removeFreeDrawingController();
}
public Canvas getSearchCanvas() {
final VLayout mainLayout = new VLayout(20);
mainLayout.setWidth100();
mainLayout.setHeight100();
mainLayout.setPadding(5);
Label titleBar = new Label(messages.geometricSearchWidgetFreeDrawingSearchTitle());
titleBar.setBackgroundColor("#E0E9FF");
titleBar.setWidth100();
titleBar.setHeight(20);
titleBar.setPadding(5);
HLayout geomsButtonBar = new HLayout();
geomsButtonBar.setWidth100();
geomsButtonBar.setAutoHeight();
geomsButtonBar.setMembersMargin(10);
HLayout actionsButtonBar = new HLayout();
actionsButtonBar.setWidth100();
actionsButtonBar.setAutoHeight();
actionsButtonBar.setMembersMargin(10);
btnPoint = new IButton(messages.geometricSearchWidgetFreeDrawingPoint());
btnPoint.setIcon(BTN_POINT_CREATE_IMG);
btnPoint.setAutoFit(true);
btnPoint.setActionType(SelectionType.RADIO);
btnPoint.setRadioGroup("drawType");
btnPoint.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onDrawPoint();
}
});
btnLine = new IButton(messages.geometricSearchWidgetFreeDrawingLine());
btnLine.setIcon(BTN_LINE_CREATE_IMG);
btnLine.setAutoFit(true);
btnLine.setActionType(SelectionType.RADIO);
btnLine.setRadioGroup("drawType");
btnLine.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onDrawLine();
}
});
btnPolygon = new IButton(messages.geometricSearchWidgetFreeDrawingPolygon());
btnPolygon.setIcon(BTN_POLYGON_CREATE_IMG);
btnPolygon.setAutoFit(true);
btnPolygon.setActionType(SelectionType.RADIO);
btnPolygon.setRadioGroup("drawType");
btnPolygon.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onDrawPolygon();
}
});
IButton btnAdd = new IButton(messages.geometricSearchWidgetFreeDrawingAdd());
btnAdd.setIcon(BTN_ADD_IMG);
btnAdd.setAutoFit(true);
btnAdd.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onAdd();
}
});
btnUndo = new IButton(messages.geometricSearchWidgetFreeDrawingUndo());
btnUndo.setIcon(BTN_UNDO_IMG);
btnUndo.setAutoFit(true);
btnUndo.setDisabled(true);
btnUndo.setShowDisabledIcon(false);
btnUndo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onUndo();
}
});
btnRedo = new IButton(messages.geometricSearchWidgetFreeDrawingRedo());
btnRedo.setIcon(BTN_REDO_IMG);
btnRedo.setAutoFit(true);
btnRedo.setDisabled(true);
btnRedo.setShowDisabledIcon(false);
btnRedo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
onRedo();
}
});
frmBuffer = new DynamicForm();
frmBuffer.setWidth100();
spiBuffer = new SpinnerItem();
spiBuffer.setTitle(messages.geometricSearchWidgetBufferLabel());
spiBuffer.setDefaultValue(5);
spiBuffer.setMin(0);
spiBuffer.setWidth(60);
spiBuffer.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
updateView();
}
});
frmBuffer.setFields(spiBuffer);
// ----------------------------------------------------------
geomsButtonBar.addMember(btnPoint);
geomsButtonBar.addMember(btnLine);
geomsButtonBar.addMember(btnPolygon);
actionsButtonBar.addMember(btnAdd);
actionsButtonBar.addMember(btnUndo);
actionsButtonBar.addMember(btnRedo);
mainLayout.addMember(titleBar);
mainLayout.addMember(geomsButtonBar);
mainLayout.addMember(frmBuffer);
mainLayout.addMember(actionsButtonBar);
return mainLayout;
}