當前位置: 首頁>>代碼示例>>Java>>正文


Java AbsolutePanel.setSize方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.AbsolutePanel.setSize方法的典型用法代碼示例。如果您正苦於以下問題:Java AbsolutePanel.setSize方法的具體用法?Java AbsolutePanel.setSize怎麽用?Java AbsolutePanel.setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.AbsolutePanel的用法示例。


在下文中一共展示了AbsolutePanel.setSize方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: WorkAreaPanel

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
/**
 * Creates a new work area.
 *
 * @param boxRegistry  box registry for creating boxes
 * @param layout  initial layout for work area
 */
public WorkAreaPanel(BoxRegistry boxRegistry, Layout layout) {
  this.boxRegistry = boxRegistry;
  this.layout = layout;

  layouts = new HashMap<String, Layout>();
  layouts.put(layout.getName(), layout);

  boundaryPanel = new AbsolutePanel();
  boundaryPanel.setSize("100%", "100%");
  setWidget(boundaryPanel);
  setSize("100%", "100%");

  widgetDragController = new PickupDragController(boundaryPanel, false);
  widgetDragController.setBehaviorMultipleSelection(false);

  switchLayout(layout.getName());
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:24,代碼來源:WorkAreaPanel.java

示例2: createWidget

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
@Override
public Widget createWidget() {
	panel = new AbsolutePanel();
	panel.add(new Label("Swipe"));
	CheckBox checkBox = new CheckBox("unregister handler");
	checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
		@Override
		public void onValueChange(ValueChangeEvent<Boolean> event) {
			if (event.getValue()) {
				unregisterHandler(EventType.SWIPE);
			} else {
				registerSwipeHandler(swipeHandler);
			}
		}
	});

	panel.add(checkBox);
	panel.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
	panel.setSize("150px", "200px");
	panel.getElement().setId("hammerWidget");
	panel.getElement().getStyle().setBackgroundColor("green");
	panel.getElement().getStyle().setRight(0, Style.Unit.PX);
	panel.getElement().getStyle().setTop(0, Style.Unit.PX);

	return panel;
}
 
開發者ID:geomajas,項目名稱:geomajas-project-hammer-gwt,代碼行數:27,代碼來源:PanelsSample.java

示例3: setWidgets

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
/**
 * Clears the vertical panel and adds the list of widgets. The provided function will be used to
 * get the widget's drag target (such as header text or a gripper image).
 *
 * @param widgets the list of widgets to display on the generated panel.
 * @param getDragTarget function for getting the 'dragable area' of any given widget. (Such as
 *                      a gripping area or header label.
 */
public void setWidgets(List<T> widgets, Function<T, Widget> getDragTarget) {
  AbsolutePanel boundaryPanel = new AbsolutePanel();
  boundaryPanel.setSize("100%", "100%");
  boundaryPanel.clear();

  content.clear();
  content.add(boundaryPanel);

  // The VerticalPanel which actually holds the list of widgets.
  currentVerticalPanel = new VerticalPanel();

  // The VerticalPanelDropController handles DOM manipulation.
  final VerticalPanelDropController widgetDropController =
      new VerticalPanelDropController(currentVerticalPanel);

  boundaryPanel.add(currentVerticalPanel);
  DragHandler dragHandler = createDragHandler(currentVerticalPanel);

  PickupDragController widgetDragController = new PickupDragController(boundaryPanel, false);
  widgetDragController.setBehaviorMultipleSelection(false);
  widgetDragController.addDragHandler(dragHandler);
  widgetDragController.registerDropController(widgetDropController);

  // Add each widget to the VerticalPanel and enable dragging via its DragTarget.
  for (T widget : widgets) {
    currentVerticalPanel.add(widget);
    widgetDragController.makeDraggable(widget, getDragTarget.apply(widget));
  }
}
 
開發者ID:rodion-goritskov,項目名稱:test-analytics-ng,代碼行數:38,代碼來源:SortableVerticalPanel.java

示例4: load

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void load(boolean showIntro) {
	css.ensureInjected();
	resizeRegistration = Window.addResizeHandler(new ResizeHandler(){
		public void onResize(ResizeEvent event) {
			IPhoneIURQ.this.onResize();
		}
	});
	layout = new AbsolutePanel();
	layout.setSize("100%", "100%");
	layout.getElement().getStyle().setBackgroundColor("#474541");
	
	background = new HTML();
	layout.add(background,0,0);
	
	initScrollPanel();
	layout.add(scrollPanel,10,10);
	
	initListeners();
	
	verticalOrientation = !getOrientaton();
	Scheduler.get().scheduleDeferred(new Command() {
		public void execute() {
			onResize();
			background.setHTML(IPhoneDataService.getInstance().getBackground());
			loadPlayer();
		}
	});
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:29,代碼來源:IPhoneIURQ.java

示例5: load

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void load(boolean showIntro) {
	css.ensureInjected();
	resizeRegistration = Window.addResizeHandler(new ResizeHandler(){
		public void onResize(ResizeEvent event) {
			IPhoneViewerOldBookSkin.this.onResize();
		}
	});
	layout = new AbsolutePanel();
	layout.setSize("100%", "100%");
	layout.getElement().getStyle().setBackgroundColor("#474541");
	initialize(showIntro);
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:13,代碼來源:IPhoneViewerOldBookSkin.java

示例6: load

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void load(boolean showIntro) {
	css.ensureInjected();
	resizeRegistration = Window.addResizeHandler(new ResizeHandler(){
		public void onResize(ResizeEvent event) {
			IPhoneViewerBook.this.onResize();
		}
	});
	layout = new AbsolutePanel();
	layout.setSize("100%", "100%");
	layout.getElement().getStyle().setBackgroundColor("#474541");
	initialize(showIntro);
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:13,代碼來源:IPhoneViewerBook.java

示例7: load

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void load(boolean showIntro) {
	css.ensureInjected();
	resizeRegistration = Window.addResizeHandler(new ResizeHandler(){
		public void onResize(ResizeEvent event) {
			IPhoneViewerOldBookSkinCopy.this.onResize();
		}
	});
	layout = new AbsolutePanel();
	layout.setSize("100%", "100%");
	layout.getElement().getStyle().setBackgroundColor("#474541");
	initialize(showIntro);
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:13,代碼來源:IPhoneViewerOldBookSkinCopy.java

示例8: ResearchManager

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public ResearchManager() {
	StaticMessages messages =
		(StaticMessages) GWT.create(StaticMessages.class);
	
	this.viewX = 0;
	this.viewY = 0;
	
	mapContainer = new AbsolutePanel();
	mapContainer.setSize(TECH_TREE_WIDTH + "px", TECH_TREE_HEIGHT + "px");
	mapContainer.getElement().setAttribute("unselectable", "on");
	mapContainer.addStyleName("scrollarea");
	
	rootContainer = new AbsolutePanel();
	rootContainer.setStyleName("technologiesTree");
	rootContainer.getElement().setAttribute("unselectable", "on");
	rootContainer.add(mapContainer);
	
	controller = new ScrollController(this, rootContainer);
	controller.setEnabled(false);
	
	// Recherche totale générée par le joueur
	JSLabel researchPointLabel = new JSLabel("Recherche");
	researchPointLabel.setPixelWidth(100);
	researchPointValue = new JSLabel();
	researchPointValue.setPixelWidth(120);
	researchPointValue.setAlignment(JSLabel.ALIGN_RIGHT);
	
	// Mise en forme des composants
	JSRowLayout layout = new JSRowLayout();
	layout.addComponent(researchPointLabel);
	layout.addComponent(researchPointValue);
	
	researchDialog = new JSDialog("<img src=\"" + Config.getMediaUrl() +
			"images/misc/blank.gif\" class=\"iconResearch\"/> " +
			messages.research(), false, true, true);
	researchDialog.setComponent(layout);
	researchDialog.setLocation(20, 20, false);
	researchDialog.addDialogListener(this);
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:40,代碼來源:ResearchManager.java

示例9: init

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
/**
 * Initialize
 * 
 * @param path  Result root address
 */
protected void init(String path) {
	this.setSize("650px", "400px");
	this.setGlassEnabled(true);
	this.setModal(true);
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");
	closeButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			PreviewPopupPanel.this.hide();
		}
	});
	VerticalPanel verticalPanel = new VerticalPanel();
	verticalPanel.add(closeButton);
	verticalPanel.setCellHeight(closeButton, "13px");
	verticalPanel.setStyleName("vpanel");
	desc.setStyleName("popupTitle");
	verticalPanel.add(desc);
	verticalPanel.setCellHeight(desc, "30px");

	HorizontalPanel hPanel = new HorizontalPanel();
	savebtn.setStyleName("popupsavebtn");
	savebtn.setVisible(false);
	refreshBtn.setStyleName("popuprefreshbtn");
	refreshBtn.setVisible(false);
	uploadSubmitButton.setVisible(false);
	hPanel.add(uploadSubmitButton);
	hPanel.add(savebtn);
	hPanel.add(refreshBtn);
	hPanel.setCellVerticalAlignment(uploadSubmitButton,
			HasVerticalAlignment.ALIGN_BOTTOM);

	tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
	tabPanel.setSize("650px", "355px");
	dirPanel = new HorizontalPanel();
	resultDirTree = PopupRetDirTreeLoad.load(path);
	resultDirTree.getRoot().setState(false);
	ScrollPanel dirScrollPanel = new ScrollPanel();
	dirScrollPanel.add(resultDirTree);
	dirScrollPanel.setAlwaysShowScrollBars(true);
	dirScrollPanel.setSize("300px", "320px");

	VerticalPanel fileViewPanel = new VerticalPanel();
	fileLabel.setText("Please select a file to view!");
	fileLabel.setStyleName("popupFileSelectName");
	fileViewPanel.add(fileLabel);
	fileTextArea.setStyleName("popupMsg");
	fileTextArea.setSize("342px", "298px");
	fileTextArea.getElement().setAttribute("wrap", "off");    
	fileTextArea.setReadOnly(true);
	fileViewPanel.add(fileTextArea);
	dirPanel.add(dirScrollPanel);
	dirPanel.add(fileViewPanel);
	tabPanel.add(dirPanel,"Results directory");

	AbsolutePanel bottomPanel = new AbsolutePanel(); 
	bottomPanel.setSize("650px", "360px");
	bottomPanel.add(tabPanel, 0, 0);
	bottomPanel.add(hPanel,460,3);

	fileSizeLabel.setStyleName("popupFileSelectName");
	verticalPanel.add(bottomPanel); 
	verticalPanel.add(fileSizeLabel);
	this.add(verticalPanel);
	this.setStyleName("loading_container");
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:72,代碼來源:PreviewPopupPanel.java

示例10: GalaxyMap

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
public GalaxyMap() {
	StaticMessages messages =
		(StaticMessages) GWT.create(StaticMessages.class);
	
	this.viewX = 0;
	this.viewY = 0;
	this.showSector = -1;
	this.showGalaxy = false;
	
	mapContainer = new AbsolutePanel();
	mapContainer.setSize(MAP_SIZE + "px", MAP_SIZE + "px");
	mapContainer.getElement().getStyle().setProperty("margin",
			-HALF_MAP_SIZE + "px 0 0 " + -HALF_MAP_SIZE + "px");
	mapContainer.getElement().setAttribute("unselectable", "on");
	mapContainer.addStyleName("galaxyMap");
	
	rootContainer = new RootContainer();
	rootContainer.add(mapContainer);
	
	controller = new ScrollController(this, rootContainer);
	controller.setEnabled(false);
	
	/*influencePanel = new AbsolutePanel();
	influencePanel.getElement().setId("influencePanel");*/
	
	// Champ de recherche de secteurs / quadrants
	JSLabel searchLabel = new JSLabel();
	searchLabel.addStyleName("iconSearch");
	searchLabel.setPixelWidth(31);
	
	searchField = new JSTextField();
	searchField.setPixelWidth(199);
	searchField.addKeyboardListener(this);
	
	showGalaxyBt = new JSButton("Afficher la galaxie");
	showGalaxyBt.setPixelWidth(150);
	showGalaxyBt.addClickListener(this);
	
	// Mise en forme des composants
	JSRowLayout layout = new JSRowLayout();
	layout.addComponent(searchLabel);
	layout.addComponent(searchField);
	layout.addRow();
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	layout.addComponent(showGalaxyBt);
	
	infoDialog = new JSDialog("<img src=\"" + Config.getMediaUrl() +
			"images/misc/blank.gif\" class=\"iconMap\"/> " +
			messages.galaxyMap(), false, true, true);
	infoDialog.setComponent(layout);
	infoDialog.setLocation(20, 20, false);
	infoDialog.addDialogListener(this);
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:54,代碼來源:GalaxyMap.java

示例11: onInitialize

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a new panel
  absolutePanel = new AbsolutePanel();
  absolutePanel.setSize("250px", "250px");
  absolutePanel.ensureDebugId("cwAbsolutePanel");

  // Add a widget that we will animate
  animateeTop = new Image(Showcase.images.gwtLogoThumb());
  animateeBottom = new Image(Showcase.images.gwtLogoThumb());
  animateeLeft = new Image(Showcase.images.gwtLogoThumb());
  animateeRight = new Image(Showcase.images.gwtLogoThumb());
  absolutePanel.add(animateeTop);
  absolutePanel.add(animateeBottom);
  absolutePanel.add(animateeLeft);
  absolutePanel.add(animateeRight);

  // Wrap the absolute panel in a DecoratorPanel
  DecoratorPanel absolutePanelWrapper = new DecoratorPanel();
  absolutePanelWrapper.setWidget(absolutePanel);

  // Create the options bar
  DecoratorPanel optionsWrapper = new DecoratorPanel();
  optionsWrapper.setWidget(createOptionsBar());

  // Add the components to a panel and return it
  HorizontalPanel mainLayout = new HorizontalPanel();
  mainLayout.setSpacing(10);
  mainLayout.add(optionsWrapper);
  mainLayout.add(absolutePanelWrapper);

  // Create the custom animation
  animation = new CustomAnimation();

  // Set the start position of the widgets
  animation.onComplete();

  // Return the layout
  return mainLayout;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:45,代碼來源:CwAnimation.java

示例12: onInitialize

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a new panel
  widgetMap = new LinkedHashMap<String, Widget>();
  absolutePanel = new AbsolutePanel();
  absolutePanel.setSize("250px", "250px");
  absolutePanel.ensureDebugId("cwAbsolutePanel");

  // Add an HTML widget to the panel
  String[] widgetNames = constants.cwAbsolutePanelWidgetNames();
  HTML text = new HTML(constants.cwAbsolutePanelHelloWorld());
  absolutePanel.add(text, 10, 20);
  widgetMap.put(widgetNames[0], text);

  // Add a Button to the panel
  Button button = new Button(constants.cwAbsolutePanelClickMe());
  absolutePanel.add(button, 80, 45);
  widgetMap.put(widgetNames[1], button);

  // Add a Button to the panel
  Grid grid = new Grid(2, 3);
  grid.setBorderWidth(1);
  for (int i = 0; i < 3; i++) {
    grid.setHTML(0, i, i + "");
    grid.setWidget(1, i, new Image(Showcase.images.gwtLogoThumb()));
  }
  absolutePanel.add(grid, 60, 100);
  widgetMap.put(widgetNames[2], grid);

  // Wrap the absolute panel in a DecoratorPanel
  DecoratorPanel absolutePanelWrapper = new DecoratorPanel();
  absolutePanelWrapper.setWidget(absolutePanel);

  // Create the options bar
  DecoratorPanel optionsWrapper = new DecoratorPanel();
  optionsWrapper.setWidget(createOptionsBar());

  // Add the components to a panel and return it
  HorizontalPanel mainLayout = new HorizontalPanel();
  mainLayout.setSpacing(10);
  mainLayout.add(optionsWrapper);
  mainLayout.add(absolutePanelWrapper);

  return mainLayout;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:50,代碼來源:CwAbsolutePanel.java

示例13: init

import com.google.gwt.user.client.ui.AbsolutePanel; //導入方法依賴的package包/類
private void init()
{
	if( m_initialized )  return;
	
	m_focusPanel = new FocusPanel();
	m_innerContainer = new AbsolutePanel();
	m_dialog = new Dialog(m_clickMngr, 512, 256, new Dialog.I_Delegate()
	{
		@Override
		public void onOkPressed()
		{
			//--- DRK > TODO: Hopefully in future I'll have a better overridable action set up,
			//---				so that I only have to call State_GenericDialog.Ok, and the system knows
			//---				to call State_AsyncDialog.Ok because it is State_AsyncDialog that is foregrounded.
			//---				Until then, I present the following somewhat sloppy workaround.
			if( m_stateContext.perform(State_GenericDialog.Ok.class) )
			{
			}
			else if( m_stateContext.perform(State_AsyncDialog.Ok.class) )
			{
				
			}
		}
	});
	m_dialogGlass = new FlowPanel();
	m_dialogContainer = new HorizontalPanel();
	
	
	
	m_focusPanel.getElement().getStyle().setPosition(Position.ABSOLUTE);
	m_focusPanel.getElement().getStyle().setTop(0, Unit.PX);
	m_focusPanel.getElement().getStyle().setLeft(0, Unit.PX);
	
	m_focusPanel.setSize("100%", "100%");
	m_innerContainer.setSize("100%", "100%");
	m_dialogGlass.addStyleName("sm_dialog_glass");
	m_dialogContainer.addStyleName("sm_dialog_container");
	
	E_ZIndex.DIALOG_GLASS.assignTo(m_dialogGlass);
	E_ZIndex.DIALOG.assignTo(m_dialogContainer);
	
	m_focusPanel.add(m_innerContainer);
	
	m_innerContainer.add(m_dialogGlass);
	m_innerContainer.add(m_dialogContainer);

	m_focusPanel.addKeyUpHandler(new KeyUpHandler()
	{
		@Override
		public void onKeyUp(KeyUpEvent event)
		{
			m_dialog.onKeyPressed(event.getNativeKeyCode());
			event.preventDefault();
		}
	});
}
 
開發者ID:dougkoellmer,項目名稱:swarm,代碼行數:57,代碼來源:DialogManager.java


注:本文中的com.google.gwt.user.client.ui.AbsolutePanel.setSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。