List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel
private HTMLPanel(Element elem)
From source file:edu.caltech.ipac.firefly.ui.panels.Toolbar.java
public Toolbar() { // DockPanel wrapper = new DockPanel(); leftToolbar = new TTabBar(); leftToolbar.setStylePrimaryName("DropDownToolBar"); rightToolbar = new TTabBar(); rightToolbar.setStylePrimaryName("DropDownToolBar"); rightToolbar.addStyleName("right"); centerToolbar = new TTabBar(); centerToolbar.setStylePrimaryName("DropDownToolBar"); centerToolbar.addStyleName("center"); HTMLPanel tbar = new HTMLPanel( "<div style='white-space:nowrap'>\n" + " <div id='leftBar' style='display:inline-block'></div>\n" + " <div id='centerBar' style='display:inline-block;margin-left:20px'></div>\n" + " <div id='rightBar' style='display:inline-block;position:absolute;right:0'></div>\n" + "</div>"); tbar.add(leftToolbar, "leftBar"); tbar.add(centerToolbar, "centerBar"); tbar.add(rightToolbar, "rightBar"); initWidget(tbar);/*w w w.j a v a2 s . c o m*/ EventHandler eventHandler = new EventHandler(); leftToolbar.addBeforeSelectionHandler(eventHandler); centerToolbar.addBeforeSelectionHandler(eventHandler); rightToolbar.addBeforeSelectionHandler(eventHandler); leftToolbar.addSelectionHandler(eventHandler); centerToolbar.addSelectionHandler(eventHandler); rightToolbar.addSelectionHandler(eventHandler); }
From source file:edu.ucsc.robot.client.MainScreen.java
License:Apache License
@Override public void onModuleLoad() { screenWidth = Window.getClientWidth(); screenHeight = Window.getClientHeight(); setupRenderer();/*from w w w . j a v a2 s. c om*/ setupWebGLCanvas(renderer); RootLayoutPanel.get().add(canvas); setupScene(); setupCamera(); rootGroup = THREE.Object3D(); scene.add(rootGroup); backgroundContainer = THREE.Object3D(); rootGroup.add(backgroundContainer); final Geometry geo = THREE.PlaneGeometry(100, 100, 20, 20); final Mesh mesh = THREE.Mesh(geo, THREE.MeshBasicMaterial().color(0x666666).wireFrame(true).build()); mesh.setRotation(Math.toRadians(-90), 0, 0); backgroundContainer.add(mesh); setupUpdater(); dialog = new PopupPanel(); setupDialogRoot(); createPlayer(main); dialog.show(); Util.rightTop(dialog); Window.addResizeHandler(new IndexResizeHandler(this)); HTMLPanel html = new HTMLPanel(getHtml()); html.setWidth("100%"); html.setHeight("20px"); html.setStyleName("text"); htmlDialog = new PopupPanel(); htmlDialog.add(html); htmlDialog.setPopupPosition(150, 30); htmlDialog.setWidth("100%"); htmlDialog.setStyleName("transparent"); htmlDialog.show(); }
From source file:eu.acsone.client.application.home.tab.HomeTab1View.java
License:Open Source License
@Inject public HomeTab1View() { content = new HTMLPanel("lorem ipsum"); }
From source file:eu.acsone.client.application.home.tab.SubTab1View.java
License:Open Source License
@Inject public SubTab1View() { content = new HTMLPanel("nested lorem ipsum"); }
From source file:eu.acsone.client.application.home.tab.SubTab2View.java
License:Open Source License
@Inject public SubTab2View() { content = new HTMLPanel("nested sub tab 2 lorem ipsum"); }
From source file:eu.riscoss.client.report.RiskAnalysisReport.java
License:Apache License
protected void drawCh() { int nbSeries = response.isArray().size(); //Window.alert(String.valueOf(nbSeries)); PlotModel model = new PlotModel(); PlotOptions plotOptions = PlotOptions.create(); GlobalSeriesOptions globalSeriesOptions = GlobalSeriesOptions.create(); globalSeriesOptions.setBarsSeriesOptions( BarSeriesOptions.create().setShow(true).setBarWidth(0.2).setLineWidth(1).setFill(0.8)); plotOptions.addXAxisOptions(AxisOptions.create().setTicks(new AbstractAxisOptions.TickGenerator() { @Override//from w ww. j a v a 2s. c o m public JsArray<Tick> generate(Axis axis) { JsArray<Tick> array = JsArray.createArray().cast(); for (int i = 0; i < 1; i++) { array.push(Tick.of(i, "Exposure")); } return array; } })); plotOptions.addYAxisOptions(AxisOptions.create().setMaximum(1.0)); plotOptions.addYAxisOptions(AxisOptions.create().setMinimum(0.0)); plotOptions.setGlobalSeriesOptions(globalSeriesOptions); plotOptions.setLegendOptions(LegendOptions.create().setMargin(-150, 0)); JsArrayString colors = JavaScriptObject.createArray().cast(); colorsArray = getRandomColors(nbSeries); for (String s : colorsArray) { colors.push(s); } ArrayList<Double> values = new ArrayList<>(); // create a series List<SeriesHandler> series = new ArrayList<SeriesHandler>(); for (int i = 0; i < nbSeries; i++) { JSONObject v = response.isArray().get(i).isObject(); JsonRiskResult result = new JsonRiskResult(v); String id = ""; switch (result.getDataType()) { case EVIDENCE: { id = v.get("id").isString().stringValue(); Double value = v.get("e").isObject().get("e").isNumber().doubleValue(); series.add( model.addSeries(Series.of(id).setBarsSeriesOptions(BarSeriesOptions.create().setOrder(i)))); values.add(value); String s = "arg" + i; String c = "col" + i; HTMLPanel html = new HTMLPanel("<span id='" + c + "'></span>"); JArgument arg = argumentation.arguments.get(result.getChunkId()); SimplePanel p = new SimplePanel(); p.setSize("20px", "20px"); p.getElement().getStyle().setBackgroundColor(colorsArray[i]); p.setStyleName("colorBox"); HorizontalPanel hp = new HorizontalPanel(); hp.setStyleName("margin-bottom"); hp.add(p); String htmlString = "<b>" + v.get("id").isString().stringValue() + "</b>"; if (v.get("description") != null) { htmlString += ": " + v.get("description").isString().stringValue(); } HTMLPanel htm = new HTMLPanel(htmlString); hp.add(htm); html.add(hp, c); html.setWidth("100%"); html.setStyleName("descriptionPanel"); descriptions.add(html); break; } default: break; } } // add data for (int i = 0; i < series.size(); i++) { series.get(i).add(DataPoint.of(0, values.get(i))); } plotOptions.setLegendOptions(LegendOptions.create().setShow(false)); plotOptions.setDefaultColorTheme(colors); // create the plot SimplePlot plot2 = new SimplePlot(model, plotOptions); //HEIGHT value in % has problems, needs to be fixed //plot2.setHeight("100%"); int size = nbSeries * 40; if (size < 350) size = 350; //plot2.setHeight(size + "px"); mainChartPanel.add(plot2); mainChartPanel.add(descriptions); }
From source file:eu.riscoss.client.RiscossWebApp.java
License:Apache License
public void generateShortcuts() { shortcuts.setStyleName("float-right"); shortcuts.setHeight("100%"); Boolean b1 = false;//from w w w . j av a 2 s. c o m Boolean b2 = false; Boolean b3 = false; //Entity-layer shortcut SimplePanel s1 = new SimplePanel(); s1.setStyleName("shortcut-1"); s1.setWidth("200px"); s1.setHeight("100px"); VerticalPanel v = new VerticalPanel(); if (access.contains("Entities")) { b1 = true; Anchor entities = new Anchor("entities to be analysed updated"); entities.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("entities.jsp"); } }); HTMLPanel l1 = new HTMLPanel( "Before you can run risk analysis, you need to have the <span id='entities'></span>."); l1.add(entities, "entities"); v.add(l1); } if (access.contains("Layers")) { b1 = true; Anchor layers = new Anchor("defining a hierarchy of layers"); layers.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("layers.jsp"); } }); HTMLPanel l2 = new HTMLPanel("Entities can be organized hierarchically <span id='layers'></span>."); l2.add(layers, "layers"); v.add(l2); } s1.add(v); //Riskconf-model shortcut SimplePanel s2 = new SimplePanel(); s2.setWidth("200px"); s2.setHeight("100px"); s2.setStyleName("shortcut-2"); VerticalPanel vv = new VerticalPanel(); if (access.contains("Risk Configurations")) { b2 = true; Anchor riskconfs = new Anchor("defining risks configurations"); riskconfs.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("riskconfs.jsp"); } }); HTMLPanel l3 = new HTMLPanel("The risk analysis needs to be configured <span id='riskconfs'></span>."); l3.add(riskconfs, "riskconfs"); vv.add(l3); } if (access.contains("Models")) { b2 = true; Anchor models = new Anchor("uploaded models"); models.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("models.jsp"); } }); HTMLPanel l4 = new HTMLPanel("The risk configurations use the <span id='models'></span>."); l4.add(models, "models"); vv.add(l4); } s2.setWidget(vv); //analysis-browse shortcut SimplePanel s3 = new SimplePanel(); s3.setWidth("200px"); s3.setHeight("100px"); s3.setStyleName("shortcut-3"); VerticalPanel vvv = new VerticalPanel(); if (access.contains("Multi-layer Analysis")) { b3 = true; Anchor riskanalysis = new Anchor("manage your risk analysis sessions"); riskanalysis.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("riskanalysis.jsp"); } }); HTMLPanel l5 = new HTMLPanel("You are ready to <span id='riskanalysis'></span>"); l5.add(riskanalysis, "riskanalysis"); vvv.add(l5); } if (access.contains("Risk Analysis Sessions")) { b3 = true; Anchor ras = new Anchor("generate some comparisons"); ras.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { loadPanel("ras.jsp"); } }); HTMLPanel l6 = new HTMLPanel("You can also <span id='ras'></span>."); l6.add(ras, "ras"); vvv.add(l6); } s3.setWidget(vvv); if (b1) shortcuts.add(s1); if (b2) shortcuts.add(s2); if (b3) shortcuts.add(s3); }
From source file:fr.fg.client.core.AchievementDialog.java
License:Open Source License
public AchievementDialog() { super("Trophes", false, true, true); tabs = new JSTabbedPane(); tabs.addTab("En cours"); tabs.addTab("Russi"); tabs.setPixelWidth(420);// w w w . j a va 2 s .c om tabs.addSelectionListener(this); container = new HTMLPanel(""); OpenJWT.setElementFloat(container.getElement(), "left"); scrollPane = new JSScrollPane(); scrollPane.setPixelSize(420, 300); scrollPane.setView(container); updateUI(); JSRowLayout layout = new JSRowLayout(); layout.addComponent(tabs); layout.addRowSeparator(5); layout.addComponent(scrollPane); setComponent(layout); centerOnScreen(); }
From source file:fr.fg.client.core.AdministrationPanelDialog.java
License:Open Source License
/** * @Lloyd: On te fera pas pay plus cher pour mettre des commentaires :p *//*from w w w . j av a2 s . co m*/ public AdministrationPanelDialog() { super("Panneau d'administration", false, true, true); mainLayout = new JSRowLayout(); //Le layout de la fenetre, on met tous les lments affichs dedans layoutGeneral = new JSRowLayout(); layoutArchiveBan = new JSRowLayout(); layoutMultiAccounts = new JSRowLayout(); layoutManagement = new JSRowLayout(); layoutScripts = new JSRowLayout(); layoutStatistics = new JSRowLayout(); layoutBugsReports = new JSRowLayout(); currentWidget = layoutGeneral; layoutArchiveBan.setVisible(false); layoutMultiAccounts.setVisible(false); layoutManagement.setVisible(false); layoutScripts.setVisible(false); layoutStatistics.setVisible(false); layoutBugsReports.setVisible(false); ArrayList<String> views = new ArrayList<String>(); //Les titres des onglets views.add("Gnral"); views.add("Bans"); if (Settings.isAdministrator()) { views.add("Doubles comptes"); views.add("Gestion modrateurs"); views.add("Scripts"); views.add("Statistiques"); views.add("Bugs reports"); } label4 = new JSLabel("Onglet gestion modrateurs"); label4.setWidth("240"); /***************************** Partie Gnral *****************************/ if (Settings.isAdministrator()) { changeMotdBt = new JSButton("Changer le message du jour"); changeMotdBt.setPixelWidth(240); changeMotdBt.addClickListener(this); } motdModerators = new HTMLPanel(""); motdModerators.setPixelSize(640, 360); motd = new ArrayList<MotdData>(); if (Settings.isAdministrator()) { layoutGeneral.addComponent(changeMotdBt); layoutGeneral.addRow(); } layoutGeneral.addComponent(motdModerators); /*********************** Partie Gestion des Bannis ***********************/ showBannedBt = new JSButton("Afficher les bannis"); showBannedBt.setPixelWidth(240); showBannedBt.addClickListener(this); unbanBt = new JSButton("Dbannir"); unbanBt.setPixelWidth(150); unbanBt.addClickListener(this); unbanBt.setVisible(false); banBt = new JSButton("Bannir un joueur"); banBt.setPixelWidth(240); banBt.addClickListener(this); banBt.setVisible(true); bannedList = new JSList(); bannedList.setPixelSize(640, 320); bannedList.addSelectionListener(this); tabHeader = new JSLabel(new BannedPlayer().getTabHeader()); tabHeader.setPixelSize(640, 30); layoutArchiveBan.addComponent(showBannedBt); layoutArchiveBan.addComponent(unbanBt); layoutArchiveBan.addComponent(banBt); layoutArchiveBan.addComponent(new JSLabel(" ")); layoutArchiveBan.addRowSeparator(3); layoutArchiveBan.addComponent(tabHeader); layoutArchiveBan.addRow(); layoutArchiveBan.addComponent(bannedList); /*********************** Partie Multi-comptes ***********************/ if (Settings.isAdministrator()) { player1Label = new JSLabel(" Joueur 1: "); player1Label.setPixelWidth(65); player2Label = new JSLabel("Joueur 2: "); player2Label.setPixelWidth(65); spacingLabel = new JSLabel(" "); spacingLabel.setPixelWidth(10); player1 = new JSTextField(); player1.setPixelWidth(120); player2 = new JSTextField(); player2.setPixelWidth(120); tabMultiAccountsHeader = new JSLabel(new PlayerInfos().getTabHeader()); tabMultiAccountsHeader.setPixelSize(640, 30); multiAccountsList = new JSList(); multiAccountsList.setPixelSize(640, 320); multiAccountsList.addSelectionListener(this); checkMultiAccountsBt = new JSButton("Vrifier"); checkMultiAccountsBt.setPixelWidth(100); checkMultiAccountsBt.addClickListener(this); checkMultiAccountsBt.setToolTipText("Vrification entre les 2 joueurs"); genericMultiAccountsCheckBt = new JSButton("Vrification gnrique"); genericMultiAccountsCheckBt.setPixelWidth(160); genericMultiAccountsCheckBt.addClickListener(this); genericMultiAccountsCheckBt.setToolTipText("Vrification pour tous les joueurs (non implment)"); layoutMultiAccounts.addComponent(player1Label); layoutMultiAccounts.addComponent(player1); layoutMultiAccounts.addComponent(spacingLabel); layoutMultiAccounts.addComponent(player2Label); layoutMultiAccounts.addComponent(player2); layoutMultiAccounts.addComponent(checkMultiAccountsBt); layoutMultiAccounts.addComponent(genericMultiAccountsCheckBt); layoutMultiAccounts.addRow(); layoutMultiAccounts.addComponent(tabMultiAccountsHeader); layoutMultiAccounts.addRow(); layoutMultiAccounts.addComponent(multiAccountsList); } /************************** Partie Scripts **************************/ if (Settings.isAdministrator()) { scriptList = new ArrayList<String>(); scriptSelectionLabel = new JSLabel("Script: "); scriptSelectionLabel.setPixelWidth(80); scriptSelection = new JSComboBox(); scriptSelection.setPixelWidth(220); execScriptBt = new JSButton("Excuter le script"); execScriptBt.setPixelWidth(180); execScriptBt.addClickListener(this); loadingLabel = new JSLabel(); loadingLabel.setStyleName("loading-script"); loadingLabel.setVisible(false); scriptAnswer = new HTMLPanel(""); scriptAnswer.setPixelSize(640, 360); layoutScripts.addComponent(scriptSelectionLabel); layoutScripts.addComponent(scriptSelection); layoutScripts.addComponent(execScriptBt); layoutScripts.addComponent(loadingLabel); layoutScripts.addRow(); layoutScripts.addComponent(scriptAnswer); } /********************** Partie Statistiques **********************/ /*********************** Partie Bug Report ***********************/ if (Settings.isAdministrator()) { layoutBugsReports = new LayoutBugsReports(); } /*********************** Layout principal ***********************/ mainLayout.setPixelSize(640, 360); layoutGeneral.setPixelSize(640, 320); layoutArchiveBan.setPixelWidth(640); layoutMultiAccounts.setPixelSize(640, 320); layoutManagement.setPixelSize(640, 320); layoutManagement.addComponent(label4); layoutManagement.addRow(); viewsPane = new JSTabbedPane(); //Les onglets viewsPane.setTabs(views); viewsPane.setPixelSize(720, 30); viewsPane.addSelectionListener(this); //On ajoute les lments par dfaut au layout mainLayout.addComponent(viewsPane); mainLayout.addRowSeparator(3); mainLayout.addComponent(layoutGeneral); mainLayout.addComponent(layoutArchiveBan); if (Settings.isAdministrator()) { mainLayout.addComponent(layoutMultiAccounts); mainLayout.addComponent(layoutManagement); mainLayout.addComponent(layoutScripts); mainLayout.addComponent(layoutStatistics); } mainLayout.addRowSeparator(30); mainLayout.addComponent(new JSLabel(" ")); setComponent(mainLayout); centerOnScreen(); getMotd(); if (Settings.isAdministrator()) { refreshBannedList(); refreshScriptList(); } }
From source file:fr.fg.client.core.AdvancementDialog.java
License:Open Source License
public AdvancementDialog() { super("Civilisation", true, true, true); availablePoints = 0;/*from w w w .j a va 2 s . c o m*/ tabbedPane = new JSTabbedPane(); tabbedPane.addTab("Avances acquises"); tabbedPane.addTab("Amlioration"); tabbedPane.addTab("Rinitialisation"); tabbedPane.setPixelWidth(420); tabbedPane.addSelectionListener(this); civilizationPointsLabel = new JSLabel(""); civilizationPointsLabel.setPixelWidth(410); advancementsLayout = new JSRowLayout(); DynamicMessages dynamicMessages = GWT.create(DynamicMessages.class); buyButtons = new JSButton[10]; descriptionPanels = new HTMLPanel[10]; advancementLabels = new JSLabel[10]; costLabels = new JSLabel[10]; layouts = new JSRowLayout[10]; for (int i = 0; i < 10; i++) { advancementLabels[i] = new JSLabel(); advancementLabels[i].setPixelWidth(263); // TODO 280 - scroll bar width costLabels[i] = new JSLabel( "<div class=\"right title\">" + AdvancementData.getCost(i) + " points </div>"); costLabels[i].setPixelWidth(88); JSButton buyBt = new JSButton(); buyBt.setPixelWidth(31); buyBt.addStyleName("iconAdd"); buyBt.setToolTipText("Cliquez pour amliorer au niveau suivant.", 200); buyBt.addClickListener(this); buyButtons[i] = buyBt; HTMLPanel descriptionPanel = new HTMLPanel("<div style=\"padding: 0 10px;\">" + "<div style=\"padding-bottom: 2px;\">" + dynamicMessages.getString("advancement" + i + "Desc") + "</div>" + "<div class=\"emphasize\">Niveau actuel : -</div>" + "<div class=\"emphasize\">Prochain niveau : -</div></div>"); descriptionPanel.setWidth("100%"); OpenJWT.setElementFloat(descriptionPanel.getElement(), "left"); descriptionPanels[i] = descriptionPanel; JSRowLayout layout = new JSRowLayout(); layout.addComponent(JSRowLayout.createHorizontalSeparator(10)); layout.addComponent(advancementLabels[i]); layout.addComponent(costLabels[i]); layout.addComponent(buyBt); layout.addRow(); layout.addComponent(descriptionPanel); layout.addRowSeparator(16); layouts[i] = layout; advancementsLayout.addComponent(layout); advancementsLayout.addRow(); } scrollPane = new JSScrollPane(); scrollPane.setView(advancementsLayout); scrollPane.setPixelSize(420, 270); JSRowLayout layout = new JSRowLayout(); layout.addComponent(tabbedPane); layout.addRow(); layout.addComponent(JSRowLayout.createHorizontalSeparator(10)); layout.addComponent(civilizationPointsLabel); layout.addRowSeparator(3); layout.addComponent(scrollPane); resetBt = new JSButton("Rinitialisation"); resetBt.setPixelWidth(120); resetBt.addStyleName("iconReset"); resetBt.setToolTipText( "Cliquez pour rinitialiser vos points de civilisation sauf Terraformation et Programme de colonisation", 200); resetBt.addClickListener(this); layout.addComponent(resetBt); setComponent(layout); centerOnScreen(); }