Package org.joshy.gfx.stage

Examples of org.joshy.gfx.stage.Stage


            System.out.println("frob: " + frob);
            final URL url = authInterface.buildAuthenticationUrl(Permission.DELETE, frob);
            System.out.println("Press return after you granted access at this URL:");
            System.out.println(url.toExternalForm());

            final Stage stage = Stage.createStage();
            stage.setContent(
                new GridBox()
                    .createColumn(50,GridBox.Align.Right)
                    .createColumn(50,GridBox.Align.Fill)
                    .addControl(new Label("Please visit Flickr and grant Leo access to your account"))
                    .nextRow()
                    .addControl(new Spacer())
                    .addControl(new Button("Goto Flickr").onClicked(new Callback<ActionEvent>() {
                        public void call(ActionEvent event) {
                            OSUtil.openBrowser(url.toExternalForm());
                        }
                    }))
                    .nextRow()
                    .addControl(new Button(getString("dialog.cancel")).onClicked(new Callback<ActionEvent>(){
                        public void call(ActionEvent event) {
                            stage.hide();
                        }
                    }))
                    .addControl(new Button("Continue >").onClicked(new Callback<ActionEvent>(){
                        public void call(ActionEvent event) {
                            stage.hide();
                            try {
                                Auth auth = authInterface.getToken(frob);
                                System.out.println("Authentication success");
                                // This token can be used until the user revokes it.
                                System.out.println("Token: " + auth.getToken());
                                String user_token = auth.getToken();
                                ChangeFlickrSettingsAction.this.context.getSettings().setProperty(FLICKR_USER_TOKEN,user_token);
                                String user_id = auth.getUser().getId();
                                ChangeFlickrSettingsAction.this.context.getSettings().setProperty(FLICKR_USER_ID,user_id);
                                System.out.println("nsid: " + auth.getUser().getId());
                                System.out.println("Realname: " + auth.getUser().getRealName());
                                System.out.println("Username: " + auth.getUser().getUsername());
                                System.out.println("Permission: " + auth.getPermission().getType());
                            } catch (FlickrException e) {
                                System.out.println("Authentication failed");
                                e.printStackTrace();
                            } catch (SAXException e) {
                                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                            } catch (IOException e) {
                                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                            }
                        }
                    }))
            );
            stage.setWidth(400);
            stage.setHeight(200);
        }
View Full Code Here


    public static void main(String ... args) throws Exception {
        Core.init();
        Core.getShared().defer(new Runnable() {
            public void run() {
                Stage stage = Stage.createStage();
                stage.setContent(new HSVColorPicker(null,150,150));
            }
        });

    }
View Full Code Here

        return "png";
    }


    public void execute() {
        final Stage stage = Stage.createStage();
        GridBox grid = new GridBox()
                .createColumn(20, GridBox.Align.Right)
                .createColumn(100, GridBox.Align.Left)
                ;
        final Checkbox backgroundCheckbox = new Checkbox("include background");
        grid.addControl(backgroundCheckbox);
        backgroundCheckbox.setSelected(includeBackground);
        grid.nextRow();
        final Checkbox documentBounds = new Checkbox("full document bounds");
        documentBounds.setSelected(includeDocumentBounds);
        grid.addControl(documentBounds);
        grid.nextRow();
        Button cancelButton = new Button("cancel");
        cancelButton.onClicked(new Callback<ActionEvent>() {
            public void call(ActionEvent actionEvent) throws Exception {
                stage.hide();
            }
        });
        grid.addControl(cancelButton);
        Button continueButton = new Button("continue");
        continueButton.onClicked(new Callback<ActionEvent>() {
            public void call(ActionEvent actionEvent) throws Exception {
                stage.hide();
                includeBackground = backgroundCheckbox.isSelected();
                includeDocumentBounds = documentBounds.isSelected();
                SavePNGAction.super.execute();
            }
        });
        grid.addControl(continueButton);
        stage.setContent(grid);
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        Core.init();
        Core.getShared().defer(new Runnable() {
            public void run() {
                Stage stage = Stage.createStage();
                stage.centerOnScreen();

                stage.setContent(setupMain());
                stage.setWidth(800);
                stage.setHeight(600);

                EventBus.getSystem().addListener(SystemMenuEvent.All, new Callback<SystemMenuEvent>() {
                    public void call(SystemMenuEvent systemMenuEvent) throws Exception {
                        if (systemMenuEvent.getType() == SystemMenuEvent.Quit) {
                            System.exit(0);
View Full Code Here

TOP

Related Classes of org.joshy.gfx.stage.Stage

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.