Exemplo n.º 1
0
  /**
   * panel with a {@link #sensorOnOff "sensor-on-off" button}, a {@link #captionLabel label} with
   * the name of the sensor and a {@link #collapse button} to expand/collapse the settings for this
   * sensor. if sensor is turned off, it stops logging the data values of this sensor.
   */
  private void addCaption() {
    FlowPanel caption = new FlowPanel();
    caption.addStyleName("panelTitle");
    this.captionLabel = new Label();
    updateCaptionLabel();

    collapse =
        new ToggleButton(
            new Image(GuiResources.INSTANCE.collapse()), new Image(GuiResources.INSTANCE.expand()));
    collapse.addStyleName("collapse");
    collapse.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            dataValues.setVisible(!collapse.isDown());
          }
        });

    sensorOnOff = new SimplePanel();
    sensorON = new Image(AppResources.INSTANCE.shown());
    sensorOFF = new Image(AppResources.INSTANCE.hidden());
    sensorOnOff.add(sensorOFF);
    sensorOnOff.addStyleName("sensorOnOffButton");

    caption.add(sensorOnOff);
    caption.add(this.captionLabel);
    caption.add(collapse);
    this.add(caption);
  }
Exemplo n.º 2
0
 private void initEditorToggle() {
   final RootPanel togglePanel = RootPanel.get("paramsToggleButton");
   editorToggle =
       new ToggleButton(new Image("images/triright.png"), new Image("images/tridown.png"));
   editorToggle.setDown(false);
   editorToggle.addStyleName("toggle-button");
   togglePanel.add(editorToggle);
   editorToggle.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(final ClickEvent event) {
           paramsEditor.setEditorExpanded(editorToggle.isDown());
         }
       });
 }