Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: [FIXED] [WARN] invoke arguments: Rounding double to int for int

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default [FIXED] [WARN] invoke arguments: Rounding double to int for int

    Hi

    When I move mouse over the tool item in the StartMenu I get following warning in the hosted mode:
    Code:
    [WARN] invoke arguments: Rounding double to int for int
    [WARN] invoke arguments: Rounding double to int for int
    Menu creation is very simple it has only one item :
    Code:
        protected void onInit(AppEvent event) {
            User user = (User)Registry.get(GlobalRegistryKeys.CurrentUser);
            startMenu.setHeading(user.getLogin());
            
            MenuItem logout = new MenuItem(mainMessages.pro_user_logout(user.getLogin()),icons.logout());
            logout.addSelectionListener(new SelectionListener<MenuEvent>() {
                @Override
                public void componentSelected(MenuEvent me) {
                    Dispatcher.forwardEvent(GlobalApplicationEvents.Logout);
                }
            });
            startMenu.addTool(logout);
        }
    I'm using latest build from svn revision 1492, but the same occured on 2.0-m1 and 2.0-m2 builds.


    Thanks

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    I cant reproduce this with desktop sample. Can you please provide some complete testcase that is demonstratiting this?

  3. #3
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default

    Quote Originally Posted by sven View Post
    I cant reproduce this with desktop sample. Can you please provide some complete testcase that is demonstratiting this?
    Of course.

    I removed from the code all other application logic, so desktop has only logout item, but the problem still exists.

    Here is my gwt.xml :

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
    <module rename-to="pro">
        <inherits name="pl.scentia.smartoffice.apps.modules.Modules"/>  
        <inherits name="com.extjs.gxt.themes.Themes"/>
        <inherits name="com.extjs.gxt.desktop.WebDesktop"/>
            
        <entry-point class="pl.scentia.smartoffice.apps.pro.client.Pro"/>
         <set-property name="user.agent" value="gecko"/>
    </module>
    html page :

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html;charset=utf-8" />
            <title>SmartOffice</title>
            <script type="text/javascript">
                function getCookie(name) {
                    var dc = document.cookie;
                    var prefix = name + "=";
                    var begin = dc.indexOf("; " + prefix);
                    if (begin == -1) {
                        begin = dc.indexOf(prefix);
                        if (begin != 0) return null;
                    } else {
                        begin += 2;
                    }
                    var end = dc.indexOf(";", begin);
                    if (end == -1) {
                        end = dc.length;
                    }
                    return (decodeURIComponent(dc.substring(begin + prefix.length, end)).split(':'))[1];
                }
                var locale=getCookie("locale");
                if (locale!=null && locale!="") {
                    document.writeln("<meta name=\"gwt:property\" content=\"locale="+locale+"\"> ");
                } else {
                    document.writeln("<meta name=\"gwt:property\" content=\"locale=pl_PL\"> ");
                }
            </script>
            <link rel="icon" type="image/x-icon" href="resources/images/icons/favicon.ico">
            <link rel="stylesheet" type="text/css" href="gxt/css/gxt-all.css" />
            <link rel="stylesheet" type="text/css" href="gxt/desktop/css/desktop.css" />
            <link rel="stylesheet" type="text/css" href="resources/css/resources.css" />
            <script type="text/javascript" language="javascript" src="pro/pro.nocache.js" ></script>
            <style>
                #loading {
                    position: absolute;
                    left: 45%;
                    top: 40%;
                    margin-left: -45px;
                    padding: 2px;
                    z-index: 20001;
                    height: auto;
                }
                #loading .loading-indicator {
                    background: transparent;
                    padding: 5px;
                    margin: 0;
                    height: auto;
                }
            </style>
        </head>
        <body style="overflow: hidden">
            <div id="loading">
                <div class="loading-indicator">
                    <a href="http://www.scentia.pl" style="display: block"><img src="resources/images/logo.png" style="margin-right: 10px" width="142" height="42"/><img src="gxt/images/default/shared/large-loading.gif" style="margin-bottom: 5px" width="32" height="32"/></a>
                </div>
            </div>
            <div id="x-desktop">
                <a href="http://www.scentia.pl" target="_blank" style="margin:5px; float:right;"><img src="gxt/desktop/images/powered.gif" /></a>
                <dl id="x-shortcuts">
                </dl>
            </div>
            <iframe src="javascript:''" tabindex="-1"  id="__gwt_historyFrame"  style="position:absolute;width:0;height:0;border:0"></iframe>
        </body>
    </html>
    resources.css is fairly simply :

    Code:
    * {
        margin: 0px;
        padding: 0px;
        font-family: arial, helvetica, tahoma, sans-serif;
        font-size: 11px;
    }
    .icon-user {
        background: url(../images/icons/user.png) no-repeat !important;
    }
    It has icon-user class style declaration because in StartMenu I can set up heading icon only through style class. But I hope it will change in the future and I could be using ImageBundle as with Buttons


    Pro.java entry point :

    Code:
    package pl.scentia.smartoffice.apps.pro.client; 
     
    import pl.scentia.smartoffice.apps.modules.client.mvc.GlobalApplicationEvents; 
    import pl.scentia.smartoffice.apps.modules.client.mvc.ModulesEvents; 
    import pl.scentia.smartoffice.apps.pro.client.mvc.ApplicationController; 
    import pl.scentia.smartoffice.apps.pro.client.mvc.ApplicationView; 
    import pl.scentia.smartoffice.apps.pro.client.mvc.DesktopController; 
    import pl.scentia.smartoffice.apps.pro.client.mvc.ShortcutController; 
    import pl.scentia.smartoffice.apps.pro.client.mvc.StartMenuController; 
    import pl.scentia.smartoffice.gui.resources.client.MainMessages; 
     
    import com.extjs.gxt.desktop.client.Desktop; 
    import com.extjs.gxt.ui.client.GXT; 
    import com.extjs.gxt.ui.client.Registry; 
    import com.extjs.gxt.ui.client.event.MvcEvent; 
    import com.extjs.gxt.ui.client.mvc.Dispatcher; 
    import com.extjs.gxt.ui.client.mvc.DispatcherListener; 
    import com.extjs.gxt.ui.client.util.Theme; 
    import com.google.gwt.core.client.EntryPoint; 
    import com.google.gwt.core.client.GWT; 
    import com.google.gwt.user.client.Window; 
     
    public class Pro implements EntryPoint { 
         
        private MainMessages mainMessages = GWT.create(MainMessages.class); 
         
        public void onModuleLoad() { 
             
            Window.setTitle(mainMessages.pro_Window_title()); 
            GXT.setDefaultTheme(Theme.BLUE, false); 
            GXT.hideLoadingPanel("loading"); 
             
            Dispatcher dispatcher = Dispatcher.get(); 
            dispatcher.addController(new ApplicationController()); 
            dispatcher.addController(new DesktopController()); 
            dispatcher.addController(new StartMenuController()); 
            dispatcher.addController(new ShortcutController()); 
            dispatcher.addDispatcherListener(new DispatcherListener(){ 
                @Override 
                public void afterDispatch(MvcEvent mvce) { 
                    if (mvce.getAppEvent().getType() == GlobalApplicationEvents.ApplicationInit) { 
                        Dispatcher.forwardEvent(GlobalApplicationEvents.ModulesInit); 
                    } else if (mvce.getAppEvent().getType() == ModulesEvents.InitHooks) { 
                        Dispatcher.forwardEvent(GlobalApplicationEvents.GuiInit); 
                    } else if (mvce.getAppEvent().getType() == GlobalApplicationEvents.GuiInit) { 
                        Desktop d = Registry.get(ApplicationView.Desktop); 
                        d.getDesktop().layout(true); 
                        d.getTaskBar().layout(true); 
                    } 
                } 
            }); 
             
            dispatcher.dispatch(GlobalApplicationEvents.Login); 
        }     
    }
    and StartMenuView.java :

    Code:
    package pl.scentia.smartoffice.apps.pro.client.mvc; 
     
    import java.util.List; 
     
    import pl.scentia.smartoffice.apps.modules.client.mvc.Entry; 
    import pl.scentia.smartoffice.apps.modules.client.mvc.GlobalApplicationEvents; 
    import pl.scentia.smartoffice.apps.modules.client.mvc.GlobalRegistryKeys; 
    import pl.scentia.smartoffice.apps.modules.client.mvc.NavigationModel; 
    import pl.scentia.smartoffice.gui.resources.client.MainMessages; 
    import pl.scentia.smartoffice.gui.resources.client.images.IconImages; 
    import pl.scentia.smartoffice.persistence.pojo.User; 
     
    import com.extjs.gxt.desktop.client.StartMenu; 
    import com.extjs.gxt.ui.client.Registry; 
    import com.extjs.gxt.ui.client.data.ModelData; 
    import com.extjs.gxt.ui.client.data.TreeModel; 
    import com.extjs.gxt.ui.client.event.MenuEvent; 
    import com.extjs.gxt.ui.client.event.SelectionListener; 
    import com.extjs.gxt.ui.client.mvc.AppEvent; 
    import com.extjs.gxt.ui.client.mvc.Controller; 
    import com.extjs.gxt.ui.client.mvc.Dispatcher; 
    import com.extjs.gxt.ui.client.mvc.View; 
    import com.extjs.gxt.ui.client.widget.menu.Menu; 
    import com.extjs.gxt.ui.client.widget.menu.MenuItem; 
    import com.google.gwt.core.client.GWT; 
     
    public class StartMenuView extends View { 
     
        private StartMenu startMenu; 
        private MainMessages mainMessages = GWT.create(MainMessages.class); 
        private IconImages icons = GWT.create(IconImages.class); 
         
        public StartMenuView(Controller controller) { 
            super(controller); 
        } 
     
        @Override 
        protected void initialize() { 
            super.initialize(); 
            startMenu = (StartMenu) Registry.get(ApplicationView.StartMenu); 
        } 
     
        @Override 
        protected void handleEvent(AppEvent event) { 
            if (event.getType() == GlobalApplicationEvents.GuiInit) 
                onInit(event); 
        } 
     
        protected void onInit(AppEvent event) { 
            User user = (User)Registry.get(GlobalRegistryKeys.CurrentUser); 
            startMenu.setIconStyle("icon-user"); 
            startMenu.setHeading(user.getLogin()); 
             
            MenuItem logout = new MenuItem(mainMessages.pro_user_logout(user.getLogin()),icons.logout()); 
            logout.addSelectionListener(new SelectionListener<MenuEvent>() { 
                @Override 
                public void componentSelected(MenuEvent me) { 
                    Dispatcher.forwardEvent(GlobalApplicationEvents.Logout); 
                } 
            }); 
            startMenu.addTool(logout); 
            startMenu.syncSize(); 
        }

  4. #4
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default

    I have forgotten to mention that I'm using eclipse 3.4 with google eclipse plugin. My OS is Ubuntu 9.04

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    I am unable to run that example as i am missing a couple of classes. Please see this post: http://www.extjs.com/forum/showthread.php?t=40289

  6. #6
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default

    Ok. I will reproduce such testcase.

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Do you get any other information with that warning? Do you also get the warning in the desktop sample that is shipped with GXT?

  8. #8
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default

    Quote Originally Posted by sven View Post
    Do you get any other information with that warning? Do you also get the warning in the desktop sample that is shipped with GXT?
    I haven't tested this in the desktop sample shipped with GXT. Is there any ant target that runs samples with hosted mode ?

    I get only this warning. But this warning always appears twice.

    I also get warning about problem with parsing web.xml file but this is not related to this problem.

    Here is the full problem description following this http://www.extjs.com/forum/showthread.php?t=40289 guidelines :

    When I move mouse over the tool item in the StartMenu I get following warning in the hosted mode:

    Code:
    [WARN] invoke arguments: Rounding double to int for int
    [WARN] invoke arguments: Rounding double to int for int
    My GXT version is revision 1492. The same problem existed in 2.0-m1 and 2.0-m2 builds.
    My GWT version is 1.6.4.
    Problem occurs in the hosted mode.

    My operating system is Ubuntu 9.04 so the browser is mozilla which is shipped with linux distribution of GWT.

    I'm using Eclipse 3.4.2 and Google Eclipse Plugin 1.0.1. with GWT SDK for Linux Plugin ver. 1.6.4

    Here is my sample code.

    test.html :

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html;charset=utf-8" />
            <title>SmartOffice</title>
            <link rel="stylesheet" type="text/css" href="gxt/css/gxt-all.css" />
            <link rel="stylesheet" type="text/css" href="gxt/desktop/css/desktop.css" />
            <script type="text/javascript" language="javascript" src="test/test.nocache.js" ></script>
            <style>
                #loading {
                    position: absolute;
                    left: 45%;
                    top: 40%;
                    margin-left: -45px;
                    padding: 2px;
                    z-index: 20001;
                    height: auto;
                }
                #loading .loading-indicator {
                    background: transparent;
                    padding: 5px;
                    margin: 0;
                    height: auto;
                }
            </style>
        </head>
        <body style="overflow: hidden">
            <div id="loading">
                <div class="loading-indicator">
                    <a href="http://www.scentia.pl" style="display: block"><img src="resources/images/logo.png" style="margin-right: 10px" width="142" height="42"/><img src="gxt/images/default/shared/large-loading.gif" style="margin-bottom: 5px" width="32" height="32"/></a>
                </div>
            </div>
            <div id="x-desktop">
                <a href="http://www.scentia.pl" target="_blank" style="margin:5px; float:right;"><img src="gxt/desktop/images/powered.gif" /></a>
                <dl id="x-shortcuts">
                </dl>
            </div>
            <iframe src="javascript:''" tabindex="-1"  id="__gwt_historyFrame"  style="position:absolute;width:0;height:0;border:0"></iframe>
        </body>
    </html>
    Test.gwt.xml :

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
    <module rename-to="test">
        <inherits name="com.extjs.gxt.themes.Themes"/>
        <inherits name="com.extjs.gxt.desktop.WebDesktop"/>
            
        <entry-point class="pl.scentia.smartoffice.apps.test.client.Test"/>
         <set-property name="user.agent" value="gecko"/>
    </module>
    Test.java :

    Code:
    package pl.scentia.smartoffice.apps.test.client;
    
    import com.extjs.gxt.desktop.client.Desktop;
    import com.extjs.gxt.desktop.client.StartMenu;
    import com.extjs.gxt.ui.client.GXT;
    import com.extjs.gxt.ui.client.util.Theme;
    import com.extjs.gxt.ui.client.widget.menu.MenuItem;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Window;
    
    public class Test implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
            Window.setTitle("title");
            GXT.setDefaultTheme(Theme.BLUE, false);
            GXT.hideLoadingPanel("loading");
    
            Desktop desktop = new Desktop();
            StartMenu menu = desktop.getStartMenu();
            MenuItem logout = new MenuItem("logout");
            menu.addTool(logout);
    
        }
    
    }
    I don't know if it's related to this problem but also the StartMenu button looks strange, here is the screenshot.
    Attached Images Attached Images

  9. #9
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    That issue is already fixed in SVN. Also this is a prerelease. Not a stable one.

  10. #10
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42

    Default Unfortunately warning still appears

    Hi

    I'm using now final release 2.0 and warning still appears.
    Even in this simple test example which I have already posted.
    Marcin Misiewicz

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •