Package com.google.gwt.event.dom.client

Examples of com.google.gwt.event.dom.client.ClickHandler


    leftLayout.add(new HTML("<h3>Drawing options:</h3>"));

    Button circleBtn = new Button("Draw circle");
    circleBtn.setWidth("200");
    circleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Circle circle = new Circle(0, 0, 3000000);
        circle.setFillColor("#66CC66");
        circle.setFillOpacity(0.4);
        container.add(circle);
      }
    });
    leftLayout.add(circleBtn);

    Button deleteBtn = new Button("Delete all drawings");
    deleteBtn.setWidth("200");
    deleteBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        container.clear();
      }
    });
View Full Code Here


    leftLayout.add(new HTML("<h3>Drawing options:</h3>"));

    Button rectangleBtn = new Button("Draw rectangle");
    rectangleBtn.setWidth("200");
    rectangleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Rectangle rectangle = new Rectangle(60, 40, 200, 80);
        rectangle.setFillColor("#CC9900");
        rectangle.setFillOpacity(0.4);
        container.add(rectangle);
      }
    });
    leftLayout.add(rectangleBtn);

    Button textBtn = new Button("Draw text");
    textBtn.setWidth("200");
    textBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Text text = new Text(70, 60, "Hello World");
        text.setFontFamily("Arial");
        text.setFontSize(16);
        text.setStrokeOpacity(0);
        text.setFillColor("#000000");
        container.add(text);
      }
    });
    leftLayout.add(textBtn);

    Button circleBtn = new Button("Draw circle");
    circleBtn.setWidth("200");
    circleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Circle circle = new Circle(300, 140, 30);
        circle.setFillColor("#0099CC");
        circle.setFillOpacity(0.4);
        container.add(circle);
      }
    });
    leftLayout.add(circleBtn);

    Button pathBtn = new Button("Draw path");
    pathBtn.setWidth("200");
    pathBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Path path = new Path(120, 160);
        path.setFillColor("#0066AA");
        path.setFillOpacity(0.4);
        path.setStrokeColor("#004499");
        path.lineRelativelyTo(100, 0);
        path.lineRelativelyTo(0, 100);
        path.lineRelativelyTo(-100, 0);
        path.lineRelativelyTo(0, -100);
        path.moveTo(140, 180);
        path.lineRelativelyTo(50, 0);
        path.lineRelativelyTo(0, 50);
        path.lineRelativelyTo(-50, 0);
        path.lineRelativelyTo(0, -50);
        container.add(path);
      }
    });
    leftLayout.add(pathBtn);

    Button deleteBtn = new Button("Delete all drawings");
    deleteBtn.setWidth("200");
    deleteBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        container.clear();
      }
    });
View Full Code Here

            updateRectangle(event);
          }
          event.stopPropagation();
        }
      });
      eventCatcher.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
          event.stopPropagation();
        }
      });
View Full Code Here

    leftLayout.add(new HTML("<h3>Resize the map:</h3>"));

    Button resizeBtn = new Button("Enlarge map");
    resizeBtn.setWidth("200");
    resizeBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        int width = mapPresenter.getViewPort().getMapWidth() + 20;
        int height = mapPresenter.getViewPort().getMapHeight() + 15;
        mapPresenter.setSize(width, height);
      }
    });
    leftLayout.add(resizeBtn);

    Button shrinkBtn = new Button("Shrink map");
    shrinkBtn.setWidth("200");
    shrinkBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        int width = mapPresenter.getViewPort().getMapWidth() - 20;
        int height = mapPresenter.getViewPort().getMapHeight() - 15;
        mapPresenter.setSize(width, height);
View Full Code Here

    @Override
    public void onModuleLoad() {
    
        Button button = new Button("Broadcast");
        button.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                sendMessage();
            }
        });
       
        Button post = new Button("Post");
        post.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                client.post(new Event(count++, "This was send using the post mechanism"));
            }
        });
       
        Button pollButton = new Button("Poll");
        pollButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                polling.pollDelayed(3000, new AsyncCallback<Event>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        GWT.log("Failed to poll", caught);
                    }

                    @Override
                    public void onSuccess(Event result) {
                        Info.display("Polling message received: " + result.getCode(), result.getData());
                    }
                });
            }
        });

        Button wnd = new Button("Open Window");
        wnd.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                    @Override
                    public void execute() {
                        screen = Window.current().open(Document.get().getURL(), "child", new WindowFeatures().setStatus(true).setResizable(true));
                    }
                });
            }
        });

        Button sendWindow = new Button("Send to window");
        sendWindow.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (screen != null) {
                    WindowSocket.post(screen, "wsock", "Hello Child!");
                }
            }
        });

        WindowSocket socket = new WindowSocket();
        socket.addHandler(new WindowSocket.MessageHandler() {
            @Override
            public void onMessage(String message) {
                Info.display("Received through window socket", message);
            }
        });
        socket.bind("wsock");
       
        RootPanel.get("buttons").add(button);
        RootPanel.get("buttons").add(post);
        RootPanel.get("buttons").add(pollButton);
        RootPanel.get("buttons").add(wnd);
        RootPanel.get("buttons").add(sendWindow);

        initialize();

        Button killbutton = new Button("Stop");
        killbutton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                client.stop();
            }
        });
View Full Code Here

        this.uuid = uuid;
        this.isPackage = isPackage;

        HorizontalPanel wrapper = new HorizontalPanel();

        ClickHandler clickHandler = new ClickHandler() {

            public void onClick( ClickEvent event ) {
                clickLoadHistory();
            }
        };
View Full Code Here

                                0,
                                2 );

                        Button open = new Button( constants.View() );

                        open.addClickHandler( new ClickHandler() {

                            public void onClick( ClickEvent event ) {
                                showVersion( history.getValue( history.getSelectedIndex() ) );
                            }
View Full Code Here

                                            asset.getVersionNumber(),
                                            asset.getName() ),
                                    new Integer( 800 ) );

                            Button restore = new Button( constants.RestoreThisVersion() );
                            restore.addClickHandler( new ClickHandler() {

                                public void onClick( ClickEvent event ) {
                                    restore( (Widget) event.getSource(),
                                            versionUUID,
                                            new Command() {
View Full Code Here

        return box;
    }

    private Widget choice() {
        Image clickme = new Image( images.edit() );
        clickme.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                showTypeChoice( (Widget) event.getSource() );
            }
        } );
View Full Code Here

    protected void showTypeChoice(Widget w) {
        final FormStylePopup form = new FormStylePopup( images.newexWiz(),
                                                        constants.FieldValue() );
        Button lit = new Button( constants.LiteralValue() );
        lit.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                methodParameter.nature = FieldNature.TYPE_LITERAL;
                methodParameter.value = " ";
                makeDirty();
                refresh();
                form.hide();
            }

        } );

        form.addAttribute( constants.LiteralValue() + ":",
                           widgets( lit,
                                    new InfoPopup( constants.Literal(),
                                                   constants.LiteralValTip() ) ) );
        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( constants.AdvancedSection() ) );

        /*
         * If there is a bound variable that is the same type of the current
         * variable type, then show abutton
         */
        List<String> vars = model.getModel().getLHSBoundFacts();
        List<String> vars2 = model.getModel().getRHSBoundFacts();
        for ( String i : vars2 ) {
            vars.add( i );
        }
        for ( String v : vars ) {
            boolean createButton = false;
            Button variable = new Button( constants.BoundVariable() );
            if ( vars2.contains( v ) == false ) {
                FactPattern factPattern = model.getModel().getLHSBoundFact( v );
                if ( factPattern.getFactType().equals( this.parameterType ) ) {
                    createButton = true;
                }
            } else {
                ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v );
                if ( factPattern.factType.equals( this.parameterType ) ) {
                    createButton = true;
                }
            }
            if ( createButton == true ) {
                form.addAttribute( constants.BoundVariable() + ":",
                                   variable );
                variable.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        methodParameter.nature = FieldNature.TYPE_VARIABLE;
                        methodParameter.value = "=";
                        makeDirty();
View Full Code Here

TOP

Related Classes of com.google.gwt.event.dom.client.ClickHandler

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.