Examples of Widget


Examples of org.pdfclown.documents.interaction.annotations.Widget

        AlignmentXEnum.Right,
        AlignmentYEnum.Middle,
        0
        );

      Widget fieldWidget = new Widget(
        page,
        new Rectangle(150, 50, 136, 36)
        );
      WidgetActions fieldWidgetActions = new WidgetActions(fieldWidget);
      fieldWidget.setActions(fieldWidgetActions);
      fieldWidgetActions.setOnActivate(
        new JavaScript(
          document,
          "app.alert(\"Radio button currently selected: '\" + this.getField(\"myRadio\").value + \"'.\",3,0,\"Activation event\");"
          )
        );
      PushButton field = new PushButton(
        "okButton",
        fieldWidget,
        "Push" // Current value.
        ); // 4.1. Field instantiation.
      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(296,50,page.getSize().getWidth()-336,36),AlignmentXEnum.Left,AlignmentYEnum.Middle);
        composer.setFont(composer.getState().getFont(),7);
        blockComposer.showText("If you click this push button, a javascript action should prompt you an alert box responding to the activation event triggered by your PDF viewer.");
        blockComposer.end();
      }
    }

    // 4.b. Check box.
    {
      composer.showText(
        "CheckBox:",
        new Point2D.Double(140, 118),
        AlignmentXEnum.Right,
        AlignmentYEnum.Middle,
        0
        );
      CheckBox field = new CheckBox(
        "myCheck",
        new Widget(
          page,
          new Rectangle(150, 100, 36, 36)
          ),
        true // Current value.
        ); // 4.1. Field instantiation.
      fieldStyle.apply(field);
      fields.add(field);
      field = new CheckBox(
        "myCheck2",
        new Widget(
          page,
          new Rectangle(200, 100, 36, 36)
          ),
        true // Current value.
        ); // 4.1. Field instantiation.
      fieldStyle.apply(field);
      fields.add(field);
      field = new CheckBox(
        "myCheck3",
        new Widget(
          page,
          new Rectangle(250, 100, 36, 36)
          ),
        false // Current value.
        ); // 4.1. Field instantiation.
      fields.add(field); // 4.2. Field insertion into the fields collection.
      fieldStyle.apply(field); // 4.3. Appearance style applied.
    }

    // 4.c. Radio button.
    {
      composer.showText(
        "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.
View Full Code Here

Examples of org.sgx.yuigwt.yui.widget.Widget

      public void call(TabViewEvent e) {
       
        /* note e.newVal is the selected child widget - we cast directly.
         * @see http://yuilibrary.com/yui/docs/api/classes/WidgetParent.html#attr_selection
         */
        Widget selChild = e.newValObj().cast();
       
        int newTabIndex = selChild.getInt("index");
       
        console.log("tabview selectionChange: "+newTabIndex);
       
        history.addValue("tab", newTabIndex==0 ? null : newTabIndex+"");
      }
View Full Code Here

Examples of org.sonar.api.web.Dashboard.Widget

    addSecondColumn(dashboard);
    return dashboard;
  }

  private void addFirstColumn(Dashboard dashboard) {
    Widget timelineWidget = dashboard.addWidget("timeline", 1);
    timelineWidget.setProperty(METRIC1, CoreMetrics.COMPLEXITY_KEY);
    timelineWidget.setProperty(METRIC2, CoreMetrics.TECHNICAL_DEBT_KEY);
    timelineWidget.setProperty(METRIC3, CoreMetrics.COVERAGE_KEY);

    Widget sizeTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    sizeTimeMachineWidget.setProperty(METRIC1, CoreMetrics.NCLOC_KEY);
    sizeTimeMachineWidget.setProperty(METRIC2, CoreMetrics.LINES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC3, CoreMetrics.STATEMENTS_KEY);
    sizeTimeMachineWidget.setProperty(METRIC4, CoreMetrics.FILES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC5, CoreMetrics.CLASSES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC6, CoreMetrics.FUNCTIONS_KEY);
    sizeTimeMachineWidget.setProperty(METRIC7, CoreMetrics.ACCESSORS_KEY);

    Widget commentsTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    commentsTimeMachineWidget.setProperty(METRIC1, CoreMetrics.COMMENT_LINES_DENSITY_KEY);
    commentsTimeMachineWidget.setProperty(METRIC2, CoreMetrics.COMMENT_LINES_KEY);
    commentsTimeMachineWidget.setProperty(METRIC3, CoreMetrics.PUBLIC_DOCUMENTED_API_DENSITY_KEY);
    commentsTimeMachineWidget.setProperty(METRIC4, CoreMetrics.PUBLIC_UNDOCUMENTED_API_KEY);

    Widget duplicationTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    duplicationTimeMachineWidget.setProperty(METRIC1, CoreMetrics.DUPLICATED_LINES_DENSITY_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC2, CoreMetrics.DUPLICATED_LINES_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC3, CoreMetrics.DUPLICATED_BLOCKS_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC4, CoreMetrics.DUPLICATED_FILES_KEY);
  }
View Full Code Here

Examples of org.spout.api.gui.Widget

    this.offset = offset;
    widgets = new Widget[positions.length];
    for (int i = 0; i < widgets.length; i++) {
      final RenderSlot slot;
      if (VanillaPlugin.getInstance().getEngine() instanceof Client) {
        Widget widget = widgets[i] = ((Client) VanillaPlugin.getInstance().getEngine()).getScreenStack().createWidget();
        slot = widget.add(RenderSlot.class);
        slot.setPosition(positions[i]);
      } else {
        slot = new RenderSlot();
      }
      slot.setSlot(new Slot(inventory, i));
View Full Code Here

Examples of org.spoutcraft.api.gui.Widget

  public void run(int playerId) {
    InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen();
    PopupScreen popup = mainScreen.getActivePopup();

    Widget w = PacketWidget.allWidgets.get(widget);

    if (w != null && w.getScreen() != null && !(w instanceof Screen)) {
      w.getScreen().removeWidget(w);
    }

    if (w instanceof PopupScreen && popup.getId().equals(w.getId())) {
      // Determine if this is a popup screen and if we need to update it
      mainScreen.closePopup();
    }

    PacketWidget.allWidgets.remove(widget);
View Full Code Here

Examples of org.springframework.richclient.widget.Widget

     *
     * Open de dataeditor.
     */
    protected void doExecuteCommand()
    {
        Widget widget = super.getWidget();
        Assert.isInstanceOf(AbstractDataEditorWidget.class, widget);
        AbstractDataEditorWidget dataEditorWidget = (AbstractDataEditorWidget)widget;
        Object dataEditorParameters = getParameter(DefaultDataEditorWidget.PARAMETER_MAP);
        if(dataEditorParameters != null)
        {
View Full Code Here

Examples of org.xith3d.ui.hud.base.Widget

        hourglass.setLocation(41.0f, 446.0f);
        hourglass.setVisible(false);
        hud.getContentPane().addWidget(hourglass);
       
        // Add a xith3d logo
        Widget xithLogo = new Image(100f, 100f, (Texture2D)ResBag.getTexture(ResourceNames.XITH3DLOGO));
        hud.getContentPane().addWidget(xithLogo);
        xithLogo.setLocation(680.29926f,26.688633f);
        xithLogo.setSize(101.99501f,72.32291f);
       
    }
View Full Code Here

Examples of org.zkoss.ztl.Widget

    waitResponse();
    click(jq("$confirmRenameBtn td.z-button-cm"));
    waitResponse();
   
    //verify
    Widget debtSibling = widget(jq("@tab[label=\"Debt\"]")).nextSibling();
    String content = jq(debtSibling).find("span").text();   
    verifyEquals("my Sheet", content);   
  }
View Full Code Here

Examples of ro.fortsoft.wicket.dashboard.Widget

        item.add(new AjaxCheckBox("display", Model.of(isDisplayed(wd) != null)) {
          private static final long serialVersionUID = -7079665921153653164L;

          @Override
          protected void onUpdate(AjaxRequestTarget target) {
            Widget w = isDisplayed(wd);
            boolean b = getModelObject();
            DashboardContext dashboardContext = getDashboardContext();
            Dashboard d = getDashboard();
            if (w != null && !b) {
              d.deleteWidget(w.getId());
            }
            if (w == null && b) {
              d.addWidget(dashboardContext.getWidgetFactory().createWidget(wd));
            }
            dashboardContext.getDashboardPersiter().save(d);
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.widgets.Widget

    // all instantiated widgets
    try {
      RepeatingView repeating = new RepeatingView("instantiatedWidgets");
      Iterator<Widget> itr = wookieServerConnection.getAvailableWidgets()
          .values().iterator();
      Widget widget;
      while (itr.hasNext()) {
        widget = itr.next();
        Iterator<WidgetInstance> instances = widget.getInstances().iterator();
        while (instances.hasNext()) {
          WidgetInstance instance = instances.next();
          WebMarkupContainer item = new WebMarkupContainer(repeating
              .newChildId());
          repeating.add(item);
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.