本文整理汇总了Java中com.google.gwt.user.client.ui.HorizontalPanel.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalPanel.setSize方法的具体用法?Java HorizontalPanel.setSize怎么用?Java HorizontalPanel.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGridPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private HorizontalPanel createGridPanel() {
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.setSize("510px", "320px");
vehicleStore = new ListStore<VehicleJSO>(vehicleProps.key());
vehiculeGrid = createGrid(vehicleStore, vehicleProps);
vehiculeGrid.getSelectionModel().addSelectionChangedHandler(
new SelectionChangedHandler<VehicleJSO>() {
@Override
public void onSelectionChanged(
SelectionChangedEvent<VehicleJSO> event) {
List<VehicleJSO> selected = event.getSelection();
vehicleToolBar.setVehicles(selected);
}
});
VerticalLayoutContainer gridContainer = new VerticalLayoutContainer();
gridContainer.setWidth(500);
gridContainer.setHeight(320);
gridContainer.add(vehiculeGrid, new VerticalLayoutData(1, 1));
hPanel.add(gridContainer);
hPanel.add(vehicleToolBar);
return hPanel;
}
示例2: AlertButton
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
* @param title The text that will appear on the button face.
* @param alertStyle the dependent style suffix that will be appended to the default GWT style when the user is to be alerted.
*/
public AlertButton(String title, String alertStyle) {
button = new PushButton(title);
button.addStyleDependentName("SMALLER");
panel = new HorizontalPanel();
panel.setBorderWidth(1);
checkBox = new CheckBox();
panel.add(button);
button.setSize("66", "21");
panel.add(checkBox);
checkBox.setSize("20", "20");
ClientFactory cf = GWT.create(ClientFactory.class);
eventBus = cf.getEventBus();
this.alertStyle = alertStyle;
eventBus.addHandler(WidgetSelectionChangeEvent.TYPE, updateNeededEventHandler);
eventBus.addHandler(VariableSelectionChangeEvent.TYPE, variableChangedEventHandler);
eventBus.addHandler(UpdateFinishedEvent.TYPE, updateFinishedHandler);
eventBus.addHandler(MapChangeEvent.TYPE, mapChangeHandler);
initWidget(panel);
panel.setSize("90", "23");
this.ensureDebugId("AlertButton");
}
示例3: getPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private HorizontalPanel getPanel(final HTML data) {
HorizontalPanel panel = new HorizontalPanel();
panel.setSize("520px", "310px");
panel.setSpacing(5);
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
panel.add(getAuthenticationPanel());
panel.add(data);
return panel;
}
示例4: getColorPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private HorizontalPanel getColorPanel(Layer layer) {
HorizontalPanel colorPanel = new HorizontalPanel();
colorPanel.setSize("20px", "20px");
colorPanel.getElement().getStyle()
.setBackgroundColor(getColor(layer, "fillColor"));
colorPanel.setBorderWidth(2);
colorPanel.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
colorPanel.getElement().getStyle()
.setBorderColor(getColor(layer, "strokeColor"));
return colorPanel;
}
示例5: getColorPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private HorizontalPanel getColorPanel(String color) {
HorizontalPanel colorPanel = new HorizontalPanel();
colorPanel.setSize("20px", "20px");
colorPanel.getElement().getStyle().setBackgroundColor(color);
colorPanel.getElement().getStyle().setBorderColor(color);
return colorPanel;
}
示例6: apply
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
@Override
public void apply(WorkAreaPanel workArea) {
// Clear base panel
workArea.clear();
// Horizontal panel to hold columns
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setSize("100%", "100%");
workArea.add(horizontalPanel);
// Initialize columns
for (Column column : columns) {
horizontalPanel.add(column.columnPanel);
workArea.getWidgetDragController().registerDropController(column);
// Add invisible dummy widget to prevent column from collapsing when it contains no boxes
column.columnPanel.add(new Label());
// Add boxes from layout
List<BoxDescriptor> boxes = column.boxes;
for (int index = 0; index < boxes.size(); index++) {
BoxDescriptor bd = boxes.get(index);
Box box = workArea.createBox(bd);
if (box != null) {
column.insert(box, index);
box.restoreLayoutSettings(bd);
}
}
}
workArea.getWidgetDragController().addDragHandler(changeDetector);
}
示例7: OperationsMenu
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public OperationsMenu() {
buttonBar = new HorizontalPanel();
buttonBar.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
turnOffButtons();
animationButton.addStyleDependentName("SMALLER");
animationButton.setTitle("Interactive interface for making a sequence of plots over time.");
compareButton.addStyleDependentName("SMALLER");
correlationButton.addStyleDependentName("SMALLER");
correlationButton.setTitle("Beta interface to make a scatter plot of a property vs. another property.");
googleEarthButton.addStyleDependentName("SMALLER");
googleEarthButton.setTitle("View a plot of data draped over the globe using Google Earth.");
showValuesButton.addStyleDependentName("SMALLER");
showValuesButton.setTitle("Look at the data values in a new window.");
exportToDesktopButton.addStyleDependentName("SMALLER");
exportToDesktopButton.setTitle("Get a few lines of native script for various analysis packages.");
saveAsButton.addStyleDependentName("SMALLER");
saveAsButton.ensureDebugId("saveAsButton");
saveAsButton.setTitle("Save data in various text and binary formats.");
climateAnalysis.addStyleDependentName("SMALLER");
climateAnalysis.setTitle("Perform time average spectrum and other advanced analysis.");
dsgTable.addStyleDependentName("SMALLER");
dsgTable.setTitle("See a table of current observations by ID.");
thumbnailTable.addStyleDependentName("SMALLER");
thumbnailTable.setTitle("See a table of select property-property plots.");
buttonBar.add(animationButton);
buttonBar.add(correlationButton);
buttonBar.add(googleEarthButton);
buttonBar.add(showValuesButton);
buttonBar.add(exportToDesktopButton);
buttonBar.add(saveAsButton);
buttonBar.add(climateAnalysis);
buttonBar.add(dsgTable);
buttonBar.add(thumbnailTable);
climateAnalysis.setVisible(false);
dsgTable.setVisible(false);
thumbnailTable.setVisible(false);
initWidget(buttonBar);
buttonBar.setSize("100%", "100%");
}
示例8: ExpressionView
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
* Instantiates a new expression view.
*/
public ExpressionView()
{
super();
setSpacing(5);
Button btnRefresh = new Button("Refresh");
btnRefresh.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
refreshButtonPressed();
}
});
add(btnRefresh);
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setSpacing(10);
add(horizontalPanel);
horizontalPanel.setSize("517px", "279px");
Tree tree = new Tree();
tree.addSelectionHandler(this);
horizontalPanel.add(tree);
trtmByPerson = new TreeItem(SafeHtmlUtils.fromString("By Person"));
tree.addItem(trtmByPerson);
trtmByTable = new TreeItem(SafeHtmlUtils.fromString("By Table"));
tree.addItem(trtmByTable);
trtmByTarget = new TreeItem(SafeHtmlUtils.fromString("By Target"));
tree.addItem(trtmByTarget);
verticalPanel = new VerticalPanel();
horizontalPanel.add(verticalPanel);
}
示例9: getPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private HorizontalPanel getPanel(final HTML data) {
HorizontalPanel panel = new HorizontalPanel();
panel.setSize("520px", "310px");
panel.setSpacing(5);
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
Anchor anchor = new AnchorBuilder().setHref("http://www.geowe.org")
.setImage(new Image(ImageProvider.INSTANCE.geoweSquareLogo()))
.build();
panel.add(anchor);
panel.add(data);
return panel;
}
示例10: setupStatusRegion
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public static void setupStatusRegion(LayoutManager lm) {
final HorizontalPanel hp = new HorizontalPanel();
Region statusBar = new BaseRegion(STATUS) {
@Override
public void setDisplay(Widget display) {
GwtUtil.setStyles(display, "fontSize", "12px", "lineHeight", "40px");
super.setDisplay(display);
}
@Override
public void hide() {
hp.setVisible(false);
}
@Override
public void show() {
hp.setVisible(true);
}
};
Image im = new Image("images/gxt/attention.gif");
im.setSize("16px", "16px");
GwtUtil.setStyle(im, "marginLeft", "20px");
hp.add(im);
hp.add(statusBar.getDisplay());
hp.getElement().setId("app-status");
hp.setSize("99%", "40px");
hp.setCellVerticalAlignment(im, VerticalPanel.ALIGN_MIDDLE);
hp.setCellVerticalAlignment(statusBar.getDisplay(), VerticalPanel.ALIGN_MIDDLE);
hp.setVisible(false);
RootPanel.get("application").add(hp);
lm.addRegion(statusBar);
}
示例11: BarcodeDialogBox
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
BarcodeDialogBox(String projectName, String appInstallUrl) {
super(false, true);
setStylePrimaryName("ode-DialogBox");
setText(MESSAGES.barcodeTitle(projectName));
ClickHandler buttonHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
};
Button cancelButton = new Button(MESSAGES.cancelButton());
cancelButton.addClickHandler(buttonHandler);
Button okButton = new Button(MESSAGES.okButton());
okButton.addClickHandler(buttonHandler);
HTML barcodeQrcode = new HTML("<center>" + BlocklyPanel.getQRCode(appInstallUrl) + "</center>");
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HTML warningLabel = new HTML(MESSAGES.barcodeWarning(
"<a href=\"" + "http://appinventor.mit.edu/explore/ai2/share.html" +
"\" target=\"_blank\">",
"</a>"));
warningLabel.setWordWrap(true);
warningLabel.setWidth("200px"); // set width to get the text to wrap
HorizontalPanel warningPanel = new HorizontalPanel();
warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
warningPanel.add(warningLabel);
// The cancel button is removed from the panel since it has no meaning in this
// context. But the logic is still here in case we want to restore it, and as
// an example of how to code this stuff in GWT.
// buttonPanel.add(cancelButton);
buttonPanel.add(okButton);
buttonPanel.setSize("100%", "24px");
VerticalPanel contentPanel = new VerticalPanel();
contentPanel.add(barcodeQrcode);
contentPanel.add(buttonPanel);
contentPanel.add(warningPanel);
// contentPanel.setSize("320px", "100%");
add(contentPanel);
}
示例12: ProgressBarDialogBox
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public ProgressBarDialogBox(String serviceName, ProjectNode projectNode) {
super(false, true);
this.serviceName = serviceName;
setStylePrimaryName("ode-DialogBox");
setText(projectNode.getName() + " " + MESSAGES.ProgressBarFor());
//click handler for the mini html buttons
ClickHandler buttonHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
progressBarShow++;
}
};
//declare the ok button
dismissButton.addClickHandler(buttonHandler);
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
dismissButton.setVisible(false); // we don't need the button unless we get an error
//warning label
warningLabel = new HTML("");
warningLabel.setWordWrap(true);
warningLabel.setWidth("60em"); // set width to get the text to wrap
//warning panel
HorizontalPanel warningPanel = new HorizontalPanel();
warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
warningPanel.add(warningLabel);
// button panel
buttonPanel.add(dismissButton);
buttonPanel.setSize("100%", "24px");
//content panel
VerticalPanel contentPanel = new VerticalPanel();
contentPanel.add(mpb);
contentPanel.add(warningPanel);
contentPanel.add(buttonPanel);
setWidget(contentPanel);
}
示例13: populateDialog
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
@Override
protected void populateDialog() {
addNewGrid( 2, 3, false, "", false);
//Add the radio-html widget to the panel
this.addToGrid(this.getCurrentGridIndex(), FIRST_COLUMN_INDEX, 3, radioHTML, false, false);
//Construct and add the listbox
HorizontalPanel panel = new HorizontalPanel();
panel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
panel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
panel.setSize("100%", "100%");
Label chooseLabel = new Label( titlesI18N.chooseRadioText() );
chooseLabel.setStyleName( CommonResourcesContainer.CONST_FIELD_VALUE_DEFAULT_IMP_STYLE_NAME );
final ListBox chooseRadioListBox = new ListBox();
for( String name : nameToUrl.keySet() ) {
chooseRadioListBox.addItem( name );
}
chooseRadioListBox.addChangeHandler( new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
setRadioStation( chooseRadioListBox.getItemText( chooseRadioListBox.getSelectedIndex() ) );
}
});
final String defaultRadioStation = chooseRadioListBox.getItemText(0);
panel.add( chooseLabel );
panel.add( new HTML(" "));
panel.add( chooseRadioListBox );
this.addToGrid(this.getCurrentGridIndex(), FIRST_COLUMN_INDEX, 2, panel, true, false);
//Set the default radio station
setRadioStation( defaultRadioStation );
//Create navigation button "Close"
Button closeButton = new Button();
closeButton.setText( titlesI18N.closeButtonTitle() );
closeButton.setStyleName( CommonResourcesContainer.USER_DIALOG_ACTION_BUTTON_STYLE );
closeButton.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent e) {
//Close the dialog
hide();
}
} );
this.addToGrid( SECOND_COLUMN_INDEX, closeButton, false, true);
}
示例14: addMainDataFields
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private void addMainDataFields() {
//ADD THE MAIN DATA FIELDS
addNewGrid( 1, 1, false, "", true);
HorizontalPanel mainInfoHPanel = new HorizontalPanel();
mainInfoHPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE);
mainInfoHPanel.setSize("100%", "100%");
VerticalPanel mainFieldsPanel = new VerticalPanel();
mainFieldsPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
mainFieldsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT);
VerticalPanel mainValuesPanel = new VerticalPanel();
mainValuesPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
mainValuesPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT);
//Add the login name field
Label userLoginNameLabel = new Label(); userLoginNameLabel.setText( userLoginName );
InterfaceUtils.addFieldValueToPanels( mainFieldsPanel, true, titlesI18N.userFieldName(),
mainValuesPanel, true, userLoginNameLabel );
//Add the online status field
InterfaceUtils.addFieldValueToPanels( mainFieldsPanel, true, titlesI18N.statusColumnTitle(),
mainValuesPanel, true, onlineStatus );
//Add last online date field
InterfaceUtils.addFieldValueToPanels( mainFieldsPanel, true, titlesI18N.lastOnlineFieldTitle(),
mainValuesPanel, true, lastOnlineDate );
//Add the avatar's image
mainInfoHPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
mainInfoHPanel.add( mainFieldsPanel );
mainInfoHPanel.add( new HTML(" ") );
mainInfoHPanel.add( mainValuesPanel );
mainInfoHPanel.add( new HTML(" ") );
mainInfoHPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
avatarImage = new UserAvatarImageWidget();
avatarImage.setTitle( titlesI18N.avatarUserFieldName() );
mainInfoHPanel.add( avatarImage );
addToGrid( FIRST_COLUMN_INDEX, mainInfoHPanel, false, false );
}
示例15: addOptionalDataFields
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private void addOptionalDataFields(){
//ADD THE OPTIONAL FIELDS
addNewGrid( 1, 1, true, titlesI18N.optionalUserDataFields(), false);
HorizontalPanel optionalHorizPanel = new HorizontalPanel();
optionalHorizPanel.setSize("80%", "100%");
optionalHorizPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
VerticalPanel optionalFieldsPanel = new VerticalPanel();
optionalFieldsPanel.setSize("100%", "100%");
optionalFieldsPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
VerticalPanel optionalValuesPanel = new VerticalPanel();
optionalValuesPanel.setSize("100%", "100%");
optionalValuesPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
optionalHorizPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT);
optionalFieldsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT);
optionalHorizPanel.add( optionalFieldsPanel );
optionalHorizPanel.add( new HTML(" ") );
optionalHorizPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT);
optionalValuesPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT);
optionalHorizPanel.add( optionalValuesPanel );
//Add the registration date/time field
InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false, titlesI18N.registrationDateFieldName(),
optionalValuesPanel, true, registrationDate );
//Add the first name field
firstNameFieldLabel = InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false,
titlesI18N.firstNameField(),
optionalValuesPanel, false, firstName );
//Add the last name field
lastNameFieldLabel = InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false,
titlesI18N.lastNameField(),
optionalValuesPanel, false, lastName );
//Add the age name field
ageFieldLabel = InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false,
titlesI18N.ageField(),
optionalValuesPanel, false, age );
//Add the gender name field
InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false, titlesI18N.genderField(),
optionalValuesPanel, false, gender );
//Add the city name field
cityFieldLabel = InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false,
titlesI18N.cityField(),
optionalValuesPanel, false, city );
//Add the country name field
countryFieldLabel = InterfaceUtils.addFieldValueToPanels( optionalFieldsPanel, false,
titlesI18N.countryField(),
optionalValuesPanel, false, country );
addToGrid( FIRST_COLUMN_INDEX, optionalHorizPanel, false, false );
}