List of usage examples for com.google.gwt.user.client.ui DockPanel SOUTH
DockLayoutConstant SOUTH
To view the source code for com.google.gwt.user.client.ui DockPanel SOUTH.
Click Source Link
From source file:com.vaadin.addon.calendar.gwt.client.ui.VCalendar.java
/** * Re-renders the whole week view/*from w w w .j a v a 2 s . c o m*/ * * @param scroll * The amount of pixels to scroll the week view * @param today * Todays date * @param daysInMonth * How many days are there in the month * @param firstDayOfWeek * The first day of the week * @param events * The events to render */ protected void updateWeekView(int scroll, Date today, int daysInMonth, int firstDayOfWeek, Collection<CalendarEvent> events, List<Day> days) { while (outer.getWidgetCount() > 0) { outer.remove(0); } monthGrid = null; String[] realDayNames = new String[getDayNames().length]; int j = 0; if (firstDayOfWeek == 2) { for (int i = 1; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } realDayNames[j] = getDayNames()[0]; } else { for (int i = 0; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } } weeklyLongEvents = new WeeklyLongEvents(this); if (weekGrid == null) { weekGrid = new WeekGrid(this, is24HFormat()); } updateWeekGrid(daysInMonth, days, today, realDayNames); updateEventsToWeekGrid(sortEventsByDuration(events)); outer.add(dayToolbar, DockPanel.NORTH); outer.add(weeklyLongEvents, DockPanel.NORTH); outer.add(weekGrid, DockPanel.SOUTH); if (!isHeightUndefined) { weekGrid.setHeightPX(intHeight - weeklyLongEvents.getOffsetHeight() - dayToolbar.getOffsetHeight()); } else { weekGrid.setHeightPX(intHeight); } weekGrid.setWidthPX(intWidth); dayToolbar.updateCellWidths(); weeklyLongEvents.setWidthPX(weekGrid.getInternalWidth()); weekGrid.setVerticalScrollPosition(scroll); recalculateHeights(); recalculateWidths(); }
From source file:com.vaadin.client.ui.VCalendar.java
License:Apache License
/** * Re-renders the whole week view//from w ww. j a v a2 s .c o m * * @param scroll * The amount of pixels to scroll the week view * @param today * Todays date * @param daysInMonth * How many days are there in the month * @param firstDayOfWeek * The first day of the week * @param events * The events to render */ public void updateWeekView(int scroll, Date today, int daysInMonth, int firstDayOfWeek, Collection<CalendarEvent> events, List<CalendarDay> days) { while (outer.getWidgetCount() > 0) { outer.remove(0); } monthGrid = null; String[] realDayNames = new String[getDayNames().length]; int j = 0; if (firstDayOfWeek == 2) { for (int i = 1; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } realDayNames[j] = getDayNames()[0]; } else { for (int i = 0; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } } weeklyLongEvents = new WeeklyLongEvents(this); if (weekGrid == null) { weekGrid = new WeekGrid(this, is24HFormat()); } updateWeekGrid(daysInMonth, days, today, realDayNames); updateEventsToWeekGrid(sortEventsByDuration(events)); outer.add(dayToolbar, DockPanel.NORTH); outer.add(weeklyLongEvents, DockPanel.NORTH); outer.add(weekGrid, DockPanel.SOUTH); weekGrid.setVerticalScrollPosition(scroll); }
From source file:com.vaadin.v7.client.ui.VCalendar.java
License:Apache License
/** * Re-renders the whole week view/*ww w . j a v a 2 s. com*/ * * @param scroll * The amount of pixels to scroll the week view * @param today * Todays date * @param daysInMonth * How many days are there in the month * @param firstDayOfWeek * The first day of the week * @param events * The events to render */ public void updateWeekView(int scroll, Date today, int daysInMonth, int firstDayOfWeek, Collection<CalendarEvent> events, List<CalendarDay> days) { while (outer.getWidgetCount() > 0) { outer.remove(0); } monthGrid = null; String[] realDayNames = new String[getDayNames().length]; int j = 0; if (firstDayOfWeek == 2) { for (int i = 1; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } realDayNames[j] = getDayNames()[0]; } else { for (int i = 0; i < getDayNames().length; i++) { realDayNames[j++] = getDayNames()[i]; } } weeklyLongEvents = new WeeklyLongEvents(this); if (weekGrid == null) { weekGrid = new WeekGrid(this, is24HFormat()); } updateWeekGrid(daysInMonth, days, today, realDayNames); updateEventsToWeekGrid(sortEvents(events)); outer.add(dayToolbar, DockPanel.NORTH); outer.add(weeklyLongEvents, DockPanel.NORTH); outer.add(weekGrid, DockPanel.SOUTH); weekGrid.setVerticalScrollPosition(scroll); }
From source file:com.xpn.xwiki.cbdf.client.CBDF.java
License:Open Source License
/** * Method that initializes all the variables and creates the html required for the color picker and so on. */// w ww .j av a2 s .c o m private void InitComponents() { apanel = new AbsolutePanel(); FocusPanel focus = new FocusPanel(); DockPanel panel = new DockPanel(); lastPosition[0] = 0; lastPosition[1] = 0; isMovable = false; isTransformable = false; transformPoints = new VirtualGroup(); transformPointers = new GraphicObject[9]; currRotation = 0.0; this.currentFontFamily = new ListBox(); this.currentFontFamily.setMultipleSelect(false); this.currentFontFamily.insertItem("Arial", 0); this.currentFontFamily.insertItem("Courier", 1); this.currentFontFamily.insertItem("Times New Roman", 2); this.currentFontFamily.insertItem("Verdana", 3); this.currentFontFamily.insertItem("Georgia", 4); this.currentFontFamily.setSelectedIndex(0); this.currentFontFamily.addChangeListener(this); this.currentFontSize = new ListBox(); this.currentFontSize.setMultipleSelect(false); this.currentFontSize.insertItem("8", 0); this.currentFontSize.insertItem("10", 1); this.currentFontSize.insertItem("12", 2); this.currentFontSize.insertItem("14", 3); this.currentFontSize.insertItem("16", 4); this.currentFontSize.insertItem("18", 5); this.currentFontSize.insertItem("20", 6); this.currentFontSize.insertItem("24", 7); this.currentFontSize.insertItem("28", 8); this.currentFontSize.insertItem("36", 9); this.currentFontSize.insertItem("48", 10); this.currentFontSize.insertItem("72", 11); this.currentFontSize.setSelectedIndex(2); this.currentFontSize.addChangeListener(this); this.currentFontStyle = new ListBox(); this.currentFontStyle.setMultipleSelect(false); this.currentFontStyle.insertItem("normal", 0); this.currentFontStyle.insertItem("italic", 1); this.currentFontStyle.setSelectedIndex(0); this.currentFontStyle.addChangeListener(this); this.currentFontWeight = new ListBox(); this.currentFontWeight.setMultipleSelect(false); this.currentFontWeight.insertItem("normal", 0); this.currentFontWeight.insertItem("bold", 1); this.currentFontWeight.setSelectedIndex(0); this.currentFontWeight.addChangeListener(this); this.updateFont(); canvas = new GraphicCanvas(); canvas.setStyleName("drawboard"); canvas.setPixelSize(width, height); canvas.addGraphicObjectListener(this); saver = new SVGFormatter("1.1", "http://www.w3.org/2000/svg", "demo", width, height); buttonPanel = new VerticalPanel(); buttonPanel.setSpacing(0); Grid gridShape = new Grid(4, 2); gridShape.setCellSpacing(2); gridShape.setCellPadding(2); Grid gridTransform = new Grid(3, 2); gridTransform.setCellPadding(2); gridTransform.setCellSpacing(2); fill = new HTML(" "); DOM.setStyleAttribute(fill.getElement(), "backgroundColor", this.currentFillColor.toHex()); DOM.setStyleAttribute(fill.getElement(), "border", "solid"); DOM.setStyleAttribute(fill.getElement(), "borderWidth", "thin"); DOM.setStyleAttribute(fill.getElement(), "borderColor", "#000000"); fill.setSize("30px", "30px"); fill.addClickListener(this); stroke = new HTML(" "); DOM.setStyleAttribute(stroke.getElement(), "backgroundColor", this.currentStrokeColor.toHex()); DOM.setStyleAttribute(stroke.getElement(), "border", "solid"); DOM.setStyleAttribute(stroke.getElement(), "borderWidth", "thin"); DOM.setStyleAttribute(stroke.getElement(), "borderColor", "#000000"); stroke.setSize("30px", "30px"); stroke.addClickListener(this); HTML fake = new HTML(" "); DOM.setStyleAttribute(fake.getElement(), "backgroundColor", "#FFFFFF"); fake.setSize("30px", "30px"); HTML fake2 = new HTML(" "); DOM.setStyleAttribute(fake2.getElement(), "backgroundColor", "#FFFFFF"); fake2.setSize("30px", "30px"); buttonPanel.add(gridShape); buttonPanel.add(fake); buttonPanel.add(fake2); this.strokeButton = new Image("gfx/color.gif"); this.strokeButton.setTitle("Choose the stroke"); this.strokeButton.setSize("34px", "34px"); this.strokeButton.addClickListener(this); buttonPanel.add(this.strokeButton); buttonPanel.setCellHorizontalAlignment(this.strokeButton, VerticalPanel.ALIGN_CENTER); buttonPanel.add(gridTransform); fillOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true); fillOpacity.addChangeListener(this); strokeOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true); strokeOpacity.addChangeListener(this); currentStrokeSize = new Slider(Slider.HORIZONTAL, 0, 50, 1, true); currentStrokeSize.addChangeListener(this); /** This adds the buttons to the two grids */ selectButton = addToGrid(gridShape, 0, 0, "Select object", "gfx/select.gif"); pencilButton = addToGrid(gridShape, 0, 1, "Draw with Pencil", "gfx/pencil.gif"); lineButton = addToGrid(gridShape, 1, 0, "Draw a Line", "gfx/line.gif"); rectButton = addToGrid(gridShape, 1, 1, "Draw a Rect", "gfx/rect.gif"); circleButton = addToGrid(gridShape, 2, 0, "Draw a Circle", "gfx/circle.gif"); ellipseButton = addToGrid(gridShape, 2, 1, "Draw a Ellipse", "gfx/ellipse.gif"); polylineButton = addToGrid(gridShape, 3, 0, "Draw a Path", "gfx/polyline.gif"); textButton = addToGrid(gridShape, 3, 1, "Write Text", "gfx/text.gif"); deleteButton = addToGrid(gridTransform, 0, 0, "Delete object", "gfx/delete.gif"); saveButton = addToGrid(gridTransform, 0, 1, "Save SVG to page", "gfx/save.gif"); backButton = addToGrid(gridTransform, 1, 0, "Send object Back", "gfx/back.gif"); frontButton = addToGrid(gridTransform, 1, 1, "Send object Front", "gfx/front.gif"); apanel.add(focus); focus.add(panel); panel.add(this.canvas, DockPanel.CENTER); panel.add(this.buttonPanel, DockPanel.WEST); panel.add(this.currentFontFamily, DockPanel.SOUTH); panel.add(this.currentFontSize, DockPanel.SOUTH); panel.add(this.currentFontStyle, DockPanel.SOUTH); panel.add(this.currentFontWeight, DockPanel.SOUTH); this.apanel.setSize("100%", "100%"); focus.addKeyboardListener(this); focus.setSize("100%", "100%"); }
From source file:de.lilawelt.zmachine.client.MachineInterface.java
License:Open Source License
public void initialize(int ver) { version = ver;/*w w w . j a va 2 s . c o m*/ Log.debug("method initialize"); Log.debug("game version: " + ver); Window.enableScrolling(false); commline = new CommandLine(); // outer.setHeight("100%"); // outer.setWidth("100%"); v = new VerticalPanel(); inner = new ScrollPanel(); inner.add(v); //DOM.setStyleAttribute(inner.getElement(), "overflowX", "hidden"); //DOM.setStyleAttribute(inner.getElement(), "overflowY", "hidden"); outer.add(inner, DockPanel.SOUTH); screenSize = new Dimension(255, 80); curWindow = 0; upperwindow = new UpperWindow(0); setColor(1, 1); // set colors to default. String testhtml = ""; for (int i = 0; i < 80; i++) testhtml += "W"; if (version > 3) { HTML testWidth; testWidth = new HTML(testhtml); outer.add(testWidth, DockPanel.NORTH); maxWidth = testWidth.getOffsetWidth() + scrollbarSize(); outer.remove(testWidth); } ResizeHandler resizehandler = new ResizeHandler() { public void onResize(ResizeEvent event) { correctWindowSizes(); /* int height = event.getHeight(); int offset = 0; int swidth; if ( version <= 3 ) swidth = Window.getClientWidth(); else swidth = maxWidth; if ( statusbar != null ) { offset += statusbar.getOffsetHeight(); } if ( upperwindow != null ) { offset += upperwindow.getOffsetHeight(); } outer.setHeight(height + "px"); inner.setHeight((height - offset) + "px"); outer.setWidth(swidth + "px"); inner.setWidth(swidth + "px"); //v.setWidth(swidth + "px"); */ } }; resize = Window.addResizeHandler(resizehandler); correctWindowSizes(); /* Timer t = new Timer() { public void run() { correctWindowSizes(); } }; t.schedule(4000); */ }
From source file:de.novanic.gwteventservice.demo.conversationapp.client.conversation.ui.GWTConversationMainPanel.java
License:Open Source License
public GWTConversationMainPanel() { setSize("60%", "60%"); setStyleName("borderPanel"); myMessageHistoryTextArea = createMessageHistoryTextArea(); myConversationLoginPanel = createConversationLoginPanel(); myConversationChannelPanel = createConversationChannelPanel(); myConversationMessagePanel = createConversationMessagePanel(); ScrollPanel theMessageHistoryScrollPanel = createMessageHistoryScrollPanel(myMessageHistoryTextArea); add(myConversationLoginPanel, DockPanel.NORTH); add(myConversationChannelPanel, DockPanel.WEST); add(theMessageHistoryScrollPanel, DockPanel.CENTER); add(myConversationMessagePanel, DockPanel.SOUTH); }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Widget makeCenter() { final DockPanel resultsView = new DockPanel(); resultsView.setSize("100%", "100%"); final BaseRegion content = new BaseRegion(CONTENT_REGION); Widget w = content.getDisplay();/*from w w w .j a va 2 s. c om*/ w.setWidth("100%"); addRegion(content); final Region query = getForm(); final Region results = getResult(); final Region title = getSearchTitle(); final Region desc = getSearchDesc(); GwtUtil.ImageButton img = GwtUtil.makeImageButton("images/disclosurePanelClosed.png", "Return to search", new ClickHandler() { public void onClick(ClickEvent event) { Application.getInstance().processRequest(new Request(SearchCmd.COMMAND_NAME)); } }); boolean backToArrow = Application.getInstance().getProperties() .getBooleanProperty("BackToSearch.arrow.show", true); boolean searchDescLine = Application.getInstance().getProperties().getBooleanProperty("BackToSearch.show", true); final HorizontalPanel ttdesc = new HorizontalPanel(); if (title != null && searchDescLine) { ttdesc.setWidth("100%"); if (backToArrow) { ttdesc.add(img); } ttdesc.add(title.getDisplay()); ttdesc.add(desc.getDisplay()); ttdesc.setCellWidth(desc.getDisplay(), "100%"); ttdesc.add(layoutSelector); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { ttdesc.setVisible(Application.getInstance().hasSearchResult()); } }); } // final Region download = getDownload(); VerticalPanel vp = new VerticalPanel(); vp.setWidth("100%"); if (query.getDisplay() != null) { vp.add(query.getDisplay()); } if (searchDescLine) vp.add(ttdesc); resultsView.add(vp, DockPanel.NORTH); resultsView.setCellHeight(vp, "10px"); resultsView.add(results.getDisplay(), DockPanel.CENTER); resultsView.add(content.getDisplay(), DockPanel.SOUTH); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (DROPDOWN_REGION.equals(source.getId()) || RESULT_REGION.equals(source.getId())) { content.hide(); resultsView.setCellHeight(results.getDisplay(), "100%"); resultsView.setCellHeight(content.getDisplay(), ""); } else if (CONTENT_REGION.equals(source.getId())) { query.hide(); results.hide(); resultsView.setCellHeight(content.getDisplay(), "100%"); resultsView.setCellHeight(results.getDisplay(), ""); } } }); Region popoutRegion = getRegion(POPOUT_REGION); // SimplePanel popoutView = new SimplePanel(); // popoutView.add(popoutRegion.getDisplay()); final DeckPanel center = new DeckPanel(); center.add(resultsView); center.add(popoutRegion.getDisplay()); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(1); } else if (RESULT_REGION.equals(source.getId())) { center.showWidget(0); } } }); WebEventManager.getAppEvManager().addListener(Name.REGION_HIDE, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(0); } } }); center.showWidget(0); return center; }
From source file:edu.caltech.ipac.firefly.ui.BaseDialog.java
public void setWidget(Widget w) { _theWidget = w;// w w w .j a va 2 s. com if (w instanceof RequiresResize) { DockLayoutPanel contents = new DockLayoutPanel(Style.Unit.PX); DockLayoutPanel layout = new DockLayoutPanel(Style.Unit.PX); _popup.setWidget(layout); VerticalPanel vp = new VerticalPanel(); vp.add(_buttons); vp.setWidth("100%"); layout.addSouth(vp, 50); layout.add(contents); contents.addStyleName("base-dialog"); contents.addStyleName("base-dialog-contents"); contents.add(w); } else { SimplePanel contents = new SimplePanel(); DockPanel layout = new DockPanel(); _popup.setWidget(layout); layout.add(_buttons, DockPanel.SOUTH); layout.add(contents, DockPanel.CENTER); contents.addStyleName("base-dialog"); contents.addStyleName("base-dialog-contents"); contents.setWidget(w); } }
From source file:edu.caltech.ipac.firefly.ui.DynDownloadSelectionDialog.java
private void buildDialog() { createContents(); _layout.add(_buttons, DockPanel.SOUTH); _layout.add(_contents, DockPanel.CENTER); _layout.add(_panel, DockPanel.NORTH); setWidget(_layout); }
From source file:edu.caltech.ipac.firefly.ui.panels.ToolbarDropdown.java
public void layout() { // clearHeaderBar(); mainPanel.add(content.getDisplay(), DockPanel.CENTER); mainPanel.add(footer.getDisplay(), DockPanel.SOUTH); footer.getDisplay().setStyleName("footer"); footer.getDisplay().setVisible(showFooter); mainPanel.setCellHeight(content.getDisplay(), "100%"); dpanel.setContent(mainPanel);// ww w . j a v a 2s.com GwtUtil.setStyles(mainPanel.getParent(), "width", "100%"); if (content.getContent() != null) { if (showFooter) { content.getContent().addStyleName("shadow"); } else { content.getContent().removeStyleName("shadow"); } } updateCloseVisibility(); }