List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellWidth
public void setCellWidth(IsWidget w, String width)
From source file:org.utgenome.gwt.widget.client.HorizontalTrackFrame.java
License:Apache License
protected void drawWidget() { setTrackTitle("Track"); Style.fullWidth(layoutTable); layoutTable.setCellPadding(0);// w w w . j a v a 2 s.c o m layoutTable.setCellSpacing(0); // label Style.fontSize(trackLabel, 11); Style.fontFamily(trackLabel, "Arial, Tahoma, Verdana"); Style.set(trackLabel, "color", "white"); Style.margin(trackLabel, Style.LEFT, 2); Style.verticalAlign(trackLabel, "middle"); Style.overflowHidden(trackLabel); // label frame labelFrame.add(trackLabel); Style.cursor(labelFrame, Style.CURSOR_MOVE); // title bar (label + icon) HorizontalPanel hp = new HorizontalPanel(); Style.fullWidth(hp); hp.add(labelFrame); hp.setCellWidth(labelFrame, "100%"); hp.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT); hp.add(getIconSetPanel()); // track info panel Style.fullSize(trackInfoPanel); Style.backgroundImage(trackInfoPanel, "theme/default/track-base.png"); Style.backgroundColor(trackInfoPanel, "00a7bf"); trackInfoPanel.add(hp); // track info border trackInfoFrame.setWidget(trackInfoPanel); trackInfoFrame.setSize("180px", "100%"); // layout (track info | track content | resize bar) layoutTable.setWidget(0, 0, trackInfoFrame); // scroll panel layoutTable.setWidget(0, 1, scrollPanel); layoutTable.getCellFormatter().setHeight(0, 1, "100%"); layoutTable.getCellFormatter().setWidth(0, 1, "100%"); // resize bar VerticalPanel resizeBarPanel = new VerticalPanel(); Style.fullSize(resizeBarPanel); Style.backgroundColor(resizeBarPanel, "D0F0F0"); resizeBarPanel.setVerticalAlignment(VerticalPanel.ALIGN_BOTTOM); resizeBarPanel.add(getResizeButton()); // resize bar frame FrameBorder resizeBarBorder = new FrameBorder(2, FrameBorder.EAST | FrameBorder.SOUTH); resizeBarBorder.setSize("16px", "100%"); resizeBarBorder.setWidget(resizeBarPanel); layoutTable.getCellFormatter().setHeight(0, 2, "100%"); layoutTable.getCellFormatter().setWidth(0, 2, "100%"); layoutTable.setWidget(0, 2, resizeBarBorder); // Style.hideHorizontalScrollBar(scrollPanel); }
From source file:org.utgenome.gwt.widget.client.TrackWindowPanel.java
License:Apache License
protected void drawWidget() { // track label setTrackTitle("Track"); Style.fontSize(titleLabel, 11); Style.fontFamily(titleLabel, "Tahoma, Arial, Verdana"); Style.set(titleLabel, "color", "white"); Style.overflowHidden(titleLabel); Style.fullBlock(titleLabel);/*from w w w.j a v a2 s . co m*/ labelFrame.add(titleLabel); // label frame Style.fullWidth(labelFrame); Style.cursor(labelFrame, Style.CURSOR_MOVE); // title bar titleFrame.setHeight("23px"); Style.fullWidth(titleFrame); Label windowLeftCorner = new Label(); windowLeftCorner.setSize("9px", "23px"); Style.fontSize(windowLeftCorner, 0); Style.backgroundImage(windowLeftCorner, "theme/default/tdl.gif"); Style.backgroundNoRepeat(windowLeftCorner); Label windowRightCorner = new Label(); windowRightCorner.setSize("9px", "23px"); Style.fontSize(windowRightCorner, 0); Style.backgroundImage(windowRightCorner, "theme/default/tdr.gif"); Style.backgroundNoRepeat(windowRightCorner); HorizontalPanel titleBarFrame = new HorizontalPanel(); titleBarFrame.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE); titleBarFrame.setHeight("23px"); titleBarFrame.add(labelFrame); titleBarFrame.setCellWidth(labelFrame, "100%"); titleBarFrame.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); titleBarFrame.add(getIconSetPanel()); Style.fullWidth(titleBarFrame); Style.backgroundImage(titleBarFrame, "theme/default/td.gif"); Style.backgroundRepeatX(titleBarFrame); Style.backgroundColor(titleBarFrame, "EEEEEE"); titleFrame.add(windowLeftCorner); titleFrame.add(titleBarFrame); titleFrame.setCellWidth(titleBarFrame, "100%"); titleFrame.add(windowRightCorner); VerticalPanel borderContent = new VerticalPanel(); //Style.fullSize(borderContent); // whole window Style.fullSize(layoutPanel); layoutPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP); layoutPanel.add(titleFrame); // scroll panel borderContent.add(scrollPanel); //borderContent.setCellHeight(scrollPanel, "100%"); //borderContent.setCellWidth(scrollPanel, "100%"); // resize bar HorizontalPanel hp = new HorizontalPanel(); Style.fullWidth(hp); //Style.backgroundColor(hp, "D0F0F0"); Style.backgroundColor(hp, "E0E0E0"); hp.setHeight("16px"); hp.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); hp.add(getResizeButton()); borderContent.add(hp); // window border border = new FrameBorder(2, FrameBorder.EAST | FrameBorder.SOUTH | FrameBorder.WEST); Style.fullWidth(border); border.setWidget(borderContent); layoutPanel.add(border); // set default widget height setWidth(200); setHeight(100); }
From source file:rocket.widget.client.menu.HorizontalMenuList.java
License:Apache License
protected HorizontalPanel createHorizontalPanel() { final HorizontalPanel panel = new HorizontalPanel(); panel.setWidth("100%"); final Widget padder = this.createPadder(); this.setPadder(padder); panel.add(padder);/*from ww w.j av a 2s. co m*/ panel.setCellWidth(padder, "100%"); return panel; }
From source file:scrum.client.workspace.LockInfoWidget.java
License:Open Source License
@Override protected Widget onInitialization() { Label spacer = new Label(); message = new HTML(); image = new Image(); image.addStyleName("LockInfoWidget-icon"); HorizontalPanel panel = new HorizontalPanel(); panel.setStyleName("WaitWidget"); panel.setWidth("100%"); panel.setSpacing(10);//from ww w . j av a 2 s .c o m panel.add(spacer); panel.setCellWidth(spacer, "200px"); panel.add(image); panel.setCellWidth(image, "36px"); panel.add(message); panel.setCellVerticalAlignment(message, HorizontalPanel.ALIGN_MIDDLE); return panel; }
From source file:scrum.client.workspace.WorkspaceWidget.java
License:Open Source License
@Override protected Widget onInitialization() { lockInfo = new LockInfoWidget(); HeaderWidget header = new HeaderWidget(); SimplePanel workspaceHeader = Gwt.createDiv("Workspace-header", header); sidebar = new SwitcherWidget(false); sidebar.addStyleName("Workspace-sidebar"); workarea.addStyleName("Workspace-workarea"); HorizontalPanel workspaceBody = Gwt.createHorizontalPanel(10, sidebar, workarea); workspaceBody.setCellWidth(sidebar, "200px"); FlowPanel workspace = Gwt.createFlowPanel(workspaceHeader, workspaceBody); workspace.setStyleName("Workspace"); locker = new LockWidget(workspace); return locker; }
From source file:viewer.AlignedTree.java
License:Open Source License
public static void align(final HasTreeItems tree, final int spacing) { final HorizontalPanel first = findFirstHBox(tree); if (first == null) { return;//from w w w. ja va 2s . c om } // 1st pass: find the max width for each "column". int[] widths = new int[first.getWidgetCount()]; for (final Widget w : iter(tree)) { if (w instanceof HorizontalPanel) { final HorizontalPanel h = (HorizontalPanel) w; final int n = h.getWidgetCount(); if (n > widths.length) { // Uh? There's no Arrays.copyOf in GWT's emulated JRE. WTF? //widths = Arrays.copyOf(widths, n); final int[] old = widths; widths = new int[n]; System.arraycopy(old, 0, widths, 0, old.length); } for (int i = 0; i < n; i++) { final int width = h.getWidget(i).getOffsetWidth(); if (width > widths[i]) { widths[i] = width; } } } } // Add the spacing we were asked to add. for (int i = 0; i < widths.length; i++) { widths[i] += spacing; } // 2nd pass: set the width on every cell in each row. for (final Widget w : iter(tree)) { if (w instanceof HorizontalPanel) { final HorizontalPanel h = (HorizontalPanel) w; final int n = h.getWidgetCount(); for (int i = 0; i < n; i++) { h.setCellWidth(h.getWidget(i), widths[i] + "px"); } } } }
From source file:web.diva.client.unused.RankPanel.java
public RankPanel() { this.setAnimationEnabled(true); this.ensureDebugId("cwBasicPopup-imagePopup"); this.setModal(false); VerticalPanel framLayout = new VerticalPanel(); framLayout.setWidth("485px"); framLayout.setHeight("230px"); VerticalPanel mainBodyLayout = new VerticalPanel(); mainBodyLayout.setWidth("483px"); mainBodyLayout.setHeight("308px"); mainBodyLayout.setStyleName("modalPanelBody"); HorizontalPanel topLayout = new HorizontalPanel(); // mainBodyLayout.addMember(topLayout); topLayout.setWidth(483 + "px"); topLayout.setHeight("18px"); topLayout.setStyleName("whiteLayout"); // topLayout.setSpacing(3); Label title = new Label("Rank Product (Differential Expression)"); topLayout.add(title);/*from w w w . j a va 2 s . c o m*/ title.setStyleName("labelheader"); title.setWidth(220 + "px"); topLayout.setCellHorizontalAlignment(title, HorizontalPanel.ALIGN_LEFT); topLayout.setCellVerticalAlignment(title, HorizontalPanel.ALIGN_TOP); Label closeBtn = new Label(); closeBtn.addStyleName("close"); closeBtn.setHeight("16px"); closeBtn.setWidth("16px"); closeBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(true); } }); topLayout.add(closeBtn); topLayout.setCellHorizontalAlignment(closeBtn, HorizontalPanel.ALIGN_RIGHT); topLayout.setCellVerticalAlignment(closeBtn, HorizontalPanel.ALIGN_TOP); try { VerticalPanel groupsTableLayout = new VerticalPanel(); mainBodyLayout.add(groupsTableLayout); groupsTableLayout.setWidth(483 + "px"); groupsTableLayout.setHeight("100px"); groupsTableLayout.setStyleName("whiteLayout"); Label tableTitle = new Label("Column Groups (Max 2)"); tableTitle.setHeight("20px"); tableTitle.setWidth("250px"); tableTitle.setStyleName("secheadertitle"); groupsTableLayout.add(tableTitle); groupsTableLayout.setCellVerticalAlignment(tableTitle, VerticalPanel.ALIGN_MIDDLE); selectionTable = new ListGrid(); initSelectionTable(); groupsTableLayout.add(selectionTable); groupsTableLayout.setCellVerticalAlignment(selectionTable, VerticalPanel.ALIGN_MIDDLE); groupsTableLayout.setCellHorizontalAlignment(selectionTable, VerticalPanel.ALIGN_CENTER); HorizontalPanel middleLayout = new HorizontalPanel(); middleLayout.setWidth("483px"); middleLayout.setHeight("100px"); middleLayout.setStyleName("whiteLayout"); DynamicForm form = new DynamicForm(); form.setIsGroup(false); form.setWidth(150); form.setLayoutAlign(Alignment.CENTER); form.setHeight("100px"); form.setNumCols(1); form.setLeft(20); radioGroupItem = new RadioGroupItem(); radioGroupItem.setShowTitle(false); radioGroupItem.setHeight("50px"); radioGroupItem.setWidth("150px"); radioGroupItem.setTitle("Values "); radioGroupItem.setValueMap("Log 2", "Linear"); radioGroupItem.setValue("Log 2"); radioGroupItem.setShouldSaveValue(true); defaultGroupSelectionItem = new CheckboxItem(); defaultGroupSelectionItem.setStartRow(true); defaultGroupSelectionItem.setTitle("Default Rank Product"); defaultGroupSelectionItem.setShowTitle(false); defaultGroupSelectionItem.setValueMap("Default Rank Product"); defaultGroupSelectionItem.setValue(true); // defaultGroupSelectionItem.setTitleOrientation(TitleOrientation.RIGHT); defaultGroupSelectionItem.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { defaultRank = (((Boolean) event.getValue())); } }); defaultGroupSelectionItem.setTooltip("loaded by default on loading the dataset"); form.setFields(radioGroupItem, defaultGroupSelectionItem); form.redraw(); middleLayout.add(form); middleLayout.setCellWidth(form, "170px"); middleLayout.setCellHorizontalAlignment(form, HorizontalPanel.ALIGN_CENTER); form2 = new DynamicForm(); form2.setIsGroup(false); form2.setHeight("60px"); form2.setWidth100(); form2.setMargin(0); form2.setPadding(1); form2.setNumCols(3); permutation = new TextItem(); permutation.setTitle("Permutation"); permutation.setBrowserInputType("digits"); permutation.setRequired(true); permutation.setValidators(new IsIntegerValidator()); permutation.setValue(400); seed = new TextItem(); seed.setTitle("Seed"); seed.setRequired(true); seed.setBrowserInputType("digits"); seed.disable(); seed.setValue(Random.nextInt(1000000001)); final ButtonItem btn = new ButtonItem("seed", "seed"); btn.setStartRow(false); btn.setWidth(40); btn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { @Override public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) { seed.setValue(Random.nextInt(1000000001)); } }); form2.setFields(permutation, seed, btn); form2.setColWidths(new Object[] { 100, "*", 60 }); // form2.redraw(); okBtn = new IButton("Process"); okBtn.setWidth("200px"); okBtn.setHeight("20px"); okBtn.setAlign(Alignment.CENTER); VLayout hlo = new VLayout(); hlo.setWidth("220px"); hlo.setHeight("80px"); hlo.setAlign(Alignment.CENTER); hlo.addMember(form2); form.redraw(); middleLayout.add(hlo); mainBodyLayout.add(middleLayout); mainBodyLayout.add(okBtn); mainBodyLayout.setCellHorizontalAlignment(okBtn, VerticalPanel.ALIGN_CENTER); } catch (Exception e) { Window.alert("error is "); } errorlabl = new HTML( "<p style='font-size: 10px;color:red;margin-left: 20px;height=20px;'>PLEASE CHECK YOUR DATA INPUT .. PLEASE NOTE THAT YOU CAN NOT SELECT MORE THAN 2 GROUPS</p>"); errorlabl.setVisible(false); errorlabl.setHeight("50px"); errorlabl.setWidth("398px"); mainBodyLayout.add(errorlabl); framLayout.add(topLayout); framLayout.add(mainBodyLayout); this.setWidget(framLayout); framLayout.setStyleName("modalPanelLayout"); this.show(); this.hide(); }