PDA

View Full Version : [FIXED] [WARN] invoke arguments: Rounding double to int for int



misqu
31 May 2009, 8:29 AM
Hi

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


[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 :


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

sven
31 May 2009, 8:40 AM
I cant reproduce this with desktop sample. Can you please provide some complete testcase that is demonstratiting this?

misqu
31 May 2009, 9:00 AM
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 :



<?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 :



<!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 :



* {
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 :



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 :



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();
}

misqu
31 May 2009, 9:07 AM
I have forgotten to mention that I'm using eclipse 3.4 with google eclipse plugin. My OS is Ubuntu 9.04

sven
31 May 2009, 9:20 AM
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

misqu
31 May 2009, 9:33 AM
Ok. I will reproduce such testcase.

sven
31 May 2009, 9:34 AM
Do you get any other information with that warning? Do you also get the warning in the desktop sample that is shipped with GXT?

misqu
31 May 2009, 12:28 PM
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:



[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 :



<!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 :



<?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 :



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.

sven
6 Jun 2009, 7:04 AM
That issue is already fixed in SVN. Also this is a prerelease. Not a stable one.

misqu
10 Jul 2009, 1:57 PM
Hi

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

sven
10 Jul 2009, 2:00 PM
We are unable to reproduce this warnings. Can you reproduce this with running the desktop sample in hostedmode without custom code?

misqu
10 Jul 2009, 2:52 PM
Yes I can.

It happens when I move the mouse over any of the StartMenu items (Logout, Setting, Grid Window, Tab Window etc.)

The same is with explorer example, when the mouse is over any of the navigation elements it triggers this warning.

misqu
10 Jul 2009, 3:09 PM
I have changed the log level to the ALL.
But unfortunately there is no more information where it comes from.

sven
10 Jul 2009, 4:41 PM
I found the issue. Firefox returns half pixel on some Firefox specific methods.

I run HostedMode windows and that is IE. That is why i wasnt able to catch this.

sven
10 Jul 2009, 5:02 PM
Fixed in SVN.

Can you please validate this?

misqu
11 Jul 2009, 6:20 AM
Yes I can validate this.

But I think that change isn't in trunk. Last revision of trunk is 1619. Where can I find the change.

sven
11 Jul 2009, 6:21 AM
Fixes for 2.0 are under "releases/2.0". Trunk is 2.1

misqu
11 Jul 2009, 10:14 AM
Unfortunately problem still exists in Explorer and Desktop sample as well. I can help in debugging, but give me advice where to put breakpoints.

I've also notice that file with polish translation is empty. Something went wrong when you updated the translation.

I'd like to ask when it will be possible to switch to trunk version. Will you give us some notice that you started to work on GXT 2.1 version. My system is still in production that's why I use trunk version.

sven
11 Jul 2009, 10:20 AM
I just fixed the translation file.

It is quite hard to track that down. So it is also hard to say where to set brackpoints.

misqu
22 Jul 2009, 1:45 PM
When I switched to GWT 1.7 I get no warnings, so it seems that this issue is fixed :)