Java 类com.google.gwt.user.client.ui.DecoratorPanel 实例源码

项目:firefly    文件:MiniPlotWidget.java   
public Panel makeFixedSizeContainer(int width, int height, boolean decorated) {

        SimplePanel panel= new SimplePanel();
        panel.setWidget(this);
        panel.setPixelSize(width,height);

        Panel retval= panel;

        if (decorated) {
            DecoratorPanel dp= new DecoratorPanel();
            dp.setWidget(panel);
            retval= dp;
        }
        return retval;

    }
项目:firefly    文件:MiniPlotWidget.java   
public Panel makeFailureMessage(String message, int width, int height, boolean decorated) {
    VerticalPanel panel= new VerticalPanel();
    HTML header = new HTML(getTitle());
    Widget msg = GwtUtil.centerAlign(new HTML(message));
    header.addStyleName("preview-title");
    GwtUtil.setStyle(msg, "padding", "5px");
    panel.add(header);
    panel.add(msg);
    panel.setPixelSize(width, height);

    Panel retval= panel;

    if (decorated) {
        DecoratorPanel dp= new DecoratorPanel();
        dp.setWidget(panel);
        retval= dp;
    }
    return retval;
}
项目:QMAClone    文件:PanelThreadList.java   
public void onSuccess(List<PacketBbsThread> result) {
    for (final PacketBbsThread thread : result) {
        final LazyPanel lazyPanel = new LazyPanel() {
            @Override
            protected Widget createWidget() {
                DecoratorPanel decoratorPanel = new DecoratorPanel();
                decoratorPanel.setWidget(new PanelThread((int) thread.id, thread.title));
                return decoratorPanel;
            }
        };

        OpenHandler<DisclosurePanel> openHandler = new OpenHandler<DisclosurePanel>() {
            @Override
            public void onOpen(OpenEvent<DisclosurePanel> event) {
                lazyPanel.ensureWidget();
            }
        };

        DisclosurePanel disclosurePanel = new DisclosurePanel(thread.title);
        disclosurePanel.setContent(lazyPanel);
        disclosurePanel.addOpenHandler(openHandler);
        add(disclosurePanel);
    }
}
项目:geomajas-project-client-gwt2    文件:WfsCapabilitiesPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    MapConfiguration mapConfiguration = TileBasedLayerClient.getInstance().createOsmMap(25);
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter(mapConfiguration, 480, 480);
    mapPresenter.getEventBus().addHandler(ShowFeatureHandler.TYPE, new ShowFeatureHandler() {

        @Override
        public void onShowFeature(ShowFeatureEvent event) {
            showFeature(event.getFeature());
        }
    });
    osmLayer = TileBasedLayerClient.getInstance().createOsmLayer("osm", 25,
            "http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png");
    mapPresenter.getLayersModel().addLayer(osmLayer);
    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    return layout;
}
项目:geomajas-project-client-gwt2    文件:FeatureInfoPanel.java   
public FeatureInfoPanel() {
    rootPanel = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Add the map to the GUI, using a decorator for nice borders:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Add a feature info control to the map (displays feature info in a dialogbox):
    leftPanel.add(new FeatureInfoControlWidget(mapPresenter).asWidget());

    // Also show feature information in the side panel:
    mapPresenter.getEventBus().addHandler(FeatureClickedHandler.TYPE, this);

    // Initialize the map
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapCountries");
}
项目:geomajas-project-client-gwt2    文件:LegendAddRemoveSample.java   
public Widget asWidget() {
    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapCompositionHandler(new MyMapCompositionHandler());
    legendPanel.add(new MapControlPanel(mapPresenter));

    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegend");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:TmsLayerPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    MapConfiguration configuration = new MapConfigurationImpl();
    configuration.setCrs(EPSG, CrsType.DEGREES);
    configuration.setMaxBounds(new Bbox(-180, -90, 360, 180));
    List<Double> resolutions = new ArrayList<Double>();
    resolutions.add(0.703125);
    resolutions.add(0.3515625);
    resolutions.add(0.17578125);
    resolutions.add(0.087890625);
    resolutions.add(0.0439453125);
    configuration.setResolutions(resolutions);
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter(configuration, 480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    initialize();

    return layout;
}
项目:geomajas-project-client-gwt2    文件:CapabilitiesPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapEmpty");

    capaUrl.setInnerHTML(getCapaUrl());

    return layout;
}
项目:geomajas-project-client-gwt2    文件:ProfilesPanel.java   
@UiHandler("profileBox")
protected void onProfile(ChangeEvent event) {
    String name = profileBox.getValue(profileBox.getSelectedIndex());
    if (name != null) {
        Profile profile = Profile.valueOf(name);            
        MapConfiguration configuration = null;
        if (Profile.GLOBAL_GEODETIC.equals(profile)) {
            configuration = TmsClient.getInstance().createGeodeticMap();
        } else {
            configuration = TmsClient.getInstance().createMercatorMap();
        }
        mapPanel.clear();
        mapPresenter = GeomajasImpl.getInstance().createMapPresenter(configuration, 480, 480);
        DecoratorPanel mapDecorator = new DecoratorPanel();
        mapDecorator.add(mapPresenter.asWidget());
        mapPanel.add(mapDecorator);
        getCapabilities();
    }
}
项目:geomajas-project-client-gwt2    文件:ClientSideOsmLayerPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter
    MapConfiguration configuration = TileBasedLayerClient.getInstance().createOsmMap(19);

    mapPresenter = GeomajasImpl.getInstance().createMapPresenter(configuration, 480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the OSM layer:
    initializeLayer();

    return layout;
}
项目:geomajas-project-client-gwt2    文件:WmsLayerPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    MapConfiguration configuration = new MapConfigurationImpl();
    configuration.setCrs(EPSG, CrsType.DEGREES);
    configuration.setMaxBounds(new Bbox(-180, -90, 360, 180));
    configuration.setMinimumResolution(2.1457672119140625E-5);
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter(configuration, 480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    initialize();

    return layout;
}
项目:geomajas-project-client-gwt2    文件:ViewPortEventPanel.java   
public Widget asWidget() {
    // Create the layout for this sample:
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addViewPortChangedHandler(new MyViewPortChangedHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:ResizeMapPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:CanvasRenderingPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    label.setVisible(false);
    for (int option : options) {
        countBox.addItem(option + "");
    }
    countBox.setSelectedIndex(2);
    return layout;
}
项目:geomajas-project-client-gwt2    文件:ScreenSpaceRenderingPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:HtmlMarkerPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:WorldSpaceRenderingPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:FixedSizeWorldSpaceRenderingPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:ListenerPanel.java   
public ListenerPanel() {
    layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLayerVisibility");

    // Add a passive listener that print out mouse coordinates:
    mapPresenter.addMapListener(new MapMouseMoveListener());

    // Add the map to the GUI:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);
}
项目:geomajas-project-client-gwt2    文件:LayerOpacityPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");

    // Make sure the text box also reacts to the "Enter" key:
    opacityBox.addKeyUpHandler(new KeyUpHandler() {

        public void onKeyUp(KeyUpEvent event) {
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                changeOpacity();
            }
        }
    });
    return layout;
}
项目:geomajas-project-client-gwt2    文件:LayerAddRemovePanel.java   
public Widget asWidget() {
    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapCompositionHandler(new MyMapCompositionHandler());

    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegend");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:LayerRefreshPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());
    mapPresenter.getEventBus().addLayerRefreshedHandler(new MyLayerRefreshedHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapCountries");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:LayerOrderPanel.java   
public Widget asWidget() {
    RESOURCE.css().ensureInjected();

    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    layerDragController = new PickupDragController(dndBoundary, false);
    layerDragController.setBehaviorMultipleSelection(false);
    layerDragController.registerDropController(new VerticalPanelDropController(layerPanel));
    layerDragController.addDragHandler(new LayerDragHandler());

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapCompositionHandler(new MyLayerAddHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegend");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:LayerVisibilityPanel.java   
public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());
    mapPresenter.getEventBus().addLayerVisibilityHandler(new MyLayerVisibilityHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLayerVisibility");
    return layout;
}
项目:Peergos    文件:CwDecoratorPanel.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a table to layout the form options
  FlexTable layout = new FlexTable();
  layout.setCellSpacing(6);
  FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

  // Add a title to the form
  layout.setHTML(0, 0, constants.cwDecoratorPanelFormTitle());
  cellFormatter.setColSpan(0, 0, 2);
  cellFormatter.setHorizontalAlignment(
      0, 0, HasHorizontalAlignment.ALIGN_CENTER);

  // Add some standard form options
  layout.setHTML(1, 0, constants.cwDecoratorPanelFormName());
  layout.setWidget(1, 1, new TextBox());
  layout.setHTML(2, 0, constants.cwDecoratorPanelFormDescription());
  layout.setWidget(2, 1, new TextBox());

  // Wrap the content in a DecoratorPanel
  DecoratorPanel decPanel = new DecoratorPanel();
  decPanel.setWidget(layout);
  return decPanel;
}
项目:swarm    文件:CwDecoratorPanel.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a table to layout the form options
  FlexTable layout = new FlexTable();
  layout.setCellSpacing(6);
  FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

  // Add a title to the form
  layout.setHTML(0, 0, constants.cwDecoratorPanelFormTitle());
  cellFormatter.setColSpan(0, 0, 2);
  cellFormatter.setHorizontalAlignment(
      0, 0, HasHorizontalAlignment.ALIGN_CENTER);

  // Add some standard form options
  layout.setHTML(1, 0, constants.cwDecoratorPanelFormName());
  layout.setWidget(1, 1, new TextBox());
  layout.setHTML(2, 0, constants.cwDecoratorPanelFormDescription());
  layout.setWidget(2, 1, new TextBox());

  // Wrap the content in a DecoratorPanel
  DecoratorPanel decPanel = new DecoratorPanel();
  decPanel.setWidget(layout);
  return decPanel;
}
项目:gwtmockito    文件:GwtMockitoWidgetBaseClassesTest.java   
@Test
public void testPanels() throws Exception {
  invokeAllAccessibleMethods(new AbsolutePanel() {});
  invokeAllAccessibleMethods(new CellPanel() {});
  invokeAllAccessibleMethods(new ComplexPanel() {});
  invokeAllAccessibleMethods(new DeckLayoutPanel() {});
  invokeAllAccessibleMethods(new DeckPanel() {});
  invokeAllAccessibleMethods(new DecoratorPanel() {});
  invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
  invokeAllAccessibleMethods(new DockPanel() {});
  invokeAllAccessibleMethods(new FlowPanel() {});
  invokeAllAccessibleMethods(new FocusPanel() {});
  invokeAllAccessibleMethods(new HorizontalPanel() {});
  invokeAllAccessibleMethods(new HTMLPanel("") {});
  invokeAllAccessibleMethods(new LayoutPanel() {});
  invokeAllAccessibleMethods(new PopupPanel() {});
  invokeAllAccessibleMethods(new RenderablePanel("") {});
  invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
  invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
  invokeAllAccessibleMethods(new SimplePanel() {});
  invokeAllAccessibleMethods(new SplitLayoutPanel() {});
  invokeAllAccessibleMethods(new StackPanel() {});
  invokeAllAccessibleMethods(new VerticalPanel() {});
}
项目:x-cure-chat    文件:SiteLoadingGlassPanel.java   
/**
 * The basic constructor
 */
public SiteLoadingGlassPanel( final FocusPanel theMainFocusPanel ) {
    //Store the main focus panel reference
    this.theMainFocusPanel = theMainFocusPanel;

    //Get the title manager
    final UITitlesI18N titlesI18N = I18NManager.getTitles();

    //Set up the component's content
    final DecoratorPanel decoratedPanel = new DecoratorPanel();
    decoratedPanel.setStyleName( CommonResourcesContainer.INTERNAL_ROUNDED_CORNER_PANEL_STYLE );
    //Add the content to the decorated panel
    final HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
    horizontalPanel.setStyleName( CommonResourcesContainer.INTERNAL_ROUNDED_CORNER_PANEL_CONTENT_STYLE );
    //Add the loading image
    horizontalPanel.add( new Image( ServerSideAccessManager.getActivityImageURL( ) ) );
    //Add the spacing
    horizontalPanel.add( new HTML("&nbsp;") );
    //Add the communicating label
    final Label loadingLabel = new Label( titlesI18N.communicatingText() );
    loadingLabel.setStyleName( CommonResourcesContainer.LOADING_LABEL_STYLE );
    horizontalPanel.add( loadingLabel );
    //Store the content in the decorated panel
    decoratedPanel.add( horizontalPanel );
    //Put the stuff into the glass panel, make sure it is centered
    loadingGlassPanel.insertRow( 0 );
    loadingGlassPanel.insertCell( 0, 0 );
    loadingGlassPanel.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE );
    loadingGlassPanel.setWidget( 0, 0, decoratedPanel );
    loadingGlassPanel.setVisible( false );
    loadingGlassPanel.setTitle( titlesI18N.communicatingToolTipText() );
    loadingGlassPanel.setStyleName( CommonResourcesContainer.SITE_LOADING_COMPONENT_GLASS_PANEL_STYLE );

    //Initialize the widget
    initWidget( loadingGlassPanel );
}
项目:gef-gwt    文件:Control.java   
protected void closeMenu(MenuBar gwtMenuBar) {
    com.google.gwt.user.client.ui.Widget widget = gwtMenuBar.getParent();
    if (widget instanceof PopupPanel) {
        ((PopupPanel) widget).hide();
    } else if (widget instanceof DecoratorPanel) {
        ((PopupPanel) widget.getParent()).hide();
    } else {
        closeMenu((MenuBar) widget);
    }
}
项目:hexa.tools    文件:UploadTest.java   
@Override
public void onModuleLoad()
{
    final DecoratorPanel deco = new DecoratorPanel();
    Label text = new Label( "Drop files here..." );
    deco.setWidget( text );

    DropTarget target = DropTarget.create( deco, new DropTarget.Callback()
    {
        @Override
        public void onDropFiles( FilesList files )
        {
            deco.getElement().getStyle().clearBackgroundColor();
            sendFiles( files );
        }

        @Override
        public void onDragLeave()
        {
            deco.getElement().getStyle().clearBackgroundColor();
        }

        @Override
        public void onDragEnter()
        {
            deco.getElement().getStyle().setBackgroundColor( "grey" );
        }
    } );

    if( target != null )
    {
        RootPanel.get().add( target );
    }
    else
    {
        RootPanel.get().add( new Label( "Sorry, no drop enabled..." ) );
    }
    RootPanel.get().add( table );
}
项目:QMAClone    文件:WidgetProblemSentenceRensou.java   
public WidgetProblemSentenceRensou(PacketProblem problem) {
    sentence = problem.getPanelSentence().replaceAll("%c\n", "%c").trim();
    sentenceLength = sentence.length();

    clearSentence();

    // 初めから全て表示する場合
    if (sentence.startsWith("!")) {
        String[] sentences = sentence.replaceAll(" ", "").substring(1).split("\n");
        for (StringBuilder sb : lines) {
            sb.delete(0, sb.length());
        }
        int n = Math.min(sentences.length, NUMBER_OF_LINES);
        for (int i = 0; i < n; ++i) {
            lines[i].append(sentences[i]);
        }
        index = sentenceLength;
    }

    htmlSentence.addStyleDependentName("problemStatement");
    htmlSentence.addStyleDependentName("problemStatementCenter");
    htmlSentence.setSize("600px", "200px");

    DecoratorPanel decoratorPanel = new DecoratorPanel();
    decoratorPanel.setWidget(htmlSentence);
    add(decoratorPanel);
}
项目:QMAClone    文件:WidgetProblemSentenceNormal.java   
public WidgetProblemSentenceNormal(PacketProblem problem) {
    sentence = problem.getPanelSentence().replaceAll("%c\n", "%c");
    sentenceLength = sentence.length();

    html = new StringBuilder(sentenceLength * 2);

    final HorizontalPanel panel = new HorizontalPanel();
    panel.add(htmlSentence);

    // 画像または動画を使用する場合は問題文の長さを調整する
    htmlSentence.getElement().setAttribute("oncopy", "return false;");
    htmlSentence.getElement().setAttribute("oncut", "return false;");
    htmlSentence.addStyleDependentName("problemStatement");
    if (problem.imageUrl != null) {
        htmlSentence.setPixelSize(360, 200);
        panel.add(new WidgetBackgroundImage(problem, 240, 180));
    } else if (problem.movieUrl != null) {
        htmlSentence.setPixelSize(360, 200);
        panel.add(new WidgetBackgroundYouTube(problem.movieUrl, 240, 200));
    } else {
        htmlSentence.setPixelSize(600, 200);
    }

    final DecoratorPanel decoratorPanel = new DecoratorPanel();
    decoratorPanel.setWidget(panel);
    add(decoratorPanel);
}
项目:QMAClone    文件:PanelBbs.java   
public void onSuccess(List<PacketBbsThread> result) {
    displayPanel.clear();

    for (PacketBbsThread thread : result) {
        DecoratorPanel decoratorPanel = new DecoratorPanel();
        decoratorPanel.setWidget(new PanelThread((int) thread.id, thread.title));
        displayPanel.add(decoratorPanel);
    }
}
项目:geomajas-project-client-gwt2    文件:MapLegendLayerResolutionRangeSample.java   
public Widget asWidget() {
    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Add a MapLegendDropDown to the panel on the left:
    legendPanel.add(new MapLegendDropDown(mapPresenter));

    // Add a MapLegendDropDown to the MapPresenter:
    MapLegendDropDown mapDropDown = new MapLegendDropDown(mapPresenter);
    mapPresenter.getWidgetPane().add(mapDropDown);

    // Align the MapLegendDropDown on the map to the top-right:
    mapDropDown.getElement().getStyle().setTop(5, Unit.PX);
    mapDropDown.getElement().getStyle().setRight(5, Unit.PX);

    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegendLayerResolutionRange");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:LegendOrderSample.java   
public Widget asWidget() {
    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    layerDragController = new PickupDragController(dndBoundary, false);
    layerDragController.setBehaviorMultipleSelection(false);
    layerDragController.registerDropController(new VerticalPanelDropController(layerPanel));
    layerDragController.addDragHandler(new LayerDragHandler());

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Add the MapLegendPanel to the layout:
    MapControlPanel mapControlPanel = new MapControlPanel(mapPresenter);
    //mapControlPanel.setDisableToggleOutOfRange(false);

    legendPanel.add(mapControlPanel);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegend");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:MapLegendDropDownSample.java   
public Widget asWidget() {
    // Define the left layout:
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Add a MapLegendDropDown to the panel on the left:
    legendPanel.add(new MapLegendDropDown(mapPresenter));

    // Add a MapLegendDropDown to the MapPresenter:
    MapLegendDropDown mapDropDown = new MapLegendDropDown(mapPresenter);
    mapPresenter.getWidgetPane().add(mapDropDown);

    // Align the MapLegendDropDown on the map to the top-right:
    mapDropDown.getElement().getStyle().setTop(5, Unit.PX);
    mapDropDown.getElement().getStyle().setRight(5, Unit.PX);

    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapLegend");
    return layout;
}
项目:geomajas-project-client-gwt2    文件:WmsLayerLegendPanel.java   
public Widget asWidget() {
    WmsClient.getInstance().getWmsService().setWmsUrlTransformer(new WmsUrlTransformer() {

        @Override
        public String transform(WmsRequest request, String url) {
            switch (request) {
                case GETCAPABILITIES:
                case GETFEATUREINFO:
                    return "d/proxy?url=" + url;
                default:
                    return url;
            }
        }
    });
    Widget layout = UI_BINDER.createAndBindUi(this);
    scaleBox.getElement().setPropertyString("placeholder", "Enter image scale factor:");
    // Create the mapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapEmpty");

    getCapabilities();

    return layout;
}
项目:geomajas-project-client-gwt2    文件:SelectStylePanel.java   
public Widget asWidget() {
    WmsClient.getInstance().getWmsService().setWmsUrlTransformer(new WmsUrlTransformer() {

        @Override
        public String transform(WmsRequest request, String url) {
            switch (request) {
                case GETCAPABILITIES:
                case GETFEATUREINFO:
                    return "d/proxy?url=" + url;
                default:
                    return url;
            }
        }
    });
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapEmpty");

    getCapabilities();

    return layout;
}
项目:geomajas-project-client-gwt2    文件:CapabilitiesPanel.java   
public Widget asWidget() {
    WmsClient.getInstance().getWmsService().setWmsUrlTransformer(new WmsUrlTransformer() {

        @Override
        public String transform(WmsRequest request, String url) {
            switch (request) {
                case GETCAPABILITIES:
                case GETFEATUREINFO:
                    return "d/proxy?url=" + url;
                default:
                    return url;
            }
        }
    });
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the mapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapEmpty");

    return layout;
}
项目:geomajas-project-client-gwt2    文件:DrawingInteractionPanel.java   
public Widget asWidget() {
    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    return mapDecorator;
}