List of usage examples for com.vaadin.ui Image Image
public Image(String caption, Resource source)
From source file:de.fatalix.lighty.web.component.LightyHeader.java
public LightyHeader() { addStyleName(LightyTheme.HEADER_BACKGROUND); setWidth(100, Unit.PERCENTAGE);// w w w . j a v a2s . c o m Image image = new Image(null, new ThemeResource("img/lighty-icon.png")); image.setWidth(64, Unit.PIXELS); image.setHeight(64, Unit.PIXELS); Label headerTitle = new Label("Lighty App"); headerTitle.addStyleName(LightyLabels.TITLE_CAPTION); addComponents(image, headerTitle); setExpandRatio(headerTitle, 1.0f); setComponentAlignment(headerTitle, Alignment.MIDDLE_LEFT); }
From source file:de.kaiserpfalzEdv.office.ui.web.widgets.about.AboutPanel.java
License:Apache License
@PostConstruct public void init() { Image logo = new Image(null, new ThemeResource("../images/lichti-wappen.png")); logo.setId("about-logo"); logo.setAlternateText("Logo: Kaiserpfalz EDV-Service"); logo.setWidth(150f, Unit.PIXELS);/* w w w. j a v a2s . co m*/ logo.setHeight(170f, Unit.PIXELS); logo.setCaption("Kaiserpfalz EDV-Service"); addComponent(logo); setComponentAlignment(logo, Alignment.MIDDLE_CENTER); Label name = new Label( "<div style='text-align: center;'><b>" + application.get(ApplicationMetaData.APPLICATION_NAME) + "</b>" + "<br/>" + "<i><small>Version " + application.get(ApplicationMetaData.APPLICATION_VERSION) + "</small></i></div>", ContentMode.HTML); name.setWidth(200f, Unit.PIXELS); addComponent(name); setComponentAlignment(name, Alignment.MIDDLE_CENTER); addComponent(new Label("")); addComponent(new Label("License: " + license.getId())); addComponent(new Label("Licensee: " + license.getLicensee())); addComponent(new Label("")); addComponent(new Label("Issued: " + license.getIssueDate())); addComponent(new Label("Issuer: " + license.getIssuer())); addComponent(new Label("")); addComponent(new Label("Valid (Time): " + license.getStart() + " - " + license.getExpiry())); addComponent(new Label("Valid (Version): " + license.getVersionRange().getStart() + " - " + license.getVersionRange().getEnd())); LOG.trace("Initialized: {}", this); LOG.trace(" application: {}", application); LOG.trace(" license: {}", license); }
From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java
License:Apache License
private void initalizeOverview() { overviewLayout = createGridLayout(2, 3); overviewLayout.setHeight(300f, PIXELS); overviewLayout.setWidth(100f, PERCENTAGE); overviewLayout.setColumnExpandRatio(0, 70f); overviewLayout.setColumnExpandRatio(1, 30f); overviewLayout.setRowExpandRatio(0, 33f); overviewLayout.setRowExpandRatio(1, 33f); overviewLayout.setRowExpandRatio(2, 33f); Image logo = new Image("", new ThemeResource("img/logo.png")); logo.setHeight(300f, PIXELS);// w w w .jav a 2 s. co m logo.setWidth(300f, PIXELS); overviewLayout.addComponent(logo, 0, 0, 0, 2); overviewLayout.addComponent(createOverviewLabel("about.application"), 1, 0); overviewLayout.addComponent(createOverviewLabel("about.version"), 1, 1); overviewLayout.addComponent(createManufactorLabel("about.manufactor"), 1, 2); mainLayout.addComponent(overviewLayout); }
From source file:de.kaiserpfalzEdv.vaadin.menu.impl.MenuImpl.java
License:Apache License
@Inject public MenuImpl(final Authenticator accessControl, final EventBus bus, final I18NHandler i18n, final List<View> allViews) { this.accessControl = accessControl; this.bus = bus; this.i18n = i18n; this.allViews = allViews; setPrimaryStyleName(ValoTheme.MENU_ROOT); menuPart = new CssLayout(); menuPart.addStyleName(ValoTheme.MENU_PART); // header of the menu final HorizontalLayout top = new HorizontalLayout(); top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); top.addStyleName(ValoTheme.MENU_TITLE); top.setSpacing(true);//from ww w .j a v a2 s . c om Label title = new Label(translate("application.name")); title.addStyleName(ValoTheme.LABEL_H3); title.setSizeUndefined(); Image image = new Image(null, new ThemeResource("img/table-logo.png")); image.setStyleName("logo"); top.addComponent(image); top.addComponent(title); menuPart.addComponent(top); // logout menu item MenuBar logoutMenu = new MenuBar(); logoutMenu.addItem(translate("button.logout.caption"), FontAwesome.valueOf(translate("button.logout.icon")), selectedItem -> { VaadinSession.getCurrent().getSession().invalidate(); Page.getCurrent().reload(); }); logoutMenu.addStyleName("user-menu"); menuPart.addComponent(logoutMenu); // button for toggling the visibility of the menu when on a small screen final Button showMenu = new Button(translate("application.name"), new ClickListener() { @Override public void buttonClick(final ClickEvent event) { if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) { menuPart.removeStyleName(VALO_MENU_VISIBLE); } else { menuPart.addStyleName(VALO_MENU_VISIBLE); } } }); showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenu.addStyleName(ValoTheme.BUTTON_SMALL); showMenu.addStyleName(VALO_MENU_TOGGLE); showMenu.setIcon(FontAwesome.NAVICON); menuPart.addComponent(showMenu); // container for the navigation buttons, which are added by addView() menuItemsLayout = new CssLayout(); menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS); menuPart.addComponent(menuItemsLayout); addComponent(menuPart); }
From source file:de.metas.procurement.webui.ui.view.LoginView.java
License:Open Source License
public LoginView() { super();/* w w w .jav a2 s. c om*/ Application.autowire(this); addStyleName(STYLE); // // Content { final VerticalComponentGroup content = new VerticalComponentGroup(); final Resource logoResource = getLogoResource(); final Image logo = new Image(null, logoResource); logo.addStyleName(STYLE_Logo); content.addComponent(logo); this.email = new EmailField(i18n.get("LoginView.fields.email")); email.addStyleName(STYLE_LoginEmail); email.setIcon(FontAwesome.USER); content.addComponent(email); this.password = new PasswordField(i18n.get("LoginView.fields.password")); password.addStyleName(STYLE_LoginPassword); password.setIcon(FontAwesome.LOCK); content.addComponent(password); final Button loginButton = new Button(i18n.get("LoginView.fields.loginButton")); loginButton.addStyleName(STYLE_LoginButton); loginButton.setClickShortcut(KeyCode.ENTER); loginButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { onUserLogin(email.getValue(), password.getValue()); } }); final Button forgotPasswordButton = new Button(i18n.get("LoginView.fields.forgotPasswordButton")); forgotPasswordButton.setStyleName(STYLE_ForgotPasswordButton); forgotPasswordButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { onForgotPassword(email.getValue()); } }); final CssLayout contentWrapper = new CssLayout(content, loginButton, forgotPasswordButton); contentWrapper.addStyleName(STYLE_LoginFormWrapper); setContent(contentWrapper); } // // Bottom: { // // Powered-by logo resource // Use the configured one if any; fallback to default embedded powered-by logo final Resource poweredByLogoResource; if (poweredByLogoUrl != null && !poweredByLogoUrl.trim().isEmpty()) { poweredByLogoResource = new ExternalResource(poweredByLogoUrl.trim()); } else { poweredByLogoResource = Constants.RESOURCE_PoweredBy; } // // Powered-by component: final Component poweredByComponent; if (poweredByLinkUrl != null && !poweredByLinkUrl.trim().isEmpty()) { final Link link = new Link(); link.setIcon(poweredByLogoResource); link.setResource(new ExternalResource(poweredByLinkUrl.trim())); link.setTargetName("_blank"); poweredByComponent = link; } else { final Image image = new Image(null, poweredByLogoResource); poweredByComponent = image; } // poweredByComponent.addStyleName(STYLE_PoweredBy); setToolbar(poweredByComponent); } }
From source file:de.symeda.sormas.ui.caze.CaseDataForm.java
License:Open Source License
@Override protected void addFields() { if (person == null || disease == null) { return;//from w w w .j a v a 2 s.c om } // Add fields addFields(CaseDataDto.UUID, CaseDataDto.REPORT_DATE, CaseDataDto.REPORTING_USER, CaseDataDto.DISTRICT_LEVEL_DATE, CaseDataDto.REGION_LEVEL_DATE, CaseDataDto.NATIONAL_LEVEL_DATE, CaseDataDto.CLASSIFICATION_DATE, CaseDataDto.CLASSIFICATION_USER, CaseDataDto.CLASSIFICATION_COMMENT, CaseDataDto.NOTIFYING_CLINIC, CaseDataDto.NOTIFYING_CLINIC_DETAILS, CaseDataDto.CLINICIAN_NAME, CaseDataDto.CLINICIAN_PHONE, CaseDataDto.CLINICIAN_EMAIL); // Button to automatically assign a new epid number Button assignNewEpidNumberButton = new Button( I18nProperties.getCaption(Captions.actionAssignNewEpidNumber)); CssStyles.style(assignNewEpidNumberButton, ValoTheme.BUTTON_PRIMARY, CssStyles.FORCE_CAPTION); getContent().addComponent(assignNewEpidNumberButton, ASSIGN_NEW_EPID_NUMBER_LOC); assignNewEpidNumberButton.setVisible(false); TextField epidField = addField(CaseDataDto.EPID_NUMBER, TextField.class); epidField.setInvalidCommitted(true); CssStyles.style(epidField, CssStyles.ERROR_COLOR_PRIMARY); assignNewEpidNumberButton.addClickListener(e -> { epidField.setValue(FacadeProvider.getCaseFacade().generateEpidNumber(getValue().toReference())); }); addField(CaseDataDto.CASE_CLASSIFICATION, OptionGroup.class); addField(CaseDataDto.INVESTIGATION_STATUS, OptionGroup.class); addField(CaseDataDto.OUTCOME, OptionGroup.class); addField(CaseDataDto.SEQUELAE, OptionGroup.class); addFields(CaseDataDto.INVESTIGATED_DATE, CaseDataDto.OUTCOME_DATE, CaseDataDto.SEQUELAE_DETAILS); ComboBox diseaseField = addDiseaseField(CaseDataDto.DISEASE, false); addField(CaseDataDto.DISEASE_DETAILS, TextField.class); addField(CaseDataDto.PLAGUE_TYPE, OptionGroup.class); addField(CaseDataDto.DENGUE_FEVER_TYPE, OptionGroup.class); addField(CaseDataDto.CASE_ORIGIN, TextField.class); TextField healthFacilityDetails = addField(CaseDataDto.HEALTH_FACILITY_DETAILS, TextField.class); addField(CaseDataDto.REGION, ComboBox.class); addField(CaseDataDto.DISTRICT, ComboBox.class); addField(CaseDataDto.COMMUNITY, ComboBox.class); addField(CaseDataDto.HEALTH_FACILITY, ComboBox.class); ComboBox surveillanceOfficerField = addField(CaseDataDto.SURVEILLANCE_OFFICER, ComboBox.class); surveillanceOfficerField.setNullSelectionAllowed(true); addField(CaseDataDto.POINT_OF_ENTRY, ComboBox.class); addField(CaseDataDto.POINT_OF_ENTRY_DETAILS, TextField.class); addFields(CaseDataDto.PREGNANT, CaseDataDto.VACCINATION, CaseDataDto.VACCINATION_DOSES, CaseDataDto.VACCINATION_INFO_SOURCE, CaseDataDto.SMALLPOX_VACCINATION_SCAR, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED, CaseDataDto.VACCINATION_DATE); // Set initial visibilities initializeVisibilitiesAndAllowedVisibilities(disease, viewMode); // Set requirements that don't need visibility changes and read only status setRequired(true, CaseDataDto.REPORT_DATE, CaseDataDto.CASE_CLASSIFICATION, CaseDataDto.INVESTIGATION_STATUS, CaseDataDto.OUTCOME, CaseDataDto.DISEASE); setSoftRequired(true, CaseDataDto.INVESTIGATED_DATE, CaseDataDto.OUTCOME_DATE, CaseDataDto.PLAGUE_TYPE, CaseDataDto.SURVEILLANCE_OFFICER); FieldHelper.setReadOnlyWhen(getFieldGroup(), CaseDataDto.INVESTIGATED_DATE, CaseDataDto.INVESTIGATION_STATUS, Arrays.asList(InvestigationStatus.PENDING), false); setReadOnly(true, CaseDataDto.UUID, CaseDataDto.REPORTING_USER, CaseDataDto.CLASSIFICATION_USER, CaseDataDto.CLASSIFICATION_DATE, CaseDataDto.REGION, CaseDataDto.DISTRICT, CaseDataDto.COMMUNITY, CaseDataDto.HEALTH_FACILITY, CaseDataDto.HEALTH_FACILITY_DETAILS, CaseDataDto.POINT_OF_ENTRY, CaseDataDto.POINT_OF_ENTRY_DETAILS, CaseDataDto.CASE_ORIGIN); setReadOnly(!UserProvider.getCurrent().hasUserRight(UserRight.CASE_CHANGE_DISEASE), CaseDataDto.DISEASE); setReadOnly(!UserProvider.getCurrent().hasUserRight(UserRight.CASE_INVESTIGATE), CaseDataDto.INVESTIGATION_STATUS, CaseDataDto.INVESTIGATED_DATE); setReadOnly(!UserProvider.getCurrent().hasUserRight(UserRight.CASE_CLASSIFY), CaseDataDto.CASE_CLASSIFICATION, CaseDataDto.OUTCOME, CaseDataDto.OUTCOME_DATE); // Set conditional visibilities - ALWAYS call isVisibleAllowed before // dynamically setting the visibility if (isVisibleAllowed(CaseDataDto.PREGNANT)) { setVisible(person.getSex() == Sex.FEMALE, CaseDataDto.PREGNANT); } if (isVisibleAllowed(CaseDataDto.VACCINATION_DOSES)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.VACCINATION_DOSES, CaseDataDto.VACCINATION, Arrays.asList(Vaccination.VACCINATED), true); } if (isVisibleAllowed(CaseDataDto.VACCINATION_INFO_SOURCE)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.VACCINATION_INFO_SOURCE, CaseDataDto.VACCINATION, Arrays.asList(Vaccination.VACCINATED), true); } if (isVisibleAllowed(CaseDataDto.DISEASE_DETAILS)) { FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(CaseDataDto.DISEASE_DETAILS), CaseDataDto.DISEASE, Arrays.asList(Disease.OTHER), true); FieldHelper.setRequiredWhen(getFieldGroup(), CaseDataDto.DISEASE, Arrays.asList(CaseDataDto.DISEASE_DETAILS), Arrays.asList(Disease.OTHER)); } if (isVisibleAllowed(CaseDataDto.PLAGUE_TYPE)) { FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(CaseDataDto.PLAGUE_TYPE), CaseDataDto.DISEASE, Arrays.asList(Disease.PLAGUE), true); } if (isVisibleAllowed(CaseDataDto.SMALLPOX_VACCINATION_SCAR)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.SMALLPOX_VACCINATION_SCAR, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED, Arrays.asList(YesNoUnknown.YES), true); } if (isVisibleAllowed(CaseDataDto.VACCINATION_DATE)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.VACCINATION_DATE, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED, Arrays.asList(YesNoUnknown.YES), true); FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.VACCINATION_DATE, CaseDataDto.VACCINATION, Arrays.asList(Vaccination.VACCINATED), true); } if (isVisibleAllowed(CaseDataDto.OUTCOME_DATE)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.OUTCOME_DATE, CaseDataDto.OUTCOME, Arrays.asList(CaseOutcome.DECEASED, CaseOutcome.RECOVERED, CaseOutcome.UNKNOWN), true); } if (isVisibleAllowed(CaseDataDto.SEQUELAE)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.SEQUELAE, CaseDataDto.OUTCOME, Arrays.asList(CaseOutcome.RECOVERED, CaseOutcome.UNKNOWN), true); } if (isVisibleAllowed(CaseDataDto.SEQUELAE_DETAILS)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.SEQUELAE_DETAILS, CaseDataDto.SEQUELAE, Arrays.asList(YesNoUnknown.YES), true); } if (isVisibleAllowed(CaseDataDto.NOTIFYING_CLINIC_DETAILS)) { FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.NOTIFYING_CLINIC_DETAILS, CaseDataDto.NOTIFYING_CLINIC, Arrays.asList(HospitalWardType.OTHER), true); } setVisible(UserProvider.getCurrent().hasUserRight(UserRight.CASE_MANAGEMENT_ACCESS), CaseDataDto.CLINICIAN_NAME, CaseDataDto.CLINICIAN_PHONE, CaseDataDto.CLINICIAN_EMAIL); // Other initializations if (disease == Disease.MONKEYPOX) { Image smallpoxVaccinationScarImg = new Image(null, new ThemeResource("img/smallpox-vaccination-scar.jpg")); CssStyles.style(smallpoxVaccinationScarImg, CssStyles.VSPACE_3); getContent().addComponent(smallpoxVaccinationScarImg, SMALLPOX_VACCINATION_SCAR_IMG); // Set up initial image visibility getContent().getComponent(SMALLPOX_VACCINATION_SCAR_IMG).setVisible(getFieldGroup() .getField(CaseDataDto.SMALLPOX_VACCINATION_RECEIVED).getValue() == YesNoUnknown.YES); // Set up image visibility listener getFieldGroup().getField(CaseDataDto.SMALLPOX_VACCINATION_RECEIVED).addValueChangeListener(e -> { getContent().getComponent(SMALLPOX_VACCINATION_SCAR_IMG) .setVisible(e.getProperty().getValue() == YesNoUnknown.YES); }); } List<String> medicalInformationFields = Arrays.asList(CaseDataDto.PREGNANT, CaseDataDto.VACCINATION, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED); for (String medicalInformationField : medicalInformationFields) { if (getFieldGroup().getField(medicalInformationField).isVisible()) { Label medicalInformationCaptionLabel = new Label( I18nProperties.getString(Strings.headingMedicalInformation)); medicalInformationCaptionLabel.addStyleName(CssStyles.H3); getContent().addComponent(medicalInformationCaptionLabel, MEDICAL_INFORMATION_LOC); break; } } Label paperFormDatesLabel = new Label(I18nProperties.getString(Strings.headingPaperFormDates)); paperFormDatesLabel.addStyleName(CssStyles.H3); getContent().addComponent(paperFormDatesLabel, PAPER_FORM_DATES_LOC); // Automatic case classification rules button - invisible for other diseases if (disease != Disease.OTHER) { Button classificationRulesButton = new Button(I18nProperties.getCaption(Captions.info), VaadinIcons.INFO_CIRCLE); CssStyles.style(classificationRulesButton, ValoTheme.BUTTON_PRIMARY, CssStyles.FORCE_CAPTION); classificationRulesButton.addClickListener(e -> { ControllerProvider.getCaseController().openClassificationRulesPopup(getValue()); }); getContent().addComponent(classificationRulesButton, CLASSIFICATION_RULES_LOC); } addValueChangeListener(e -> { diseaseField.addValueChangeListener(new DiseaseChangeListener(diseaseField, getValue().getDisease())); // Replace classification user if case has been automatically classified if (getValue().getClassificationDate() != null && getValue().getClassificationUser() == null) { getField(CaseDataDto.CLASSIFICATION_USER).setVisible(false); Label classifiedBySystemLabel = new Label(I18nProperties.getCaption(Captions.system)); classifiedBySystemLabel.setCaption( I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.CLASSIFIED_BY)); getContent().addComponent(classifiedBySystemLabel, CLASSIFIED_BY_SYSTEM_LOC); } setEpidNumberError(epidField, assignNewEpidNumberButton, getValue().getEpidNumber()); epidField.addValueChangeListener(f -> { setEpidNumberError(epidField, assignNewEpidNumberButton, (String) f.getProperty().getValue()); }); // Set health facility details visibility and caption if (getValue().getHealthFacility() != null) { boolean otherHealthFacility = getValue().getHealthFacility().getUuid() .equals(FacilityDto.OTHER_FACILITY_UUID); boolean noneHealthFacility = getValue().getHealthFacility().getUuid() .equals(FacilityDto.NONE_FACILITY_UUID); boolean detailsVisible = otherHealthFacility || noneHealthFacility; if (isVisibleAllowed(healthFacilityDetails)) { healthFacilityDetails.setVisible(detailsVisible); } if (otherHealthFacility) { healthFacilityDetails.setCaption(I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.HEALTH_FACILITY_DETAILS)); } if (noneHealthFacility) { healthFacilityDetails.setCaption( I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, NONE_HEALTH_FACILITY_DETAILS)); } } else { setVisible(false, CaseDataDto.CLINICIAN_NAME, CaseDataDto.CLINICIAN_PHONE, CaseDataDto.CLINICIAN_EMAIL); } // Set health facility/point of entry visibility based on case origin if (getValue().getCaseOrigin() == CaseOrigin.POINT_OF_ENTRY) { setVisible(true, CaseDataDto.POINT_OF_ENTRY); setVisible(getValue().getPointOfEntry().isOtherPointOfEntry(), CaseDataDto.POINT_OF_ENTRY_DETAILS); if (getValue().getHealthFacility() == null) { setVisible(false, CaseDataDto.COMMUNITY, CaseDataDto.HEALTH_FACILITY, CaseDataDto.HEALTH_FACILITY_DETAILS); } } else { setVisible(false, CaseDataDto.POINT_OF_ENTRY, CaseDataDto.POINT_OF_ENTRY_DETAILS); } // Hide case origin from port health users if (UserRole.isPortHealthUser(UserProvider.getCurrent().getUserRoles())) { setVisible(false, CaseDataDto.CASE_ORIGIN); } }); }
From source file:de.symeda.sormas.ui.dashboard.map.DashboardMapComponent.java
License:Open Source License
public static HorizontalLayout buildMapIconLegendEntry(String iconName, String labelCaption) { Image icon = new Image(null, new ExternalResource("VAADIN/map/marker/" + iconName + ".png")); icon.setWidth(12.375f, Unit.PIXELS); icon.setHeight(16.875f, Unit.PIXELS); return buildLegendEntry(icon, labelCaption); }
From source file:de.symeda.sormas.ui.importer.ImportProgressLayout.java
License:Open Source License
private void initializeInfoComponents() { progressCircle = new ProgressBar(); progressCircle.setIndeterminate(true); CssStyles.style(progressCircle, "v-progressbar-indeterminate-large"); errorIcon = new Image(null, new ThemeResource("img/error-icon.png")); errorIcon.setHeight(35, Unit.PIXELS); errorIcon.setWidth(35, Unit.PIXELS); successIcon = new Image(null, new ThemeResource("img/success-icon.png")); successIcon.setHeight(35, Unit.PIXELS); successIcon.setWidth(35, Unit.PIXELS); warningIcon = new Image(null, new ThemeResource("img/warning-icon.png")); warningIcon.setHeight(35, Unit.PIXELS); warningIcon.setWidth(35, Unit.PIXELS); }
From source file:de.symeda.sormas.ui.login.LoginScreen.java
License:Open Source License
private CssLayout buildLoginInformation() { CssLayout loginInformation = new CssLayout(); loginInformation.setStyleName("login-information"); VerticalLayout innerLayout = new VerticalLayout(); innerLayout.setSizeFull();/*from w w w .j a va 2 s . c o m*/ Image img = new Image(null, new ThemeResource("img/sormas-logo-big.png")); img.setHeight(240, Unit.PIXELS); innerLayout.addComponent(img); innerLayout.setComponentAlignment(img, Alignment.TOP_CENTER); innerLayout.setExpandRatio(img, 0); Label loginInfoText = new Label("<h1>SORMAS</h1>" + "<h2 style='color:white'>Surveillance, Outbreak Response Management and Analysis System</h2>" + "<h3 style='color:white; text-transform:uppercase'>● Disease Prevention<br>● Disease Detection<br>● Outbreak Response</h3>", ContentMode.HTML); loginInfoText.setWidth(100, Unit.PERCENTAGE); innerLayout.addComponent(loginInfoText); innerLayout.setExpandRatio(loginInfoText, 1); Label loginInfoCopyright = new Label(" 2019 SORMAS. All Rights Reserved."); loginInfoCopyright.setWidth(100, Unit.PERCENTAGE); innerLayout.addComponent(loginInfoCopyright); innerLayout.setExpandRatio(loginInfoCopyright, 0); innerLayout.setComponentAlignment(loginInfoCopyright, Alignment.BOTTOM_LEFT); loginInformation.addComponent(innerLayout); return loginInformation; }
From source file:de.symeda.sormas.ui.Menu.java
License:Open Source License
public Menu(Navigator navigator) { this.navigator = navigator; setPrimaryStyleName(ValoTheme.MENU_ROOT); menuPart = new CssLayout(); menuPart.addStyleName(ValoTheme.MENU_PART); // header of the menu final HorizontalLayout top = new HorizontalLayout(); top.setDefaultComponentAlignment(Alignment.TOP_CENTER); top.addStyleName(ValoTheme.MENU_TITLE); top.setSpacing(true);/*from w ww .j a v a2s .c om*/ Label title = new Label("SORMAS"); title.setSizeUndefined(); Image image = new Image(null, new ThemeResource("img/sormas-logo.png")); CssStyles.style(image, ValoTheme.MENU_LOGO, ValoTheme.BUTTON_LINK); image.addClickListener(new MouseEvents.ClickListener() { @Override public void click(MouseEvents.ClickEvent event) { SormasUI.get().getNavigator().navigateTo(SurveillanceDashboardView.VIEW_NAME); } }); top.addComponent(image); top.addComponent(title); menuPart.addComponent(top); // logout menu item MenuBar logoutMenu = new MenuBar(); logoutMenu.addItem(I18nProperties.getCaption(Captions.actionLogout) + " (" + UserProvider.getCurrent().getUserName() + ")", VaadinIcons.SIGN_OUT, new Command() { @Override public void menuSelected(MenuItem selectedItem) { LoginHelper.logout(); } }); logoutMenu.addStyleName("user-menu"); menuPart.addComponent(logoutMenu); // button for toggling the visibility of the menu when on a small screen final Button showMenu = new Button(I18nProperties.getCaption(Captions.menu), new Button.ClickListener() { @Override public void buttonClick(final Button.ClickEvent event) { if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) { menuPart.removeStyleName(VALO_MENU_VISIBLE); } else { menuPart.addStyleName(VALO_MENU_VISIBLE); } } }); showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenu.addStyleName(VALO_MENU_TOGGLE); showMenu.setIcon(VaadinIcons.MENU); menuPart.addComponent(showMenu); // container for the navigation buttons, which are added by addView() menuItemsLayout = new CssLayout(); menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS); menuPart.addComponent(menuItemsLayout); addComponent(menuPart); }