当前位置: 首页>>代码示例>>Java>>正文


Java PopupPanel.setStylePrimaryName方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.PopupPanel.setStylePrimaryName方法的典型用法代码示例。如果您正苦于以下问题:Java PopupPanel.setStylePrimaryName方法的具体用法?Java PopupPanel.setStylePrimaryName怎么用?Java PopupPanel.setStylePrimaryName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.PopupPanel的用法示例。


在下文中一共展示了PopupPanel.setStylePrimaryName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MultiLineTextDisplayElement

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public MultiLineTextDisplayElement(String id, int x, int y, int width, int height,
        String text, String label, int[][] coords) {
    super(id, x, y, width, height);
    this.coords = coords;
    this.label = label;
    this.text = text;
    
    popup = new PopupPanel(true, false);
    HTML content = new HTML(text);
	
    popup.setStylePrimaryName("PopupPanel");
    popup.addStyleName("AnnotationPopup");
	popup.setWidget(content);
    
 // Create a canvas containing the filled polygon with no border
    Canvas sub_canvas = Canvas.createIfSupported();
    sub_canvas.setCoordinateSpaceWidth(width);
    sub_canvas.setCoordinateSpaceHeight(height);
    
    Context2d context = sub_canvas.getContext2d();
    context.beginPath();
    context.moveTo(coords[0][0] - baseLeft(), coords[0][1] - baseTop());

    for (int i = 1; i < coords.length; i++) {
    	context.lineTo(coords[i][0] - baseLeft(), coords[i][1] - baseTop());
    }
	
    context.setFillStyle(color_fill);
    context.fill();
    
    context.closePath();
    
    this.image_data = context.getImageData(0, 0, width, height);
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:35,代码来源:MultiLineTextDisplayElement.java

示例2: setInstructions

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void setInstructions(final String instructions, final String infoButtonChar, final String closeButtonLabel) {
        final HTML instructionsLabel = new HTML(instructions);
        final PopupPanel popupPanel = new PopupPanel(false); // the close action to this panel causes background buttons to be clicked
        popupPanel.setGlassEnabled(true);
        popupPanel.setStylePrimaryName("stimulusHelpPanel");
        instructionsLabel.setStylePrimaryName("stimulusHelpText");
        instructionsScrollPanel = new ScrollPanel(instructionsLabel);
        instructionsScrollPanel.getElement().getStyle().setPropertyPx("maxHeight", Window.getClientHeight() - 150);
        final VerticalPanel verticalPanel = new VerticalPanel();
        verticalPanel.add(instructionsScrollPanel);
        final Button closeButton = new Button(closeButtonLabel);
        verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        verticalPanel.add(closeButton);
        popupPanel.setWidget(verticalPanel);
        infoButton.setText(infoButtonChar);
        final SingleShotEventListner infoSingleShotEventListner = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                if (infoButton.isEnabled()) {
//                    outerGrid.clear(); // users found that hiding the picker screen made it hard to understand the instruction text
                    popupPanel.center();
                    infoButton.setEnabled(false);
                    resetSingleShot();
                }
            }
        };
        infoButton.addClickHandler(infoSingleShotEventListner);
        infoButton.addTouchStartHandler(infoSingleShotEventListner);
        infoButton.addTouchMoveHandler(infoSingleShotEventListner);
        infoButton.addTouchEndHandler(infoSingleShotEventListner);
        final SingleShotEventListner instructionsSingleShotEventListner1 = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                popupPanel.hide();
                resizeView();
                infoButton.setEnabled(true);
                resetSingleShot();
            }
        };
        closeButton.addClickHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchStartHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchMoveHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchEndHandler(instructionsSingleShotEventListner1);
        popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() {

            @Override
            public void onClose(CloseEvent<PopupPanel> event) {
                instructionsScrollPanel = null;
//                instructionsSingleShotEventListner1.eventFired();
//                infoButton.setEnabled(true);
//                resizeView();
            }
        });
        popupPanel.center();
    }
 
开发者ID:languageininteraction,项目名称:GraphemeColourSynaesthesiaApp,代码行数:58,代码来源:ColourPickerCanvasView.java

示例3: showWidgetPopup

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void showWidgetPopup(final PresenterEventListner saveEventListner, IsWidget popupContentWidget) {
    final PopupPanel popupPanel = new PopupPanel(false); // the close action to this panel causes background buttons to be clicked
    popupPanel.setGlassEnabled(true);
    popupPanel.setStylePrimaryName("svgPopupPanel");
    final VerticalPanel popupverticalPanel = new VerticalPanel();
    popupverticalPanel.add(popupContentWidget);

    popupverticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    final SingleShotEventListner cancelSingleShotEventListner = new SingleShotEventListner() {

        @Override
        protected void singleShotFired() {
            popupPanel.hide();
        }
    };
    final HorizontalPanel buttonPanel = new HorizontalPanel();
    final Button cancelButton = new Button(messages.popupCancelButtonLabel());
    cancelButton.addClickHandler(cancelSingleShotEventListner);
    cancelButton.addTouchStartHandler(cancelSingleShotEventListner);
    cancelButton.addTouchMoveHandler(cancelSingleShotEventListner);
    cancelButton.addTouchEndHandler(cancelSingleShotEventListner);
    buttonPanel.add(cancelButton);
    if (saveEventListner != null) {
        final SingleShotEventListner okSingleShotEventListner = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                popupPanel.hide();
                saveEventListner.eventFired(null);
            }
        };
        final Button okButton = new Button(saveEventListner.getLabel());
        okButton.addClickHandler(okSingleShotEventListner);
        okButton.addTouchStartHandler(okSingleShotEventListner);
        okButton.addTouchMoveHandler(okSingleShotEventListner);
        okButton.addTouchEndHandler(okSingleShotEventListner);
        buttonPanel.add(okButton);
    }
    popupverticalPanel.add(buttonPanel);
    popupPanel.setWidget(popupverticalPanel);
    popupPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {

        @Override
        public void setPosition(int offsetWidth, int offsetHeight) {
            final int topPosition = Window.getClientHeight() / 2 - offsetHeight;
            // topPosition is used to make sure the dialogue is above the half way point on the screen to avoid the software keyboard covering the box
            // topPosition is also checked to make sure it does not show above the top of the page
            popupPanel.setPopupPosition(Window.getClientWidth() / 2 - offsetWidth / 2, (topPosition < 0) ? 0 : topPosition);
        }
    });
}
 
开发者ID:languageininteraction,项目名称:LanguageMemoryApp,代码行数:52,代码来源:AbstractSvgView.java


注:本文中的com.google.gwt.user.client.ui.PopupPanel.setStylePrimaryName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。