• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DrawEvent类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.smartgwt.client.widgets.events.DrawEvent的典型用法代码示例。如果您正苦于以下问题:Java DrawEvent类的具体用法?Java DrawEvent怎么用?Java DrawEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DrawEvent类属于com.smartgwt.client.widgets.events包,在下文中一共展示了DrawEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bindExpansinonForm

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
private DynamicForm bindExpansinonForm(final DynamicForm form, final Record record) {
    form.addDrawHandler(new DrawHandler() {

        @Override
        public void onDraw(DrawEvent event) {
            form.editRecord(record);
        }
    });
    return form;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:11,
代码来源:WorkflowMaterialView.java

示例2: rendered

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
private void rendered() {
    onDraw();
    fireEvent(new DrawEvent(getID()));
    if (onRenderFn != null) {
        onRenderFn.execute();
    }
}
 

开发者ID:Lauriapple1,
项目名称:security-gwt,
代码行数:8,
代码来源:BaseWidget.java

示例3: createModalPanel

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
private void createModalPanel() {
	parent = new HLayout();
	parent.setDefaultLayoutAlign(VerticalAlignment.CENTER);
	parent.hide();
	// we need a handler to ensure we always cover the entire canvas
	parent.addDrawHandler(new DrawHandler() {
		public void onDraw(DrawEvent event) {
			parent.setWidth(canvas.getVisibleWidth());
			parent.setHeight(canvas.getVisibleHeight());
		}
	});

	transparent = new Canvas();
	transparent.setWidth100();
	transparent.setHeight100();
	transparent.setBackgroundColor(maskingColor);
	transparent.setOpacity(opacity);
	parent.addChild(transparent);

	modal = new VLayout();
	modal.setDefaultLayoutAlign(Alignment.CENTER);
	modal.setHeight(25); // this is for label height
	modal.setZIndex(transparent.getZIndex() + 2);
	parent.addMember(modal);
	
	insertModalIntoCanvas();
}
 

开发者ID:SHARP-HTP,
项目名称:phenotype-portal,
代码行数:28,
代码来源:ModalWindow.java

示例4: createLabel

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
private Label createLabel(String message, boolean showLoading) {
	final Label label = new Label();
	label.setWrap(false);
	label.setPadding(10);
	label.setWidth(200);
	label.setHeight(40);
	label.setContents(message);
	label.setBackgroundColor(messageBoxBgColor);
	label.setBorder("1px solid #999");
	label.setShowShadow(true);
	label.setShadowSoftness(0);
	label.setShadowOffset(15);
	label.addDrawHandler(new DrawHandler() {
		public void onDraw(DrawEvent event) {
			int visibleWidth = label.getVisibleWidth();
			label.setWidth(visibleWidth);
			label.setMargin(10);
		}
	});
	label.setAlign(Alignment.CENTER);
	if (showLoading) {
		if (loadingIcon != null) { // icon provided by user
			label.setIcon(loadingIcon);
		} else { // show default icon from used skin
			String icon = Page.getSkinImgDir() + "loading.gif";
			label.setIcon(icon);
		}
		if (message.equals("")) { // no spacing, just show the loading icon
			// centered
			label.setIconSpacing(0);
		}
	}
	label.setZIndex(modal.getZIndex() + 2);
	return label;
}
 

开发者ID:SHARP-HTP,
项目名称:phenotype-portal,
代码行数:36,
代码来源:ModalWindow.java

示例5: onDraw

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
@Override
public void onDraw(DrawEvent event) {
    ClientUtils.fine(LOG, "image onDraw: %s", image.getUrl());
    scheduleForRender();
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:6,
代码来源:DigitalObjectPreview.java

示例6: addDrawHandler

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
public HandlerRegistration addDrawHandler(final DrawHandler handler) {
    return doAddHandler(handler, DrawEvent.getType());
}
 

开发者ID:Lauriapple1,
项目名称:security-gwt,
代码行数:4,
代码来源:BaseWidget.java

示例7: buildWidget

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
/**
 * Build the entire widget.
 * 
 * @param layer layer
 */
private void buildWidget(VectorLayer layer) {
	mapModel = layer.getMapModel();

	setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(""));
	setCanDragReposition(true);
	setCanDragResize(true);

	attributeTable = new FeatureAttributeEditor(layer, true, factory);

	toolStrip = new ToolStrip();
	toolStrip.setWidth100();
	toolStrip.setPadding(WidgetLayout.marginSmall);

	toolStrip.addMember(new ZoomButton());
	editButton = new EditButton();
	LayoutSpacer spacer = new LayoutSpacer();
	spacer.setWidth(2);
	toolStrip.addMember(spacer);
	if (editingAllowed) {
		toolStrip.addMember(editButton);
	}

	savePanel = new HLayout(WidgetLayout.marginSmall);
	saveButton = new SaveButton();
	IButton resetButton = new ResetButton();
	IButton cancelButton = new CancelButton();
	savePanel.addMember(saveButton);
	savePanel.addMember(resetButton);
	savePanel.addMember(cancelButton);
	savePanel.setVisible(false);
	savePanel.setAlign(Alignment.CENTER);
	savePanel.setPadding(WidgetLayout.marginSmall);

	VLayout layout = new VLayout();
	layout.addMember(toolStrip);
	layout.addMember(attributeTable);
	layout.addMember(savePanel);
	layout.setWidth(WidgetLayout.featureAttributeWindowLayoutWidth);
	addItem(layout);

	// Set the save button as disabled at startup:
	addDrawHandler(new DrawHandler() {

		public void onDraw(DrawEvent event) {
			saveButton.setDisabled(true);
		}
	});
}
 

开发者ID:geomajas,
项目名称:geomajas-project-client-gwt,
代码行数:54,
代码来源:FeatureAttributeWindow.java

示例8: getViewPanel

点赞 2

import com.smartgwt.client.widgets.events.DrawEvent; //导入依赖的package包/类
/**
 * @return The viewPanel Canvas
 */
public Canvas getViewPanel() {
	/**
	 * <p>
	 * A RectangleController that calculates the size of the selected area and outputs it.
	 * </p>
	 * @author Frank Wynants
	 */
	class AreaController extends AbstractRectangleController {
		// A RectangleController that prints the size of the selected area
		
		/**
		 * Constructor
		 * 
		 * @param mapWidget
		 */
		public AreaController(MapWidget mapWidget) {
			super(mapWidget);
		}

		/**
		 * When the user selects a rectangle the size of the rectangle in km is printed out and the total size of
		 * the area is computed and printed out
		 * 
		 * @param worldBounds
		 */
		protected void selectRectangle(Bbox worldBounds) {

			double cWidth = worldBounds.getWidth();
			double cHeight = worldBounds.getHeight();

			// transfer degrees to km
			double kmWidth = cWidth * KM_DEGREE;
			double kmHeight = cHeight * KM_DEGREE;

			// compute total area
			double area = kmWidth * kmHeight;

			// round the numbers two 2 digits for easier human reading
			double roundedKmWidth = Math.round(kmWidth * 100) / 100.0;
			double roundedKmHeight = Math.round(kmHeight * 100) / 100.0;
			double roundedArea = Math.round(area * 100) / 100.0;

			SC.say(MESSAGES.rectangeControllerOutput(roundedKmWidth, roundedKmHeight, roundedArea));
		}
	}

	VLayout layout = new VLayout();
	layout.setWidth100();
	layout.setHeight100();

	// Map with ID wmsMap is defined in the XML configuration. (mapWms.xml)
	final MapWidget map = new MapWidget("mapWms", "gwtExample");
	map.addDrawHandler(new DrawHandler() {

		public void onDraw(DrawEvent event) {
			AreaController areaController = new AreaController(map);
			map.setController(areaController);
		}
	});

	layout.addMember(map);
	return layout;
}
 

开发者ID:geomajas,
项目名称:geomajas-project-client-gwt,
代码行数:67,
代码来源:RectangleControllerSample.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)