List of usage examples for com.vaadin.ui HorizontalLayout setWidth
@Override public void setWidth(String width)
From source file:edu.nps.moves.mmowgli.modules.actionplans.AddImageDialog.java
License:Open Source License
@SuppressWarnings("serial") @HibernateSessionThreadLocalConstructor/*from w w w . j a v a2s.c om*/ public AddImageDialog(Object apId) { super("Add an Image"); addStyleName("m-greybackground"); setClosable(false); // no x in corner VerticalLayout mainVL = new VerticalLayout(); mainVL.setSpacing(true); mainVL.setMargin(true); mainVL.setSizeUndefined(); // auto size setContent(mainVL); mainHL = new HorizontalLayout(); mainVL.addComponent(mainHL); mainHL.setSpacing(true); holder = new AbsoluteLayout(); mainHL.addComponent(holder); holder.setWidth("150px"); holder.setHeight("150px"); holder.addStyleName("m-darkgreyborder"); VerticalLayout rightVL = new VerticalLayout(); mainHL.addComponent(rightVL); fromWebCheck = new CheckBox(); fromWebCheck.addStyleName("v-radiobutton"); fromWebCheck.setValue(true); fromWebCheck.setImmediate(true); fromWebCheck.addValueChangeListener(new RadioListener(fromWebCheck)); HorizontalLayout frWebHL = new HorizontalLayout(); rightVL.addComponent(frWebHL); frWebHL.addComponent(fromWebCheck); VerticalLayout frWebVL = new VerticalLayout(); frWebVL.setMargin(true); frWebVL.addStyleName("m-greyborder"); frWebHL.addComponent(frWebVL); frWebVL.setWidth("370px"); frWebVL.addComponent(new Label("From the web:")); HorizontalLayout webHL = new HorizontalLayout(); webHL.setSpacing(true); frWebVL.addComponent(webHL); webHL.addComponent(webUrl = new TextField()); webUrl.setColumns(21); webHL.addComponent(testButt = new Button("Test")); Label sp; webHL.addComponent(sp = new Label()); sp.setWidth("1px"); webHL.setExpandRatio(sp, 1.0f); fromDeskCheck = new CheckBox(); fromDeskCheck.addStyleName("v-radiobutton"); fromDeskCheck.setValue(false); fromDeskCheck.addValueChangeListener(new RadioListener(fromDeskCheck)); fromDeskCheck.setImmediate(true); HorizontalLayout dtHL = new HorizontalLayout(); rightVL.addComponent(dtHL); dtHL.addComponent(fromDeskCheck); VerticalLayout dtopVL = new VerticalLayout(); dtopVL.setMargin(true); dtopVL.addStyleName("m-greyborder"); dtHL.addComponent(dtopVL); dtopVL.setWidth("370px"); dtopVL.addComponent(new Label("From your desktop:")); HorizontalLayout localHL = new HorizontalLayout(); localHL.setSpacing(true); dtopVL.addComponent(localHL); localHL.addComponent(localTF = new TextField()); localTF.setColumns(21); localHL.addComponent(uploadWidget = new Upload()); panel = new UploadStatus(uploadWidget); uploadWidget.setButtonCaption("Browse"); File tempDir = Files.createTempDir(); tempDir.deleteOnExit(); handler = new UploadHandler(uploadWidget, panel, tempDir.getAbsolutePath()); uploadWidget.setReceiver(handler); uploadWidget.setImmediate(true); panel.setWidth("100%"); dtopVL.addComponent(panel); dtopVL.setComponentAlignment(panel, Alignment.TOP_CENTER); HorizontalLayout bottomHL = new HorizontalLayout(); mainVL.addComponent(bottomHL); bottomHL.setSpacing(true); bottomHL.setWidth("100%"); Label spacer; bottomHL.addComponent(spacer = new Label()); spacer.setWidth("100%"); bottomHL.setExpandRatio(spacer, 1.0f); bottomHL.addComponent(cancelButt = new Button("Cancel")); bottomHL.addComponent(submitButt = new Button("Add")); setDisabledFields(); uploadWidget.addFinishedListener(new FinishedListener() { @Override public void uploadFinished(FinishedEvent event) { Object key = HSess.checkInit(); System.out.println("AddImageDialog.uploadFinished()"); String fpath = handler.getFullUploadedPath(); if (fpath != null) { // error of some kind if null if (!MalwareChecker.isFileVirusFree(fpath)) { panel.state.setValue("<span style='color:red;'>Failed malware check</span>"); fpath = null; localTF.setValue(""); HSess.checkClose(key); return; } File f = new File(fpath); f.deleteOnExit(); try { MediaImage mediaImage = InstallImageDialog.putFileImageIntoDbTL(f, f.getName(), event.getMIMEType()); f.delete(); media = mediaImage.media; image = mediaImage.image; media.setCaption(null); Resource res = Mmowgli2UI.getGlobals().getMediaLocator().locate(media); setupEmbeddedImageThumbnail(res, media); localTF.setValue(event.getFilename()); } catch (IOException ex) { Notification.show("Error loading image", Notification.Type.ERROR_MESSAGE); MSysOut.println(ERROR_LOGS, "Error in AddImageDialog loading image: " + ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage()); } } HSess.checkClose(key); } }); testButt.addClickListener(new testWebImageHandler()); submitButt.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { if (fromWebCheck.getValue()) { if (checkBadUrl(webUrl.getValue(), event.getButton())) return; } UI.getCurrent().removeWindow(AddImageDialog.this); if (closer != null) closer.windowClose(null); } }); cancelButt.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { Object key = HSess.checkInit(); if (media != null) { Media.deleteTL(media); media = null; } if (image != null) { Image.deleteTL(image); image = null; } uploadWidget.interruptUpload(); UI.getCurrent().removeWindow(AddImageDialog.this); if (closer != null) closer.windowClose(null); HSess.checkClose(key); } }); webUrl.focus(); }
From source file:edu.nps.moves.mmowgli.modules.actionplans.AddVideoDialog.java
License:Open Source License
@SuppressWarnings("serial") public AddVideoDialog() { super("Add a Video"); addStyleName("m-greybackground"); setClosable(false); // no x in corner setWidth("530px"); setHeight("400px"); VerticalLayout mainVL = new VerticalLayout(); mainVL.setSpacing(true);/*from ww w .j a va 2s . c o m*/ mainVL.setMargin(true); mainVL.setSizeUndefined(); // auto size mainVL.setWidth("100%"); setContent(mainVL); Label helpLab = new HtmlLabel("Add YouTube videos to your Action Plan this way:" + "<OL><LI>Find the video you want at <a href=\"https://www.youtube.com\" target=\"" + PORTALTARGETWINDOWNAME + "\">www.youtube.com</a>.</LI>" + "<LI>Click the \"share\" button below the video screen.</LI>" + "<LI>Copy the URL under \"Link to this video:\"</LI>" + "<LI>Paste the URL into the field below.</LI>" + "</OL>" + "If you have media that " + "has not been uploaded to YouTube, see <a href=\"https://www.youtube.com\" target=\"" + PORTALTARGETWINDOWNAME + "\">www.youtube.com</a> " + "for help with establishing a free account.<br/>"); helpLab.setWidth("100%"); mainVL.addComponent(helpLab); HorizontalLayout mainHL = new HorizontalLayout(); mainHL.setMargin(false); mainHL.setSpacing(true); mainVL.addComponent(mainHL); holder = new AbsoluteLayout(); mainHL.addComponent(holder); holder.addStyleName("m-darkgreyborder"); holder.setWidth("150px"); holder.setHeight("150px"); holder.addComponent(new Label("Test video display"), "top:0px;left:0px;"); VerticalLayout rightVL = new VerticalLayout(); mainHL.addComponent(rightVL); rightVL.setMargin(false); rightVL.setSpacing(true); rightVL.addComponent(new Label("YouTube video address")); HorizontalLayout tfHL = new HorizontalLayout(); tfHL.setSpacing(true); rightVL.addComponent(tfHL); addrTf = new TextField(); tfHL.addComponent(addrTf); addrTf.setColumns(21); tfHL.addComponent(testButt = new Button("Test")); rightVL.addComponent(new Label("Using the test button will set the")); rightVL.addComponent(new Label("default title and description.")); Label sp; rightVL.addComponent(sp = new Label()); sp.setHeight("15px"); HorizontalLayout bottomHL = new HorizontalLayout(); rightVL.addComponent(bottomHL); rightVL.setComponentAlignment(bottomHL, Alignment.TOP_RIGHT); bottomHL.setSpacing(true); bottomHL.setWidth("100%"); Label spacer; bottomHL.addComponent(spacer = new Label()); spacer.setWidth("100%"); bottomHL.setExpandRatio(spacer, 1.0f); bottomHL.addComponent(cancelButt = new Button("Cancel")); bottomHL.addComponent(submitButt = new Button("Add")); testButt.addClickListener(new TestVidHandler()); submitButt.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { UI.getCurrent().removeWindow(AddVideoDialog.this); if (closer != null) closer.windowClose(null); } }); cancelButt.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { media = null; UI.getCurrent().removeWindow(AddVideoDialog.this); if (closer != null) closer.windowClose(null); } }); }
From source file:edu.nps.moves.mmowgli.modules.actionplans.HelpWantedDialog.java
License:Open Source License
@SuppressWarnings("serial") @HibernateSessionThreadLocalConstructor/*from w w w. j av a 2 s . c om*/ public HelpWantedDialog(final Object aplnId, boolean interested) { setCaption(interested ? "Express Interest in Action Plan" : "Offer Assistance with Action Plan"); setModal(true); setSizeUndefined(); setWidth("500px"); setHeight("550px"); VerticalLayout vLay = new VerticalLayout(); setContent(vLay); vLay.setMargin(true); vLay.setSpacing(true); vLay.setSizeFull(); StringBuilder sb = new StringBuilder(); ActionPlan ap = ActionPlan.getTL(aplnId); String s = ap.getHelpWanted(); if (s != null) { vLay.addComponent(new Label(msg1)); Label helpWantedLab = new Label(s); helpWantedLab.addStyleName("m-helpWantedLabel"); helpWantedLab.setWidth("100%"); vLay.addComponent(helpWantedLab); } vLay.addComponent(new Label(msg2)); final TextArea toTA = new TextArea("To"); toTA.addStyleName("m-textareaboldcaption"); toTA.setWidth("100%"); toTA.setRows(1); toTA.setNullRepresentation(""); toTA.setValue(getAuthors(sb, ap)); vLay.addComponent(toTA); final TextArea ccTA = new TextArea("CC"); ccTA.addStyleName("m-textareaboldcaption"); ccTA.setWidth("100%"); ccTA.setRows(1); ccTA.setNullRepresentation(""); PagesData pd = new PagesData(); ccTA.setValue(pd.gettroubleMailto()); vLay.addComponent(ccTA); final TextArea subjTA = new TextArea("Subject"); subjTA.addStyleName("m-textareaboldcaption"); subjTA.setWidth("100%"); subjTA.setRows(2); subjTA.setNullRepresentation(""); sb.setLength(0); sb.append("My interest in Action Plan "); sb.append(ap.getId()); sb.append(", \""); sb.append(ap.getTitle()); sb.append('"'); subjTA.setValue(sb.toString()); vLay.addComponent(subjTA); final TextArea msgTA = new TextArea("Message"); msgTA.addStyleName("m-textareaboldcaption"); msgTA.setWidth("100%"); msgTA.setHeight("100%"); msgTA.setNullRepresentation(""); vLay.addComponent(msgTA); vLay.setExpandRatio(msgTA, 1.0f); HorizontalLayout buttLay = new HorizontalLayout(); vLay.addComponent(buttLay); buttLay.setSpacing(true); buttLay.setWidth("100%"); Label sp; buttLay.addComponent(sp = new Label()); sp.setHeight("1px"); buttLay.setExpandRatio(sp, 1.0f); Button canButt = new Button("Cancel"); buttLay.addComponent(canButt); Button sendButt = new Button("Send to authors"); buttLay.addComponent(sendButt); canButt.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { UI.getCurrent().removeWindow(HelpWantedDialog.this); } }); sendButt.addClickListener(new ClickListener() { @Override @MmowgliCodeEntry @HibernateOpened @HibernateClosed public void buttonClick(ClickEvent event) { Object tos = toTA.getValue(); if (tos == null || tos.toString().length() <= 0) { Notification.show("No recipients", Notification.Type.ERROR_MESSAGE); return; } Object cc = ccTA.getValue(); if (cc == null || cc.toString().length() <= 0) cc = null; Object msg = msgTA.getValue(); if (msg == null || msg.toString().length() <= 0) { Notification.show("No Message", Notification.Type.ERROR_MESSAGE); return; } Object subj = subjTA.getValue(); if (subj == null) subj = ""; HSess.init(); List<User> authors = parseAuthorsTL(tos.toString().trim()); MmowgliSessionGlobals globs = Mmowgli2UI.getGlobals(); MailManager mmgr = AppMaster.instance().getMailManager(); User me = globs.getUserTL(); for (User u : authors) { mmgr.mailToUserTL(me.getId(), u.getId(), subj.toString(), msg.toString()); } if (cc == null) mmgr.mailToUserTL(me.getId(), me.getId(), "(CC:)" + subj.toString(), msg.toString()); else mmgr.mailToUserTL(me.getId(), me.getId(), subj.toString(), msg.toString(), cc.toString(), MailManager.Channel.BOTH); // the cc is an email, not a user name UI.getCurrent().removeWindow(HelpWantedDialog.this); Notification.show("Message(s) sent", Notification.Type.HUMANIZED_MESSAGE); // fixed 21 Jan 2015 HSess.close(); } }); }
From source file:edu.nps.moves.mmowgli.modules.actionplans.RfeDialog.java
License:Open Source License
@HibernateSessionThreadLocalConstructor @SuppressWarnings("serial") public RfeDialog(Object aplnId) { this.apId = aplnId; setCaption("Request for Expertise"); setModal(true);// w w w . j a v a 2 s . c o m setSizeUndefined(); setWidth("500px"); setHeight("400px"); VerticalLayout vLay = new VerticalLayout(); setContent(vLay); vLay.setMargin(true); vLay.setSpacing(true); vLay.setSizeFull(); IDButton searchButt = new IDButton("Option 1: Search for players with needed expertise", SEARCHCLICK, null); searchButt.enableAction(false); // do manually searchButt.addClickListener(new SearchListener()); vLay.addComponent(searchButt); VerticalLayout nuts = new VerticalLayout(); vLay.addComponent(nuts); nuts.setSizeFull(); vLay.setExpandRatio(nuts, 1.0f); Label lab; /*vLay*/nuts.addComponent(lab = new Label("Option 2: Post help-wanted notice to action plan")); lab.addStyleName("m-font-bold11"); final VerticalLayout helpWantedPan = new VerticalLayout(); /*vLay*/nuts.addComponent(helpWantedPan); helpWantedPan.addStyleName("m-greyborder"); helpWantedPan.setWidth("99%"); helpWantedPan.setHeight("99%"); helpWantedPan.setSpacing(true); helpWantedPan.setMargin(true); /*vLay*/nuts.setExpandRatio(helpWantedPan, 1.0f); helpWantedTA = new TextArea("Current posting"); helpWantedTA.setWidth("100%"); helpWantedTA.setHeight("100%"); helpWantedTA.setNullRepresentation(""); helpWantedPan.addComponent(helpWantedTA); helpWantedPan.setExpandRatio(helpWantedTA, 1.0f); HorizontalLayout buttLay = new HorizontalLayout(); helpWantedPan.addComponent(buttLay); buttLay.setSpacing(true); buttLay.setWidth("100%"); buttLay.addComponent(lab = new Label()); lab.setWidth("10px"); clearButt = new Button("Clear"); buttLay.addComponent(clearButt); clearButt.addClickListener(clearButtLis = new ClickListener() { @Override @MmowgliCodeEntry @HibernateOpened @HibernateClosed public void buttonClick(ClickEvent event) { HSess.init(); ActionPlan ap = ActionPlan.getTL(apId); helpWantedTA.setValue(null); if (null != ap.getHelpWanted()) { ap.setHelpWanted(null); ActionPlan.updateTL(ap); Notification notif = new Notification("Cleared"); notif.setDelayMsec(3000); notif.show(Page.getCurrent()); GameEventLogger.logHelpWantedTL(ap); notifyAuthorsOfChangeTL(ap); } HSess.close(); } }); buttLay.addComponent(lab = new Label()); buttLay.setExpandRatio(lab, 1.0f); postButt = new Button("Post"); buttLay.addComponent(postButt); postButt.addClickListener(new ClickListener() { @Override @MmowgliCodeEntry @HibernateOpened @HibernateClosed public void buttonClick(ClickEvent event) { Object val = helpWantedTA.getValue(); if (val == null || val.toString().length() <= 0) { clearButtLis.buttonClick(event); return; } HSess.init(); String s = val.toString(); ActionPlan ap = ActionPlan.getTL(apId); if (s == null ? ap.getHelpWanted() != null : !s.equals(ap.getHelpWanted())) { ap.setHelpWanted(s); ActionPlan.updateTL(ap); Notification notif = new Notification("Posted"); notif.setDelayMsec(3000); notif.show(Page.getCurrent()); GameEventLogger.logHelpWantedTL(ap); notifyAuthorsOfChangeTL(ap); } HSess.close(); } }); buttLay.addComponent(lab = new Label()); lab.setWidth("10px"); helpWantedPan.addComponent(lab = new Label()); lab.setHeight("10px"); IDButton troubleButt = new IDButton("Option 3: Post Trouble Report", POSTTROUBLECLICK, null); troubleButt.enableAction(false); // managed manually troubleButt.addClickListener(new TroubleListener()); vLay.addComponent(troubleButt); Button closeButt = new Button("Close"); vLay.addComponent(closeButt); closeButt.addClickListener(new CloseListener()); vLay.setComponentAlignment(closeButt, Alignment.MIDDLE_RIGHT); ActionPlan ap = ActionPlan.getTL(apId); String s = ap.getHelpWanted(); helpWantedTA.setValue(s); }
From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java
License:Open Source License
public void initGuiTL() { tabSh.setHeight("100%"); tabSh.setWidth("930px"); HorizontalLayout topHL = new HorizontalLayout(); topHL.setSpacing(true);/* w w w.ja v a 2s .c om*/ topHL.setMargin(true); Label lab; topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.addComponent(lab = new Label("Round being edited:")); lab.setSizeUndefined(); topHL.addComponent(moveSelector = new MoveSelector(null)); moveSelector.addValueChangeListener(new MoveSelectorListener()); topHL.addComponent( runningMoveWarningLabel = new HtmlLabel("<font color='red'><i>Active game round!</i></font>")); runningMoveWarningLabel.setSizeUndefined(); runningMoveWarningLabel.setVisible(AbstractGameBuilderPanel.isRunningMoveTL(moveBeingEdited)); topHL.addComponent(newMoveButt = new NativeButton("Add new round to game", new NewMoveListener())); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.setWidth("100%"); addComponent(topHL); addComponent(lab = new Label("The currently active round is set through the Game Administrator menu")); lab.setSizeUndefined(); setComponentAlignment(lab, Alignment.TOP_CENTER); tabSh.addTab(titlesPan, "Game Titles"); tabSh.addTab(topCardsPan, "Top Card Types"); tabSh.addTab(subCardsPan, "Sub Card Types"); //tabSh.addTab(seedCardsPan, "Seed Card Initialization"); tabSh.addTab(chaptersPan, "Action Plan Headings"); addComponent(tabSh); titlesPan.initGui(); topCardsPan.initGui(); subCardsPan.initGui(); //seedCardsPan.initGui(); chaptersPan.initGui(); moveSelector.setMove(Game.getTL().getCurrentMove()); }
From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java
License:Open Source License
@SuppressWarnings("serial") @HibernateSessionThreadLocalConstructor//from w w w . j av a 2 s . c om public PhasesEditPanel(Move move, GameDesignGlobals globs) { this.moveBeingEdited = move; setWidth("100%"); setSpacing(true); phaseBeingEdited = moveBeingEdited.getCurrentMovePhase(); tabSh = new TabSheet(); tabPanels.add(titlePan = new PhaseTitlesGameDesignPanel(phaseBeingEdited, auxListener, globs)); tabPanels.add(signupPan = new SignupHTMLGameDesignPanel(phaseBeingEdited, auxListener, globs)); tabPanels.add(loginPan = new LoginSignupGameDesignPanel(phaseBeingEdited, auxListener, globs)); tabPanels.add(welcomePan = new WelcomeScreenGameDesignPanel(phaseBeingEdited, auxListener, globs)); tabPanels.add(call2ActionPan = new CallToActionGameDesignPanel(phaseBeingEdited, auxListener, globs)); Label lab; addComponent(lab = new Label()); lab.setHeight("5px"); HorizontalLayout topHL = new HorizontalLayout(); topHL.setSpacing(true); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.addComponent(topLevelLabel = new Label()); setTopLabelText(moveBeingEdited); topLevelLabel.setSizeUndefined(); topHL.addComponent(phaseSelector = new PhaseSelector(null, Move.getCurrentMoveTL())); phaseSelector.addValueChangeListener(new PhaseComboListener()); topHL.addComponent( runningPhaseWarningLabel = new HtmlLabel("<font color='red'><i>Active game phase!</i></font>")); runningPhaseWarningLabel.setSizeUndefined(); runningPhaseWarningLabel.setVisible(AbstractGameBuilderPanel.isRunningPhaseTL(phaseBeingEdited)); topHL.addComponent(newPhaseButt = new NativeButton("Add new phase to round")); newPhaseButt.setEnabled(false); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.setWidth("100%"); addComponent(topHL); propagateCB = new CheckBox("Propagate new phase-dependent edits to all other phases in this round"); addComponent(propagateCB); setComponentAlignment(propagateCB, Alignment.MIDDLE_CENTER); propagateCB.setVisible(phaseBeingEdited.isPreparePhase()); addComponent(lab = new HtmlLabel( "<b>The currently running phase is set through the Game Administrator menu</b>")); lab.setSizeUndefined(); setComponentAlignment(lab, Alignment.TOP_CENTER); newPhaseButt.addClickListener(new ClickListener() { @Override @MmowgliCodeEntry @HibernateOpened @HibernateClosed public void buttonClick(ClickEvent event) { HSess.init(); NewMovePhaseDialog dial = new NewMovePhaseDialog(moveBeingEdited); dial.addCloseListener(new CloseListener() { @Override public void windowClose(CloseEvent e) { Object key = HSess.checkInit(); phaseSelector.fillCombo(moveBeingEdited); HSess.checkClose(key); } }); dial.showDialog(); HSess.close(); } }); }
From source file:edu.nps.moves.mmowgli.modules.administration.NewMovePhaseDialog.java
License:Open Source License
@SuppressWarnings("serial") public NewMovePhaseDialog(Move move) { super("Make a new Phase for " + move.getName()); this.moveBeingEdited = Move.getTL(move.getId()); setSizeUndefined();//from ww w. ja v a 2 s . co m setWidth("390px"); VerticalLayout vLay; setContent(vLay = new VerticalLayout()); vLay.setSpacing(true); vLay.setMargin(true); vLay.addComponent(new Label("Choose a descriptive name for this phase. Suggested names are shown in the " + "drop down list, but any text is permitted.")); descriptionCB = new ComboBox("Phase description"); vLay.addComponent(descriptionCB); fillCombo(descriptionCB); descriptionCB.setInputPrompt("Choose suggested description, or enter text"); descriptionCB.setWidth("350px"); descriptionCB.setImmediate(true); descriptionCB.setNullSelectionAllowed(false); descriptionCB.setTextInputAllowed(true); descriptionCB.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { // final String valueString = String.valueOf(event.getProperty().getValue()); // Notification.show("Value changed:", valueString, // Type.TRAY_NOTIFICATION); } }); vLay.addComponent(existingPhasesGLay = new GridLayout()); existingPhasesGLay.setColumns(3); existingPhasesGLay.setRows(1); // to start existingPhasesGLay.setSpacing(true); existingPhasesGLay.addStyleName("m-greyborder"); existingPhasesGLay.setCaption("Existing Phases"); fillExistingPhases(); HorizontalLayout buttHLay; vLay.addComponent(buttHLay = new HorizontalLayout()); buttHLay.setWidth("100%"); buttHLay.setSpacing(true); Label lab; buttHLay.addComponent(lab = new Label()); lab.setWidth("1px"); buttHLay.setExpandRatio(lab, 1.0f); buttHLay.addComponent(cancelButt = new Button("Cancel", saveCancelListener)); buttHLay.addComponent(saveButt = new Button("Save", saveCancelListener)); }
From source file:edu.nps.moves.mmowgli.modules.administration.ScoringGameDesignPanel.java
License:Open Source License
@Override protected Component getFooter() { HorizontalLayout hlay = new HorizontalLayout(); Label sp;//from www .j av a2 s .c o m hlay.addComponent(sp = new Label()); sp.setWidth("1px"); hlay.setExpandRatio(sp, 0.5f); Button butt = new Button("Click for scoring help and examples", new HelpListener()); hlay.addComponent(butt); hlay.addComponent(sp = new Label()); sp.setWidth("1px"); hlay.setExpandRatio(sp, 0.5f); hlay.setWidth("100%"); return hlay; }
From source file:edu.nps.moves.mmowgli.modules.administration.SignupHTMLGameDesignPanel.java
License:Open Source License
private AbstractComponent makeButton(String s, ClickListener lis) { HorizontalLayout hl = new HorizontalLayout(); hl.setWidth("100%"); Button b;//from w ww . j av a2s . co m hl.addComponent(b = new Button(s, lis)); hl.setComponentAlignment(b, Alignment.MIDDLE_CENTER); return hl; }
From source file:edu.nps.moves.mmowgli.modules.administration.SubCardsGameDesignPanel.java
License:Open Source License
private Component renderFields(CardTypeFields fields, NativeSelect combo, String name) { VerticalLayout topPan = new VerticalLayout(); topPan.setWidth("98%"); topPan.addStyleName("m-greyborder3"); Label lab;/*from ww w. java 2 s . c o m*/ topPan.addComponent(lab = new Label()); lab.setHeight("18px"); HorizontalLayout topHL = new HorizontalLayout(); topHL.setSpacing(true); ; topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.addComponent(lab = new HtmlLabel("<b>" + name + "</b>")); lab.setSizeUndefined(); topHL.addComponent(combo); Button newTypeButt; topHL.addComponent(newTypeButt = new NativeButton("Define new type")); newTypeButt.addStyleName(Runo.BUTTON_SMALL); newTypeButt.setReadOnly(globs.readOnlyCheck(false)); newTypeButt.setEnabled(!newTypeButt.isReadOnly()); if (!newTypeButt.isReadOnly()) newTypeButt.addClickListener(new NewTypeListener(fields.typeOrdinal)); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topPan.addComponent(topHL); topHL.setWidth("100%"); topPan.addComponent(fields); fields.setWidth("100%"); return topPan; }