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


Java HTMLPanel.setWidth方法代碼示例

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


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

示例1: create

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public HTMLPanel create()
{
	FormCreatorBundle.CSS.ensureInjected();

	HTMLPanel panel = new HTMLPanel( sb.toString() );
	panel.setStyleName( FormCreatorBundle.CSS.form() );
	panel.setWidth( totalWidth + "px" );

	for( Entry<String, Widget> e : wMap.entrySet() )
	{
		e.getValue().setWidth( "100%" );
		panel.add( e.getValue(), e.getKey() );
	}

	return panel;
}
 
開發者ID:ltearno,項目名稱:hexa.tools,代碼行數:17,代碼來源:FormCreator.java

示例2: ApplicantDialog

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public ApplicantDialog() {
	super("Candidature", true, true, true);
	
	descriptionPanel = new HTMLPanel("");
	descriptionPanel.setWidth("290px");
	descriptionPanel.getElement().getStyle().setProperty("padding", "20px 5px");
	
	cancelApplyBt = new JSButton("Retirer ma candidature");
	cancelApplyBt.setPixelWidth(200);
	cancelApplyBt.addClickListener(this);
	
	JSRowLayout layout = new JSRowLayout();
	layout.addComponent(descriptionPanel);
	layout.addRow();
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	layout.addComponent(cancelApplyBt);
	
	setComponent(layout);
	centerOnScreen();
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:21,代碼來源:ApplicantDialog.java

示例3: NoAllyDialog

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public NoAllyDialog() {
	super("Alliance", false, true, true);
	
	HTMLPanel descriptionPanel = new HTMLPanel(
		"<div class=\"center\">" +
		"Vous n'avez pas d'alliance.<br/><br/>" +
		"Vous pouvez fonder une nouvelle " +
		"alliance ou postuler à une alliance existante.</div>");
	descriptionPanel.setWidth("260px");
	descriptionPanel.getElement().getStyle().setProperty("padding", "20px");
	
	// Boutons pour créer / postuler à une alliance
	createAllyBt = new JSButton("Fonder une alliance");
	createAllyBt.setPixelWidth(150);
	createAllyBt.addClickListener(this);
	
	applyBt = new JSButton("Postuler");
	applyBt.setPixelWidth(150);
	applyBt.addClickListener(this);
	
	// Mise en forme des composants
	JSRowLayout layout = new JSRowLayout();
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	layout.addComponent(descriptionPanel);
	layout.addRow();
	layout.addComponent(createAllyBt);
	layout.addComponent(applyBt);
	
	setComponent(layout);
	centerOnScreen();
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:32,代碼來源:NoAllyDialog.java

示例4: LatestExecutionWindow

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public LatestExecutionWindow(List<ValueSet> valueSetList) {
	super();
	setTitle("Last Execution: Value Set Details");
	setWidth(800);
	setHeight(525);
	setModalMaskOpacity(90);
	setAlign(Alignment.CENTER);

	setCanDragReposition(true);
	setCanDragResize(true);
	setAnimateMinimize(true);

	HTMLPanel header = new HTMLPanel("<b>The latest execution was ran with these value sets.</b>");
	header.setWidth("100%");
	HLayout headerLayout = new HLayout();
	headerLayout.setWidth100();
	headerLayout.setHeight(25);
	headerLayout.setLayoutAlign(Alignment.CENTER);
	headerLayout.setAlign(VerticalAlignment.CENTER);
	headerLayout.addMember(header);

	ExecValueSetGrid grid = new ExecValueSetGrid(valueSetList);

	Button cancelButton = new Button("Close");
	cancelButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent clickEvent) {
			destroy();
		}
	});

	HLayout buttonLayout = new HLayout(5);
	buttonLayout.setHeight(25);
	buttonLayout.setMargin(10);
	buttonLayout.setAlign(Alignment.CENTER);
	buttonLayout.addMember(cancelButton);

	addItem(headerLayout);
	addItem(grid);
	addItem(buttonLayout);
}
 
開發者ID:SHARP-HTP,項目名稱:phenotype-portal,代碼行數:42,代碼來源:LatestExecutionWindow.java

示例5: ExecuteWindow

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public ExecuteWindow(final AlgorithmData algorithmData, final Date fromDate, final Date toDate) {
	super();
	setTitle("Value Set Version Selection For Execution");
	setWidth(800);
	setHeight("95%");
	setModalMaskOpacity(90);
	setAlign(Alignment.CENTER);

	setCanDragReposition(true);
	setCanDragResize(true);
	setAnimateMinimize(true);

	HTMLPanel header = new HTMLPanel("<a style='text-align:center;'><b>Select the version of each value set for execution.</b></a>");
	header.setWidth("100%");
	HLayout headerLayout = new HLayout();
	headerLayout.setWidth100();
	headerLayout.setHeight(25);
	headerLayout.setLayoutAlign(Alignment.CENTER);
	headerLayout.setAlign(VerticalAlignment.CENTER);
	headerLayout.addMember(header);

	HTMLPanel dataCriteria = new HTMLPanel("<b>Data Criteria (QDM Data Elements)</b>");
	dataCriteria.setWidth("100%");
	HLayout dataCriteriaLayout = new HLayout();
	dataCriteriaLayout.setWidth100();
	dataCriteriaLayout.setHeight(25);
	dataCriteriaLayout.setLayoutAlign(Alignment.LEFT);
	dataCriteriaLayout.setAlign(VerticalAlignment.CENTER);
	dataCriteriaLayout.setLayoutTopMargin(20);
	dataCriteriaLayout.addMember(dataCriteria);
	DataCriteriaListGrid dataCriteriaListGrid = new DataCriteriaListGrid();
	dataCriteriaListGrid.setGridData(algorithmData);

	HTMLPanel suppDataCriteria = new HTMLPanel("<b>Supplemental Data Elements</b>");
	suppDataCriteria.setWidth("100%");
	HLayout suppDataCriteriaLayout = new HLayout();
	suppDataCriteriaLayout.setWidth100();
	suppDataCriteriaLayout.setHeight(25);
	suppDataCriteriaLayout.setLayoutAlign(Alignment.LEFT);
	suppDataCriteriaLayout.setAlign(VerticalAlignment.CENTER);
	suppDataCriteriaLayout.setLayoutTopMargin(20);
	suppDataCriteriaLayout.addMember(suppDataCriteria);
	SupplementalDataListGrid supplementalDataListGrid = new SupplementalDataListGrid();
	supplementalDataListGrid.setGridData(algorithmData);

	Button cancelButton = new Button("Cancel");
	cancelButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent clickEvent) {
			destroy();
		}
	});

	Button executeButton = new Button("Execute");
	executeButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			executePhenotype(algorithmData, fromDate, toDate);
		}
	});

	HLayout buttonLayout = new HLayout(5);
	buttonLayout.setHeight(25);
	buttonLayout.setMargin(10);
	buttonLayout.setLayoutTopMargin(20);
	buttonLayout.setAlign(Alignment.CENTER);
	buttonLayout.addMember(executeButton);
	buttonLayout.addMember(cancelButton);

	addItem(headerLayout);
	addItem(dataCriteriaLayout);
	addItem(dataCriteriaListGrid);
	addItem(suppDataCriteriaLayout);
	addItem(supplementalDataListGrid);
	addItem(buttonLayout);
}
 
開發者ID:SHARP-HTP,項目名稱:phenotype-portal,代碼行數:77,代碼來源:ExecuteWindow.java

示例6: BuildWardDialog

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public BuildWardDialog(String type, PlayerFleetData fleetData) {
	super(type.startsWith(WardData.TYPE_STUN) ||
		type.startsWith(WardData.TYPE_MINE) ?
		((DynamicMessages) GWT.create(DynamicMessages.class)).skill8() :
		((DynamicMessages) GWT.create(DynamicMessages.class)).skill7(),
		true, true, true);
	
	this.type = type;
	this.fleetData = fleetData;
	
	StaticMessages messages = GWT.create(StaticMessages.class);
	String description = "";
	
	boolean charge = type.startsWith(WardData.TYPE_STUN) ||
		type.startsWith(WardData.TYPE_MINE);
	
	if (type.startsWith(WardData.TYPE_OBSERVER))
		description = "Indiquez la durée de vie de la balise d'observation :";
	else if (type.startsWith(WardData.TYPE_SENTRY))
		description = "Indiquez la durée de vie de la balise de détection :";
	else if (type.startsWith(WardData.TYPE_STUN))
		description = "Indiquez la puissance de la charge électromagnétique (seuil de puissance à partir duquel la charge se déclenche quand une flotte approche de la charge) :";
	else if (type.startsWith(WardData.TYPE_MINE))
		description = "Indiquez la puissance de la charge explosive (seuil de puissance à partir duquel la charge se déclenche quand une flotte approche de la charge) :";
	
	HTMLPanel descriptionPanel = new HTMLPanel(
		"<div class=\"justify\" style=\"padding: 5px;\">" + description + "</div>");
	descriptionPanel.setWidth("250px");
	OpenJWT.setElementFloat(descriptionPanel.getElement(), "left");
	
	// Puissance de la balise / mine
	powerUnitLabel = new JSLabel((charge ? "<img src=\"" +
		Config.getMediaUrl() + "images/misc/blank.gif\" " +
		"class=\"stat s-power\"/>" : "&nbsp;jours") + "&nbsp;");
	
	powerField = new JSTextField("1");
	powerField.setPixelWidth(50);
	powerField.addKeyboardListener(this);
	
	powerLabel = new JSLabel("&nbsp;" + (charge ? "Puissance (max " + fleetData.getPowerLevel() + ")" : "Durée de vie"));
	powerLabel.setPixelWidth(250 - powerUnitLabel.getPixelWidth() - powerField.getPixelWidth());
	
	JSLabel costLabel = new JSLabel("&nbsp;Coût");
	costLabel.setPixelWidth(100);
	
	costValueLabel = new JSLabel();
	costValueLabel.setPixelWidth(150);
	costValueLabel.setAlignment(JSLabel.ALIGN_RIGHT);
	
	// Boutons OK / Annuler
	okBt = new JSButton(messages.ok());
	okBt.setPixelWidth(100);
	okBt.addClickListener(this);
	
	cancelBt = new JSButton(messages.cancel());
	cancelBt.setPixelWidth(100);
	cancelBt.addClickListener(this);
	
	updateCost();
	
	layout = new JSRowLayout();
	layout.addComponent(descriptionPanel);
	layout.addRowSeparator(5);
	layout.addComponent(powerLabel);
	layout.addComponent(powerField);
	layout.addComponent(powerUnitLabel);
	layout.addRow();
	layout.addComponent(costLabel);
	layout.addComponent(costValueLabel);
	layout.addRowSeparator(10);
	layout.addComponent(okBt);
	layout.addComponent(cancelBt);
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	
	setComponent(layout);
	centerOnScreen();
	setDefaultCloseOperation(DESTROY_ON_CLOSE);
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:79,代碼來源:BuildWardDialog.java

示例7: ProbeReportDialog

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public ProbeReportDialog(ProbeReportData data) {
	super("Sonde de " + data.getSystemName(), true, true, true);
	
	StaticMessages messages = GWT.create(StaticMessages.class);
	DynamicMessages dynamicMessages = GWT.create(DynamicMessages.class);
	
	String report = "<table style=\"width: 100%;\" cellspacing=\"0\">" +
		"<tr class=\"odd\">" +
		"<td style=\"padding: 4px;\">Espace disponible</td>" +
		"<td style=\"padding: 4px; text-align: right\">" + data.getAvailableSpace() + "&nbsp;<img src=\"" + Config.getMediaUrl() +
			"images/misc/blank.gif\" class=\"resource credits\"/>&nbsp;</td>" +
		"</tr>";
	
	for (int i = 0; i < data.getResourcesCount(); i++) {
		report += "<tr class=\"" + (i % 2 == 1 ? "odd" : "even") + "\" style=\"padding: 4px;\">" +
			"<td style=\"padding: 4px;\">" + dynamicMessages.getString("resource" + i) + "</td>" +
			"<td style=\"padding: 4px; text-align: right\">" + data.getResourceAt(i) + "&nbsp;<img src=\"" + Config.getMediaUrl() +
				"images/misc/blank.gif\" class=\"resource r" + i + "\"/>&nbsp;</td>" +
			"</tr>";
	}
	
	report += "</table>";
	
	HTMLPanel reportPanel = new HTMLPanel(report);
	reportPanel.setWidth("300px");
	
	// Bouton OK
	okBt = new JSButton(messages.ok());
	okBt.setPixelWidth(100);
	okBt.addClickListener(this);
	
	JSRowLayout layout = new JSRowLayout();
	layout.addComponent(reportPanel);
	layout.addRowSeparator(10);
	layout.addComponent(okBt);
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	
	setComponent(layout);
	centerOnScreen();
	setDefaultCloseOperation(DESTROY_ON_CLOSE);
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:42,代碼來源:ProbeReportDialog.java

示例8: BattleModeDialog

import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public BattleModeDialog(int playerFleetId, int enemyFleetId, boolean bombing) {
	super("Combat", true, true, true);
	
	this.playerFleetId = playerFleetId;
	this.enemyFleetId = enemyFleetId;
	this.bombing = bombing;
	
	JSLabel titleLabel = new JSLabel("<span class=\"title\" style=\"font-size: 14px;\">&nbsp;&nbsp;Mode de combat</span>");
	
	// Description des modes de combat
	HTMLPanel skirmishDescription = new HTMLPanel("<b unselectable=\"on\">Escarmouche :</b> exécute les 5 actions que vous avez défini pour le mode escarmouche, immobilise votre flotte 2h.");
	skirmishDescription.setWidth("290px");
	skirmishDescription.getElement().setAttribute("unselectable", "on");
	skirmishDescription.addStyleName("justify");
	skirmishDescription.getElement().getStyle().setProperty("padding", "5px");
	OpenJWT.setElementFloat(skirmishDescription.getElement(), "left");
	
	HTMLPanel battleDescription = new HTMLPanel("<b unselectable=\"on\">Bataille :</b> exécute les 15 actions que vous avez défini pour le mode bataille, immobilise votre flotte 4h.");
	battleDescription.setWidth("290px");
	battleDescription.getElement().setAttribute("unselectable", "on");
	battleDescription.addStyleName("justify");
	battleDescription.getElement().getStyle().setProperty("padding", "5px");
	OpenJWT.setElementFloat(battleDescription.getElement(), "left");
	
	// Choix du mode de combat
	tacticsBt = new JSButton("Voir les options tactiques");
	tacticsBt.setPixelWidth(220);
	tacticsBt.addClickListener(this);
	
	skirmishBt = new JSButton("Escarmouche");
	skirmishBt.setPixelWidth(150);
	skirmishBt.addClickListener(this);
	
	battleBt = new JSButton("Bataille");
	battleBt.setPixelWidth(150);
	battleBt.addClickListener(this);
	
	// Mise en forme des composants
	JSRowLayout layout = new JSRowLayout();
	layout.addRowSeparator(8);
	layout.addComponent(titleLabel);
	layout.addRowSeparator(12);
	layout.addComponent(skirmishDescription);
	layout.addRowSeparator(5);
	layout.addComponent(battleDescription);
	layout.addRowSeparator(10);
	layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
	layout.addComponent(tacticsBt);
	layout.addRowSeparator(15);
	layout.addComponent(skirmishBt);
	layout.addComponent(battleBt);
	
	layout.getElement().getStyle().setProperty("background",
			"url('" + Config.getMediaUrl() + "images/misc/battle.png') 0 0 no-repeat");
	
	setComponent(layout);
	setDefaultCloseOperation(DESTROY_ON_CLOSE);
	centerOnScreen();
}
 
開發者ID:Orichievac,項目名稱:FallenGalaxy,代碼行數:60,代碼來源:BattleModeDialog.java


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