Package de.lessvoid.nifty.controls.label.builder

Examples of de.lessvoid.nifty.controls.label.builder.LabelBuilder


        // the changed event and the remove item button
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Changed Event:"));
          control(new LabelBuilder("selectedItem") {{
            width("*");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
          }});
          panel(builders.hspacer("9px"));
          control(new ButtonBuilder("removeDropDownItemButton", "Remove"));
        }});

        // and additionally the index of the selected item
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Current Sel. Idx.:"));
          control(new ControlBuilder("#selectedIndices", "label") {{
            alignLeft();
            textHAlignLeft();
            width("250px");
          }});
        }});

        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          width("100%");
          height("1px");
          backgroundColor("#0008");
        }});
        panel(builders.vspacer());
        control(new RadioGroupBuilder("RadioGroup-1")); // the RadioGroup id is used to link radiobuttons logical together so that only one of them can be active at a certain time
        panel(new PanelBuilder() {{
          control(builders.createLabel("Radio Buttons"));
          childLayoutHorizontal();
          panel(new PanelBuilder() {{
            childLayoutVertical();
            backgroundColor("#8001");
            paddingLeft("7px");
            paddingRight("7px");
            paddingTop("4px");
            paddingBottom("4px");
            width("105px");
            onActiveEffect(new EffectBuilder("border") {{
              effectParameter("color", "#0008");
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 1", "60px"));
              control(new RadioButtonBuilder("option-1") {{
                group("RadioGroup-1");
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 2", "60px"));
              control(new RadioButtonBuilder("option-2") {{
                group("RadioGroup-1");
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 3", "60px"));
              control(new RadioButtonBuilder("option-3") {{
                group("RadioGroup-1");
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 4", "60px"));
              control(new RadioButtonBuilder("option-4") {{
                group("RadioGroup-1");
              }});
            }});
          }});
          panel(builders.hspacer("10px"));
          panel(new PanelBuilder() {{
            childLayoutVertical();
            backgroundColor("#8001");
            paddingLeft("7px");
            paddingRight("7px");
            paddingTop("4px");
            paddingBottom("4px");
            onActiveEffect(new EffectBuilder("border") {{
              effectParameter("color", "#0008");
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 1 Event:"));
              control(new LabelBuilder("option-1-changed") {{
                width("*");
                alignLeft();
                textVAlignCenter();
                textHAlignLeft();
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 2 Event:"));
              control(new LabelBuilder("option-2-changed") {{
                width("*");
                alignLeft();
                textVAlignCenter();
                textHAlignLeft();
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 3 Event:"));
              control(new LabelBuilder("option-3-changed") {{
                width("*");
                alignLeft();
                textVAlignCenter();
                textHAlignLeft();
              }});
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Option 4 Event:"));
              control(new LabelBuilder("option-4-changed") {{
                width("*");
                alignLeft();
                textVAlignCenter();
                textHAlignLeft();
              }});
            }});
          }});
        }});
        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Group Event:"));
          control(new LabelBuilder("RadioGroup-1-changed") {{
            width("*");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
          }});
View Full Code Here


  public static void register(final Nifty nifty) {
    new ControlDefinitionBuilder(NAME) {{
      controller(new DragAndDropDialogController());
      control(new ControlBuilder(DialogPanelControlDefinition.NAME) {{
        control(new LabelBuilder("dragAndDropDescription", "Drop the Key on the Chest to open it.") {{
          width("100%");
          textHAlignCenter();
        }});
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
View Full Code Here

          height("35%");
          panel(new PanelBuilder() {{
            childLayoutVertical();
            width("23px");
            control(new SliderBuilder("sliderR", true));
            control(new LabelBuilder() {{
              alignCenter();
              text("R");
              width("100%");
            }});
          }});
          panel(builders.hspacer("5px"));
          panel(new PanelBuilder() {{
            childLayoutVertical();
            control(new SliderBuilder("sliderG", true));
            width("23px");
            control(new LabelBuilder() {{
              alignCenter();
              text("G");
              width("100%");
            }});
          }});
          panel(builders.hspacer("5px"));
          panel(new PanelBuilder() {{
            childLayoutVertical();
            control(new SliderBuilder("sliderB", true));
            width("23px");
            control(new LabelBuilder() {{
              alignCenter();
              text("B");
              width("100%");
            }});
          }});
          panel(builders.hspacer("35px"));
          panel(new PanelBuilder() {{
            valignCenter();
            childLayoutVertical();
            width("20%");
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Red:", "50px"));
              panel(builders.hspacer("5px"));
              control(builders.createLabel("redLabel", "", "50px"));
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Green:", "50px"));
              panel(builders.hspacer("5px"));
              control(builders.createLabel("greenLabel", "", "50px"));
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Blue:", "50px"));
              panel(builders.hspacer("5px"));
              control(builders.createLabel("blueLabel", "", "50px"));
            }});
            panel(new PanelBuilder() {{
              childLayoutHorizontal();
              control(builders.createLabel("Alpha:", "50px"));
              panel(builders.hspacer("5px"));
              control(builders.createLabel("alphaLabel", "", "50px"));
            }});
          }});
          panel(builders.hspacer("15px"));
          panel(new PanelBuilder() {{
            valignTop();
            childLayoutCenter();
            width("20%");
            panel(new PanelBuilder("color") {{
              alignCenter();
              valignCenter();
              width("50px");
              height("50px");
              backgroundColor("#ffff");
            }});
          }});
          panel(builders.hspacer("9px"));
        }});
        panel(builders.vspacer());
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Horizontal:"));
          control(new ScrollbarBuilder("scrollbarH", false) {{
            width("*");
          }});
        }});
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Current Value:"));
          control(new TextFieldBuilder("scrollbarH_CurrentValue_Textfield") {{
            width("50px");
          }});
          panel(builders.hspacer("20px"));
          control(new LabelBuilder() {{
            text("World Max:");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
            width("70px");
          }});
          panel(builders.hspacer("15px"));
          control(new TextFieldBuilder("scrollbarH_WorldMax_Textfield") {{
            width("50px");
          }});
          panel(builders.hspacer("20px"));
          control(new LabelBuilder() {{
            text("Page Size:");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
          }});
          panel(builders.hspacer("15px"));
          control(new TextFieldBuilder("scrollbarH_ViewMax_Textfield") {{
            width("50px");
          }});
        }});
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Button Step:"));
          control(new TextFieldBuilder("scrollbarH_ButtonStepSize_Textfield") {{
            width("50px");
          }});
          panel(builders.hspacer("20px"));
          control(new LabelBuilder() {{
            text("Page Step:");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
            width("70px");
View Full Code Here

        }});
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Changed Event:"));
          control(new LabelBuilder("textChangedLabel") {{
            width("*");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
          }});
        }});
        panel(builders.vspacer());
        panel(new PanelBuilder() {{
          childLayoutHorizontal();
          control(builders.createLabel("Key Event:"));
          control(new LabelBuilder("keyEventLabel") {{
            width("120px");
            alignLeft();
            textVAlignCenter();
            textHAlignLeft();
          }});
View Full Code Here

  public LabelBuilder createLabel(final String text) {
    return createLabel(text, "100px");
  }

  public LabelBuilder createLabel(final String text, final String width) {
    return new LabelBuilder() {{
      text(text);
      width(width);
      alignLeft();
      textVAlignCenter();
      textHAlignLeft();
View Full Code Here

      textHAlignLeft();
    }};
  }

  public LabelBuilder createLabel(final String id, final String text, final String width) {
    return new LabelBuilder(id, text) {{
      width(width);
      alignLeft();
      textVAlignCenter();
      textHAlignLeft();
    }};
View Full Code Here

      textHAlignLeft();
    }};
  }

  public LabelBuilder createShortLabel(final String name, final String width) {
    LabelBuilder result = createShortLabel(name);
    result.width(width);
    return result;
  }
View Full Code Here

    result.width(width);
    return result;
  }

  public LabelBuilder createShortLabel(final String name) {
    return new LabelBuilder() {{
      text(name);
      alignLeft();
      textVAlignCenter();
      textHAlignLeft();
    }};
View Full Code Here

          effectParameter("hintStyle", "special-hint");
          effectParameter("hintDelay", "750");
          effectParameter("offsetX", "center");
          effectParameter("offsetY", "50");
        }});
        control(new LabelBuilder() {{
          color("#000f");
          text(controlParameter(PARAMETER_LABEL));
          alignCenter();
          valignCenter();
          onCustomEffect(new EffectBuilder("textColor") {{
View Full Code Here

            height("50%");
            width("100%");
            alignCenter();
            valignCenter();
            childLayoutHorizontal();
            control(new LabelBuilder() {{
              label("Screen Resolution:");
            }});
            panel(common.hspacer("7px"));
            control(new DropDownBuilder("resolutions") {{
              width("200px");
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.controls.label.builder.LabelBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.