Examples of RadioButton


Examples of org.apache.pivot.wtk.RadioButton

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        RadioButton radioButton = (RadioButton)getComponent();
        Button.DataRenderer dataRenderer = radioButton.getDataRenderer();

        int preferredWidth = BUTTON_DIAMETER;
        int preferredHeight = BUTTON_DIAMETER;

        Object buttonData = radioButton.getButtonData();
        if (buttonData != null) {
            dataRenderer.render(buttonData, radioButton, false);
            preferredWidth += dataRenderer.getPreferredWidth(-1)
                + spacing * 2;

 
View Full Code Here

Examples of org.apache.pivot.wtk.RadioButton

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public int getBaseline(int width, int height) {
        RadioButton radioButton = (RadioButton)getComponent();

        int baseline = -1;

        Button.DataRenderer dataRenderer = radioButton.getDataRenderer();
        dataRenderer.render(radioButton.getButtonData(), radioButton, false);

        int clientWidth = Math.max(width - (BUTTON_DIAMETER + spacing), 0);
        baseline = dataRenderer.getBaseline(clientWidth, height);

        return baseline;
View Full Code Here

Examples of org.apache.pivot.wtk.RadioButton

        return baseline;
    }

    @Override
    public void paint(Graphics2D graphics) {
        RadioButton radioButton = (RadioButton)getComponent();
        int width = getWidth();
        int height = getHeight();

        // Paint the button
        int offset = (height - BUTTON_DIAMETER) / 2;
        graphics.translate(0, offset);
        paintButton(graphics, radioButton.isEnabled(), radioButton.isSelected());
        graphics.translate(0, -offset);

        // Paint the content
        Button.DataRenderer dataRenderer = radioButton.getDataRenderer();
        Object buttonData = radioButton.getButtonData();
        dataRenderer.render(buttonData, radioButton, false);
        dataRenderer.setSize(Math.max(width - (BUTTON_DIAMETER + spacing * 2), 0), height);

        Graphics2D contentGraphics = (Graphics2D)graphics.create();
        contentGraphics.translate(BUTTON_DIAMETER + spacing, 0);
        contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        // Paint the focus state
        if (radioButton.isFocused()) {
            if (buttonData == null) {
                Color focusColor = new Color(buttonSelectionColor.getRed(),
                    buttonSelectionColor.getGreen(),
                    buttonSelectionColor.getBlue(), 0x44);
                graphics.setColor(focusColor);
View Full Code Here

Examples of org.joshy.gfx.node.control.Radiobutton

        preview.setTranslateX(width-60).setTranslateY(0);
        add(preview);

        select = new ToggleGroup();

        hueSelect = new Radiobutton("H:");
        hueText = new Textbox();
        select.add(hueSelect);
        satSelect = new Radiobutton("S:");
        satText = new Textbox();
        select.add(satSelect);
        brightSelect = new Radiobutton("B:");
        brightText = new Textbox();
        select.add(brightSelect);
        redSelect = new Radiobutton("R:");
        redText = new Textbox();
        select.add(redSelect);
        greenSelect = new Radiobutton("G:");
        greenText = new Textbox();
        select.add(greenSelect);
        blueSelect = new Radiobutton("B:");
        blueText = new Textbox();
        select.add(blueSelect);
        hexText = new Textbox();
        GridBox selectors = new GridBox()
                .setPadding(0)
View Full Code Here

Examples of org.pdfclown.documents.interaction.forms.RadioButton

        new Point2D.Double(140, 168),
        AlignmentXEnum.Right,
        AlignmentYEnum.Middle,
        0
        );
      RadioButton field = new RadioButton(
        "myRadio",
        /*
          NOTE: A radio button field typically combines multiple alternative widgets.
        */
        new DualWidget[]
        {
          new DualWidget(
            page,
            new Rectangle(150, 150, 36, 36),
            "first"
            ),
          new DualWidget(
            page,
            new Rectangle(200, 150, 36, 36),
            "second"
            ),
          new DualWidget(
            page,
            new Rectangle(250, 150, 36, 36),
            "third"
            )
        },
        "second" // Selected item (it MUST correspond to one of the available widgets' names).
        ); // 4.1. Field instantiation.
      fields.add(field); // 4.2. Field insertion into the fields collection.
      fieldStyle.apply(field); // 4.3. Appearance style applied.
    }

    // 4.d. Text field.
    {
      composer.showText(
        "TextField:",
        new Point2D.Double(140, 218),
        AlignmentXEnum.Right,
        AlignmentYEnum.Middle,
        0
        );
      TextField field = new TextField(
        "myText",
        new Widget(
          page,
          new Rectangle(150, 200, 200, 36)
          ),
        "Carmen Consoli" // Current value.
        ); // 4.1. Field instantiation.
      field.setSpellChecked(false); // Avoids text spell check.
      FieldActions fieldActions = new FieldActions(document);
      field.setActions(fieldActions);
      fieldActions.setOnValidate(
        new JavaScript(
          document,
          "app.alert(\"Text '\" + this.getField(\"myText\").value + \"' has changed!\",3,0,\"Validation event\");"
          )
        );
      fields.add(field); // 4.2. Field insertion into the fields collection.
      fieldStyle.apply(field); // 4.3. Appearance style applied.

      {
        BlockComposer blockComposer = new BlockComposer(composer);
        blockComposer.begin(new Rectangle2D.Double(360,200,page.getSize().getWidth()-400,36),AlignmentXEnum.Left,AlignmentYEnum.Middle);
        composer.setFont(composer.getState().getFont(),7);
        blockComposer.showText("If you leave this text field after changing its content, a javascript action should prompt you an alert box responding to the validation event triggered by your PDF viewer.");
        blockComposer.end();
      }
    }

    // 4.e. Choice fields.
    {
      // Preparing the item list that we'll use for choice fields (a list box and a combo box (see below))...
      ChoiceItems items = new ChoiceItems(document);
      items.add(new ChoiceItem("Joan Baez")); // NOTE: Explicitly-created item.
      items.add("Tracy Chapman"); // NOTE: Implicitly-created item (syntactic sugar for lazy guys...).
      items.add("Carmen Consoli");
      items.add("Cristina Dona'");
      items.add("PJ Harvey");
      items.add("Billie Holiday");
      items.add("Janis Joplin");
      items.add("Angelique Kidjo");
      items.add("Joni Mitchell");
      items.add("Alanis Morissette");
      items.add("Yael Naim");
      items.add("Sinead O'Connor");
      items.add("Brisa Roche'");
      items.add("Nina Simone");
      items.add("Skin");
      items.add("Fatima Spar");
      items.add("Paola Turci");
      items.add("Sarah Vaughan");

      // 4.e1. List box.
      {
        composer.showText(
          "ListBox:",
          new Point2D.Double(140, 268),
          AlignmentXEnum.Right,
          AlignmentYEnum.Middle,
          0
          );
        ListBox field = new ListBox(
          "myList",
          new Widget(
            page,
            new Rectangle(150, 250, 200, 70)
            )
          ); // 4.1. Field instantiation.
        field.setItems(items); // List items assignment.
        field.setMultiSelect(false); // Multiple items may not be selected simultaneously.
        field.setValue("Carmen Consoli"); // Selected item.
        fields.add(field); // 4.2. Field insertion into the fields collection.
        fieldStyle.apply(field); // 4.3. Appearance style applied.
      }

      // 4.e2. Combo box.
      {
        composer.showText(
          "ComboBox:",
          new Point2D.Double(140, 350),
          AlignmentXEnum.Right,
          AlignmentYEnum.Middle,
          0
          );
        ComboBox field = new ComboBox(
          "myCombo",
          new Widget(
            page,
            new Rectangle(150, 334, 200, 36)
            )
          ); // 4.1. Field instantiation.
        field.setItems(items); // Combo items assignment.
        field.setEditable(true); // Text may be edited.
        field.setSpellChecked(false); // Avoids text spell check.
        field.setValue("Carmen Consoli"); // Selected item.
        fields.add(field); // 4.2. Field insertion into the fields collection.
        fieldStyle.apply(field); // 4.3. Appearance style applied.
      }
    }

View Full Code Here

Examples of org.spoutcraft.api.gui.RadioButton

      screen.attachWidget("Spoutcraft", message);

      //top += 47;
    }

    RadioButton button;
    button = (RadioButton) new FavorPerformanceButton("Favor Performance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER);
    button.setWidth(150).setHeight(20).setX(left).setY(top);
    button.setTooltip("Spoutcraft will attempt to provide smooth framerates, potentially at the cost of appearance.");
    screen.attachWidget("Spoutcraft", button);
    button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 0);

    button = (RadioButton) new OptimalGameplayButton("Balanced Gameplay", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER);
    button.setWidth(150).setHeight(20).setX(right).setY(top);
    button.setTooltip("Spoutcraft will attempt to provide reasonable framerates and appearance.");
    screen.attachWidget("Spoutcraft", button);
    button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 1);

    top += 22;

    button = (RadioButton) new FavorAppearanceButton("Favor Appearance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER);
    button.setWidth(150).setHeight(20).setX(left).setY(top);
    button.setTooltip("Spoutcraft will attempt to provide the best appearance, but potentially at the cost of framerates.");
    screen.attachWidget("Spoutcraft", button);
    button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 2);

    button = (RadioButton) new ManualSelectionButton("Manual Selection", message, parent).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER);
    button.setWidth(150).setHeight(20).setX(right).setY(top);
    button.setTooltip("Disable automatic performance settings and adjust the settings manually.");
    screen.attachWidget("Spoutcraft", button);
    button.setSelected(!Configuration.isAutomatePerformance());

    top += 22;

    linebreak = new GenericGradient();
    linebreak.setBottomColor(grey);
View Full Code Here

Examples of pivot.wtk.RadioButton

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        Component content =
            (Component)wtkxSerializer.readObject("pivot/tutorials/buttons/radio_buttons.wtkx");

        // Get a reference to the button group
        RadioButton oneButton =
            (RadioButton)wtkxSerializer.getObjectByName("oneButton");
        final Button.Group numbersGroup = oneButton.getGroup();

        // Add a button press listener
        PushButton selectButton =
            (PushButton)wtkxSerializer.getObjectByName("selectButton");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.