Example usage for com.google.gwt.user.client.ui HorizontalPanel setHorizontalAlignment

List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setHorizontalAlignment

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HorizontalPanel setHorizontalAlignment.

Prototype

public void setHorizontalAlignment(HorizontalAlignmentConstant align) 

Source Link

Document

Sets the default horizontal alignment to be used for widgets added to this panel.

Usage

From source file:gov.nist.spectrumbrowser.client.SweptFrequencyOneDaySpectrogramChart.java

License:Open Source License

public void draw() {
    try {/*  ww w.  j  a  v a  2  s  .com*/
        vpanel.clear();
        drawNavigation();
        HTML pageTitle = new HTML("<h2>" + END_LABEL + "</h2>");
        vpanel.add(pageTitle);
        HTML title = new HTML("<H3>Detected System = " + mSys2detect + "; Start Time = "
                + localDateOfAcquisition + "; Occupancy Threshold = " + cutoff + " dBm; minPower = " + minPower
                + " dBm; maxPower = " + maxPower + " dBm</H3>");

        vpanel.add(title);
        HTML title1 = new HTML("<h3>Aquisition Count = " + acquisitionCount + "; max occupancy = "
                + maxOccupancy + "%; min occupancy = " + minOccupancy + "%; mean occupancy = " + meanOccupancy
                + "%; median occupancy = " + medianOccupancy + "%</h3>");
        vpanel.add(title1);
        HTML title3 = new HTML("<h3> Equiv. Noise BW = " + enbw + " Hz; Resolution BW = " + rbw + " Hz. </h3>");
        vpanel.add(title3);
        HTML help = new HTML("<p>Click on spectrogram or occupancy plot for detail. "
                + "Move slider and and click on redraw button to change threshold and redraw.</p>");
        vpanel.add(help);

        grid = new Grid(1, 4);

        vpanel.add(grid);
        grid.setStyleName("selectionGrid");

        for (int i = 0; i < grid.getRowCount(); i++) {
            for (int j = 0; j < grid.getColumnCount(); j++) {
                grid.getCellFormatter().setHorizontalAlignment(i, j, HasHorizontalAlignment.ALIGN_CENTER);
                grid.getCellFormatter().setVerticalAlignment(i, j, HasVerticalAlignment.ALIGN_MIDDLE);
            }
        }

        spectrogramVerticalPanel = new VerticalPanel();

        hpanel = new HorizontalPanel();

        hpanel.setSpacing(10);
        hpanel.setStyleName("spectrogram");
        xaxisPanel = new HorizontalPanel();
        xaxisPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        HorizontalPanel xaxis = new HorizontalPanel();
        xaxis.setWidth(canvasPixelWidth + 30 + "px");
        xaxis.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        xaxis.add(new Label("0"));
        xaxis.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        xaxis.add(new Label("Time (hours) since start of day"));
        xaxis.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        xaxis.add(new Label(Double.toString(timeDelta)));
        xaxisPanel.add(xaxis);

        // Attach the previous reading button.

        if (prevAcquisitionTime != tStartTimeUtc) {

            final Button prevDayButton = new Button();
            prevDayButton.setEnabled(true);
            prevDayButton.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    mSelectionTime = prevAcquisitionTime;
                    mSpectrumBrowser.showWaitImage();
                    infoLabel.setText(COMPUTING_PLEASE_WAIT);
                    mSpectrumBrowser.getSpectrumBrowserService().generateSingleDaySpectrogramAndOccupancy(
                            mSensorId, mLat, mLon, mAlt, prevAcquisitionTime, mSys2detect, mMinFreq, mMaxFreq,
                            mSubBandMinFreq, mSubBandMaxFreq, cutoff,
                            SweptFrequencyOneDaySpectrogramChart.this);

                }
            });

            prevDayButton.setText("< Previous Day");

            grid.setWidget(0, 0, prevDayButton);
        }

        // Attach the labels for the spectrogram power
        VerticalPanel powerLevelPanel = new VerticalPanel();
        powerLevelPanel.setWidth(100 + "px");
        this.maxPowerLabel = new Label();
        this.minPowerLabel = new Label();
        powerLevelPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
        powerLevelPanel.add(maxPowerLabel);
        powerLevelPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        powerLevelPanel.add(new Label("Power (dBm) "));
        powerLevelPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
        powerLevelPanel.add(minPowerLabel);
        // Attach labels for the frequency.
        freqPanel = new VerticalPanel();
        freqPanel.setWidth(100 + "px");
        powerLevelPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
        freqPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
        freqPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        freqPanel.add(new Label(Double.toString(maxFreqMhz)));

        freqPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        freqPanel.add(new Label("Frequency (MHz)"));
        freqPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
        freqPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        freqPanel.add(new Label(Double.toString(minFreqMhz)));
        logger.finest("minFreq = " + minFreqMhz);
        powerMapPanel = new HorizontalPanel();
        powerMapPanel.setWidth(30 + "px");
        hpanel.add(freqPanel);
        spectrogramPanel = new VerticalPanel();

        HorizontalPanel spectrogramAndPowerMapPanel = new HorizontalPanel();
        spectrogramAndPowerMapPanel.add(spectrogramPanel);
        spectrogramAndPowerMapPanel.add(powerMapPanel);
        hpanel.add(spectrogramAndPowerMapPanel);
        infoLabel = new Label("Click on spectrogram for power spectrum at selected time.");
        spectrogramVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        spectrogramVerticalPanel.add(infoLabel);
        spectrogramVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        spectrogramVerticalPanel.add(hpanel);
        String helpString = "Single click for power spectrum.";
        String powerString = "Single click for power occupancy.";

        // Add the slider bar for min occupancy selection.
        occupancyMinPowerVpanel = new VerticalPanel();
        occupancyMinPowerVpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        occupancyMinPowerVpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

        occupancyMinPowerSliderBar = new SliderBarSimpleVertical(100, canvasPixelHeight + "px", true);
        occupancyMinPowerVpanel.add(occupancyMinPowerSliderBar);

        occupancyMinPowerSliderBar.setMaxValue(100);

        this.occupancyMinPowerLabel = new Label();
        occupancyMinPowerVpanel.add(occupancyMinPowerLabel);
        final Button generateSpectrogramButton = new Button("Cutoff and Redraw");
        grid.setWidget(0, 1, generateSpectrogramButton);
        generateSpectrogramButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                generateSpectrogramButton.setEnabled(false);
                mSpectrumBrowser.showWaitImage();
                mSpectrumBrowser.getSpectrumBrowserService().generateSingleDaySpectrogramAndOccupancy(mSensorId,
                        mLat, mLon, mAlt, mSelectionTime, mSys2detect, mMinFreq, mMaxFreq, mSubBandMinFreq,
                        mSubBandMaxFreq, occupancyMinPower, SweptFrequencyOneDaySpectrogramChart.this);

            }
        });

        // Close all the tabs.
        final Button closeTabsButton = new Button("Close Tabs");
        closeTabsButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                tabPanel.clear();
                tabPanel.add(spectrogramVerticalPanel, "[Spectrogram]");
                tabPanel.add(occupancyPanel, "[Occupancy]");
                tabPanel.selectTab(0);
            }
        });
        grid.setWidget(0, 2, closeTabsButton);

        occupancyMinPowerSliderBar
                .addBarValueChangedHandler(new OccupancyMinPowerSliderHandler(occupancyMinPowerLabel, cutoff));
        int initialValue = (int) ((double) (maxPower - cutoff) / (double) (maxPower - minPower) * 100 + 0.5);
        occupancyMinPowerSliderBar.setValue(initialValue);
        hpanel.add(occupancyMinPowerVpanel);

        spectrogramPanel.setTitle(helpString);
        //powerMapPanel.setTitle(helpString);
        spectrumAndOccupancyPanel = new VerticalPanel();
        spectrumAndOccupancyPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        spectrogramVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        spectrogramVerticalPanel.add(spectrumAndOccupancyPanel);

        occupancyPanel = new VerticalPanel();
        occupancyPanel.setWidth(canvasPixelWidth + "px");
        occupancyPanel.setHeight(canvasPixelHeight + "px");
        occupancyPanel.setPixelSize(canvasPixelWidth, canvasPixelHeight);
        occupancyPanel.setTitle(powerString);

        // Attach the next spectrogram panel.
        if (nextAcquisitionTime != tStartTimeUtc) {
            final Button nextDayButton = new Button();
            nextDayButton.setEnabled(true);
            nextDayButton.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    logger.finer("getting next spectrogram");
                    try {
                        mSelectionTime = nextAcquisitionTime;
                        nextDayButton.setEnabled(false);
                        mSpectrumBrowser.showWaitImage();
                        infoLabel.setText(COMPUTING_PLEASE_WAIT);
                        mSpectrumBrowser.getSpectrumBrowserService().generateSingleDaySpectrogramAndOccupancy(
                                mSensorId, mLat, mLon, mAlt, nextAcquisitionTime, mSys2detect, mMinFreq,
                                mMaxFreq, mSubBandMinFreq, mSubBandMaxFreq, cutoff,
                                SweptFrequencyOneDaySpectrogramChart.this);
                    } catch (Throwable th) {
                        logger.log(Level.SEVERE, "Error calling spectrum browser service", th);
                    }

                }
            });
            nextDayButton.setText("Next Day >");
            grid.setWidget(0, 3, nextDayButton);

        }
        setSpectrogramImage();
        drawOccupancyChart();
        tabPanel = new TabPanel();
        tabPanel.add(spectrogramVerticalPanel, "[Spectrogram]");
        tabPanel.add(occupancyPanel, "[Occupancy]");
        tabPanel.selectTab(0);
        vpanel.add(tabPanel);

    } catch (Throwable ex) {
        logger.log(Level.SEVERE, "Problem drawing specgtrogram", ex);
    }
}

From source file:mcamara.client.InformeComposite.java

License:Open Source License

/**
 * Instantiates a new informe composite.
 *
 * @param idioma the idioma//w ww  .  ja va 2s.  com
 */
public InformeComposite(String idioma) {

    m = Util.getMensajes(idioma);

    VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);

    titulo = new Label(m.titulo());
    titulo.setStyleName("gwt-Label-Titulo");
    titulo.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(titulo);

    contenido = new VerticalPanel();
    contenido.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(contenido);
    contenido.setWidth("458px");

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel);
    horizontalPanel.setWidth("459px");

    salir = new Button(m.salir());
    horizontalPanel.add(salir);
}

From source file:mcamara.client.PreguntaComposite.java

License:Open Source License

/**
 * Instantiates a new pregunta composite.
 *
 * @param cuestionario the cuestionario/*from  w  w w .j  av  a 2 s. c om*/
 */
public PreguntaComposite(Cuestionario cuestionario) {
    m = Util.getMensajes(cuestionario.getIdioma());
    idPregunta = 0;
    this.cuestionario = cuestionario;
    this.pregunta = cuestionario.getPregunta(idPregunta);
    VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);
    verticalPanel.setHeight("218px");
    Pregunta pregunta = cuestionario.getPregunta(idPregunta);

    numPregunta = new Label("" + pregunta.getIdPregunta());
    numPregunta.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    int numeroPregunta = idPregunta + 1;
    preguntaXdeY = new Label(m.pregunta() + " " + numeroPregunta + " / " + cuestionario.getNumeroDePreguntas());
    preguntaXdeY.setStyleName("gwt-Label-Titulo");
    preguntaXdeY.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(preguntaXdeY);

    textoPregunta = new TextArea();
    textoPregunta.setEnabled(false);
    textoPregunta.setText(pregunta.getTextoPregunta());
    textoPregunta.setReadOnly(true);
    textoPregunta.setAlignment(TextAlignment.CENTER);
    verticalPanel.add(textoPregunta);
    textoPregunta.setWidth("449px");

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel_1);
    horizontalPanel_1.setWidth("459px");

    imagen = new Image((String) null);
    horizontalPanel_1.add(imagen);

    Label lblRespuestas = new Label(m.respuestas());
    verticalPanel.add(lblRespuestas);

    verticalPanelRespuestas = new VerticalPanel();
    verticalPanel.add(verticalPanelRespuestas);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel);
    horizontalPanel.setWidth("458px");

    Button btnNewButton_1 = new Button(m.salir());
    horizontalPanel.add(btnNewButton_1);

    continuar = new Button(m.continuar());
    horizontalPanel.add(continuar);

}

From source file:mcamara.client.PresentacionComposite.java

License:Open Source License

/**
 * Instantiates a new presentacion composite.
 *
 * @param cuestionario the cuestionario/* w  ww . j  a va  2  s  .c o  m*/
 * @param padre the padre
 */
public PresentacionComposite(final Cuestionario cuestionario, final PPresentacion padre) {

    m = Util.getMensajes(cuestionario.getIdioma());

    VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);
    verticalPanel.setHeight("218px");

    TextArea textArea = new TextArea();
    textArea.setEnabled(false);
    textArea.setText(cuestionario.getPresentacionCuestionario());
    textArea.setReadOnly(true);
    textArea.setAlignment(TextAlignment.CENTER);
    verticalPanel.add(textArea);
    textArea.setWidth("449px");

    HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
    //horizontalPanel_2.setSpacing(3);
    horizontalPanel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel_2);
    horizontalPanel_2.setWidth("458px");

    label = new Label("New label");
    label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    label.setText(m.totalpreguntas());
    horizontalPanel_2.add(label);
    //label.setSize("50%", "100%");

    label_1 = new Label("New label");
    label_1.setText("" + cuestionario.getNumeroDePreguntas());
    horizontalPanel_2.add(label_1);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel);
    horizontalPanel.setWidth("458px");

    Button btnNewButton_1 = new Button(m.salir());
    horizontalPanel.add(btnNewButton_1);

    Button btnNewButton = new Button(m.empezar());
    btnNewButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            RootPanel.get().remove(padre);
            new PPregunta(cuestionario);
        }
    });
    horizontalPanel.add(btnNewButton);
}

From source file:mcamara.client.TutorialComposite.java

License:Open Source License

/**
 * Instantiates a new tutorial composite.
 *
 * @param idioma the idioma//from www  .  j a  va2  s.  c  o  m
 */
@SuppressWarnings("deprecation")
public TutorialComposite(String idioma) {
    m = Util.getMensajes(idioma);
    DockPanel dockPanel = new DockPanel();
    initWidget(dockPanel);
    dockPanel.setSize("800", "500");

    panelTitulo = new HorizontalPanel();
    panelTitulo.setSpacing(1);
    panelTitulo.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panelTitulo.setBorderWidth(0);
    titulo = new Label("New label");
    titulo.setStyleName("gwt-Label-Titulo");
    titulo.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panelTitulo.add(titulo);
    titulo.setWidth("100%");
    dockPanel.add(panelTitulo, DockPanel.NORTH);
    panelTitulo.setWidth("100%");

    itemsMenuPantallas = new ScrollPanel();
    menuPantallas = new VerticalPanel();
    menuPantallas.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    menuPantallas.setSpacing(1);
    menuPantallas.setBorderWidth(1);
    itemsMenuPantallas.add(menuPantallas);
    menuPantallas.setSize("120px", "100%");
    dockPanel.add(itemsMenuPantallas, DockPanel.WEST);
    itemsMenuPantallas.setSize("100%", "100%");

    VerticalPanel verticalPanel_1 = new VerticalPanel();
    verticalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel_1.setSpacing(5);
    verticalPanel_1.setBorderWidth(0);
    dockPanel.add(verticalPanel_1, DockPanel.CENTER);
    verticalPanel_1.setSize("100%", "100%");

    horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel_1.add(horizontalPanel);
    horizontalPanel.setWidth("80%");

    image = new Image((String) null);
    horizontalPanel.add(image);

    explicacion = new TextArea();
    explicacion.setTextAlignment(TextBoxBase.ALIGN_CENTER);
    explicacion.setEnabled(false);
    explicacion.setVisibleLines(4);
    explicacion.setReadOnly(true);
    explicacion.setAlignment(TextAlignment.LEFT);
    verticalPanel_1.add(explicacion);
    explicacion.setWidth("100%");

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setSpacing(1);
    horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    verticalPanel_1.add(horizontalPanel_1);
    horizontalPanel_1.setWidth("100%");

    continuar = new Button(m.continuar());
    horizontalPanel_1.add(continuar);
}

From source file:mr.davidsanderson.uml.client.impl.EditorPanelImpl.java

License:Apache License

/**
 * //w ww.  ja  v  a 2 s.com
 */
@Inject
public EditorPanelImpl(final GraphEventBus graphEventBus, GraphModel model) {
    Log.debug("UMLEditorPanel : start");
    this.model = model;
    graphEventBus.addHandler(eventHandler, GraphEvent.getType());
    // set editor
    this.setSpacing(5);
    this.setSize("100%", "100%");
    this.textArea = new TextArea();
    this.textArea.setSize("100%", "100%");

    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    buttonPanel.setSpacing(10);

    Button okBtn = new Button(new HTML("Ok").toString(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            EditorPanelImpl.this.editing = false;
            Log.debug("UMLEditorPanel.okBtn.onClick : fire event close editor");
            graphEventBus.fireEvent(new GraphEvent(origin, GraphEventType.EDITOR_CLOSE));
            Log.debug("UMLEditorPanel.okBtn.onClick : fire content changed");
            graphEventBus.fireEvent(new GraphEvent(origin, textArea.getText(), GraphEventType.CONTENT_CHANGED));
        }
    });
    Button cancelBtn = new Button(new HTML("Cancel").toString(), new ClickHandler() {
        public void onClick(ClickEvent arg0) {
            EditorPanelImpl.this.editing = false;
            Log.debug("UMLEditorPanel.cancelBtn.onClick : fire event close editor");
            graphEventBus.fireEvent(new GraphEvent(origin, GraphEventType.EDITOR_CLOSE));
        }
    });
    buttonPanel.add(okBtn);
    buttonPanel.add(cancelBtn);

    this.add(textArea, DockPanel.CENTER);
    this.add(buttonPanel, DockPanel.SOUTH);
    this.setCellHorizontalAlignment(buttonPanel, DockPanel.ALIGN_CENTER);
    this.setCellVerticalAlignment(buttonPanel, DockPanel.ALIGN_BOTTOM);
    this.setCellHeight(textArea, "99%");
    this.setCellHorizontalAlignment(textArea, DockPanel.ALIGN_LEFT);
    this.setCellVerticalAlignment(textArea, DockPanel.ALIGN_MIDDLE);
}

From source file:mr.davidsanderson.uml.client.impl.MessagePanelImpl.java

License:Apache License

/**
 * @param graphEventBus/*from w  w w  .  j  a  va 2  s. c  o  m*/
 */
@Inject
public MessagePanelImpl(final GraphEventBus graphEventBus) {
    this.graphEventBus = graphEventBus;
    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    buttonPanel.setSpacing(10);
    Button okBtn = new Button(new HTML("Ok").toString(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {

            Log.debug("MessagePanel.okBtn.onClick : fire event close editor");
            graphEventBus.fireEvent(new GraphEvent(origin, GraphEventType.MSG_CLOSE));
            Log.debug("MessagePanel.okBtn.onClick : fire content changed");
        }
    });
    Button clearBtn = new Button(new HTML("Clear").toString(), new ClickHandler() {
        public void onClick(ClickEvent arg0) {
            Log.debug("MessagePanel.Clear.onClick : clears");
            clear();
        }
    });
    Button helpBtn = new Button(new HTML("Help").toString(), new ClickHandler() {
        public void onClick(ClickEvent arg0) {

            Log.debug("MessagePanel.Help.onClick : show help");
            addMessage(helpTxtStart + helpTextMid + helpTextEnd);
        }
    });
    buttonPanel.add(okBtn);
    buttonPanel.add(clearBtn);
    buttonPanel.add(helpBtn);

    htmlPanel = new HTMLPanel(messagePanelHtml);
    htmlPanel.setSize("100%", "100%");

    this.add(htmlPanel, DockPanel.CENTER);
    this.add(buttonPanel, DockPanel.SOUTH);
    this.setCellHorizontalAlignment(buttonPanel, DockPanel.ALIGN_CENTER);
    this.setCellVerticalAlignment(buttonPanel, DockPanel.ALIGN_BOTTOM);
    this.setCellHeight(htmlPanel, "99%");
    this.setCellHorizontalAlignment(htmlPanel, DockPanel.ALIGN_LEFT);
    this.setCellVerticalAlignment(htmlPanel, DockPanel.ALIGN_MIDDLE);

    addMessage(messageDivStart + "Welcome begin modelling by clicking ok." + messageDivEnd);
}

From source file:net.autosauler.ballance.client.gui.EditUserDialog.java

License:Apache License

/**
 * Creates the gui./* w  w  w.  j  ava  2  s.  co m*/
 * 
 */
private void createGUI() {

    if (editlogin == null) {
        setText(M.users.menuAddUser());
    } else {
        setText(M.users.titleEditUser());
    }
    setAnimationEnabled(true);
    setGlassEnabled(true);

    String addText = M.users.btnAdd();
    if (editlogin != null) {
        addText = M.users.btnUpdate();
    }
    Button btnAdd = new Button(addText);

    btnAdd.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (editlogin == null) {
                createUser();
            } else {
                updateUser();
            }
        }

    });

    Button btnCancel = new Button(M.users.btnCancel());
    btnCancel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            EditUserDialog.this.hide();

        }

    });

    VerticalPanel vpanel = new VerticalPanel();
    // vpanel.setWidth("400px");

    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);

    layout.setHTML(0, 0, M.users.fullName());
    name = new TextBox();
    name.setText(user.getUsername());
    layout.setWidget(0, 1, name);

    layout.setHTML(1, 0, M.users.login());
    login = new TextBox();
    login.setText(user.getLogin());
    if (editlogin != null) {
        login.setReadOnly(true);
    }
    layout.setWidget(1, 1, login);

    layout.setHTML(2, 0, M.users.password());
    password = new TextBox();
    password.setText("");
    layout.setWidget(2, 1, password);

    layout.setHTML(3, 0, M.users.isactive());
    isactive = new CheckBox();
    isactive.setValue(user.isActive());
    layout.setWidget(3, 1, isactive);

    layout.setHTML(4, 0, M.users.access());

    UserRole role = user.getUserrole();

    FlexTable access = new FlexTable();
    access.setCellSpacing(6);

    access.setHTML(0, 0, M.users.isadmin());
    isadmin = new CheckBox();
    isadmin.setValue(role.isAdmin());
    access.setWidget(0, 1, isadmin);

    access.setHTML(1, 0, M.users.isdocuments());
    isdocuments = new CheckBox();
    isdocuments.setValue(role.isDocuments());
    access.setWidget(1, 1, isdocuments);

    access.setHTML(2, 0, M.users.isfinances());
    isfinances = new CheckBox();
    isfinances.setValue(role.isFinances());
    access.setWidget(2, 1, isfinances);

    access.setHTML(3, 0, M.users.ismanager());
    ismanager = new CheckBox();
    ismanager.setValue(role.isManager());
    access.setWidget(3, 1, ismanager);

    layout.setWidget(4, 1, access);

    vpanel.add(layout);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setWidth("100%");
    buttons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    HorizontalPanel bcontainer = new HorizontalPanel();
    bcontainer.add(btnAdd);
    bcontainer.add(btnCancel);
    bcontainer.setSpacing(5);
    buttons.add(bcontainer);

    vpanel.add(buttons);

    setWidget(vpanel);
    /*
     * setPopupPosition( (Ballance_autosauler_net.mainpanel.getOffsetWidth()
     * / 2 - 200), 100);
     */
    show();
}

From source file:net.cbtltd.client.form.LeaseForm.java

@Override
public void initialize() {
    AbstractField.CSS.ensureInjected();
    CSS.ensureInjected();//from   w ww  . j  a v a 2 s. c o m

    final ScrollPanel scroll = new ScrollPanel();
    add(scroll);
    final HorizontalPanel panel = new HorizontalPanel();
    panel.addStyleName(AbstractField.CSS.cbtAbstractWidth());
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    scroll.add(panel);

    final HorizontalPanel content = new HorizontalPanel();
    panel.add(content);

    createActions();

    content.add(createContent());
    stackPanel = new StackLayoutPanel(com.google.gwt.dom.client.Style.Unit.EM);
    content.add(stackPanel);

    stackPanel.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            if (event.getSelectedItem() != 0 && leaseField.noValue()) {
                AbstractField.addMessage(Level.ERROR, CONSTANTS.leaseError(), leaseField);
            }
            refreshStackPanel();
        }
    });

    stackPanel.addStyleName(CSS.stackStyle());
    stackPanel.add(createText(), CONSTANTS.textLabel(), 1.5);
    stackPanel.add(createMaintenance(), CONSTANTS.maintenanceLabel(), 1.5);
    stackPanel.add(createFinancial(), CONSTANTS.financeLabel(), 1.5);
    onRefresh();
    onReset(Lease.State.Created.name());
}

From source file:net.cbtltd.client.form.OrganizationForm.java

License:Open Source License

public void initialize() {
    AbstractField.CSS.ensureInjected();
    CSS.ensureInjected();// www  . java  2s. co  m

    final ScrollPanel scroll = new ScrollPanel();
    add(scroll);
    final HorizontalPanel panel = new HorizontalPanel();
    panel.addStyleName(AbstractField.CSS.cbtAbstractWidth());
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    scroll.add(panel);
    final HorizontalPanel content = new HorizontalPanel();
    panel.add(content);

    createActions();

    content.add(createContent());
    stackPanel = new StackLayoutPanel(com.google.gwt.dom.client.Style.Unit.EM);
    stackPanel.setVisible(false);
    stackPanel.addSelectionHandler(new SelectionHandler<Integer>() {
        public void onSelection(SelectionEvent<Integer> event) {
            refreshStackPanel();
        }
    });
    stackPanel.addStyleName(CSS.stackStyle());
    content.add(stackPanel);

    createDescription = createDescription();
    createContracttext = createContracttext();
    createContracttable = createContracttable();
    createActor = createActor();
    createTax = createTax();
    createFinance = createFinance();
    createLicense = createLicence();
    createPartner = createPartner();
    createLocale = createDefaults();
    createWorkflow = createWorkflow();
    createDiscounttable = createDiscounttable();
    initRegisterLink();
    onRefresh();
    onReset(Organization.CREATED);
}