This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 »
376
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 10, 2014, 12:57:18 pm »You could also try changing uhm setFocusTraversalPolicy of the toolbar.
Interesting. Within LateralGm, in the main method i've added the following code after the creation of the JFrame (line 843) :
Code: [Select]
final Container contentPane = LGM.frame.getContentPane();
Comparator<Component> comp = new Comparator<Component>() {
public int compare(Component c1, Component c2) {
Component comps[] = contentPane.getComponents();
List<Component> list = Arrays.asList(comps);
int first = list.indexOf(c1);
int second = list.indexOf(c2);
return second - first;
}
};
FocusTraversalPolicy policy = new SortingFocusTraversalPolicy(comp);
frame.setFocusTraversalPolicy(policy);I've found the code here : http://www.java2s.com/Code/JavaAPI/java.awt/ContainersetFocusTraversalPolicyFocusTraversalPolicypolicy.htm
I don't have anymore the error, and the focus traversal policy seems to work. However on the toolbar it doesn't seem to work anymore, but from my points of view it's not important. But is it the best way to fix this error ? I don't know. (At least the useLegacyMergeSort was only one line of code).
377
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 10, 2014, 11:09:15 am »
By the way, i invite you to attend to my Ph.D. defense. It will happen in M.I.T on June 2034, and the title is :
" In Java, how to insert a component in a toolbar : a 20-year study ! "
" In Java, how to insert a component in a toolbar : a 20-year study ! "
378
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 10, 2014, 04:16:46 am »
For the moment i see two solutions :
1) Creation of the Build menu in LateralGM. If the plugin is successfully loaded, LateralGM loads the menu and the toolbar. Everytime a menu or button is clicked, the plugin functions are called.
2) Using the following line :
I don't see any problem using the UseLEgacyMergeSort property. I think it is the easiest solution.
Edit:
3) I've seen the following code, in EnigmaRunner.java, in method subFrameAppeared :
What about using this instead of Separator ?
Edit2:
If i use :
Instead of
Same error. So the error is not only happening with Separator.
Edit3:
If i add a JButton at position 8, the error happens also ! Too weird !.
1) Creation of the Build menu in LateralGM. If the plugin is successfully loaded, LateralGM loads the menu and the toolbar. Everytime a menu or button is clicked, the plugin functions are called.
2) Using the following line :
Code: [Select]
System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");I don't see any problem using the UseLEgacyMergeSort property. I think it is the easiest solution.
Edit:
3) I've seen the following code, in EnigmaRunner.java, in method subFrameAppeared :
Code: [Select]
status.add(new JLabel(" | ")); //$NON-NLS-1$
//visible divider ^ since JSeparator isn't visible and takes up the whole thing...What about using this instead of Separator ?
Edit2:
If i use :
Code: [Select]
LGM.tool.add(new JLabel(" "), 8);Instead of
Code: [Select]
LGM.tool.add(new JToolBar.Separator(), 8);Same error. So the error is not only happening with Separator.
Edit3:
If i add a JButton at position 8, the error happens also ! Too weird !.
379
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 09, 2014, 02:49:18 pm »
The error is still here.
In EnigmaRunner.java, the error comes now from :
When we want to add a component in a toolbar at a given position, it seems to accept any component except a separator ! It doesn't trigger an error if you don't specify the position :
But of course, we don't want to add the separator at the end of the toolbar. I don't have for the moment a solution (Except the 'useLegacyMergeSort'
).
Update :
Java :"Write once, run anywhere" Write once, test everywhere
In EnigmaRunner.java, the error comes now from :Code: [Select]
LGM.tool.add(new JToolBar.Separator(), 8);When we want to add a component in a toolbar at a given position, it seems to accept any component except a separator ! It doesn't trigger an error if you don't specify the position :
Code: [Select]
LGM.tool.addSeparator();But of course, we don't want to add the separator at the end of the toolbar. I don't have for the moment a solution (Except the 'useLegacyMergeSort'
).Update :
Java :
380
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 08, 2014, 07:37:31 am »No that separator is definitely there, it is the separator on the toolbar directly after the create executable button. However it was being positioned improperly, I have now fixed that.
Try again by manually replacing the plugin jar or run python install.py
http://www.enigma-dev.org/docs/Wiki/Install:Extra_Packages
Thanks Robert. I am traveling right now and i will test it next week.
381
Proposals / Undo in the rooms editor
« on: June 08, 2014, 04:54:15 am »
Hello,
I would like to implement an undo /redo function in the rooms editor. I think this is an important feature missing. I know Java and Swing so i can do it myself. What do you think ? Are you interested ?
P.S: An interesting article about how to implement correctly undo function with Swing : http://www.javaworld.com/article/2076698/core-java/add-an-undo-redo-function-to-your-java-apps-with-swing.html
I would like to implement an undo /redo function in the rooms editor. I think this is an important feature missing. I know Java and Swing so i can do it myself. What do you think ? Are you interested ?
P.S: An interesting article about how to implement correctly undo function with Swing : http://www.javaworld.com/article/2076698/core-java/add-an-undo-redo-function-to-your-java-apps-with-swing.html
382
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 08, 2014, 04:24:40 am »
I did more tests and i found that that you have to comment also the following line (404 in EnigmaRunner.java):
Anyway this separator is never displayed. This is really strange i know. In the end, i wonder if there is some gremlins in my PC !
I need to take another aspirin

By the way i am not using OpenJDK, but Java Oracle !
Code: [Select]
LGM.tool.add(new JToolBar.Separator(), 4);Anyway this separator is never displayed. This is really strange i know. In the end, i wonder if there is some gremlins in my PC !
I need to take another aspirin

By the way i am not using OpenJDK, but Java Oracle !
383
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 07, 2014, 03:24:25 pm »Wait, look the line should be commented add that adds stopb.
LGM.tool.add(new JToolBar.Separator(), 4);
The line directly after that, is it commented out or not?
Ok the following line is commented, but i've still the error message. This afternoon i commented all lines concerning stopb, but this is easy to do : if you do a search file with eclipse, in 30 seconds you can find and modify all lines. There must something like 10 lines to comment.
Edit :
If i remove line 169:
Code: [Select]
stopb.setVisible(false);the error is also gone, but i find cleaner to comment all lines related to stopb.
384
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 07, 2014, 03:08:25 pm »What, let me check the hashes again, you can see here I've commented it out.
https://github.com/enigma-dev/lgmplugin/blob/master/org/enigma/EnigmaRunner.java#L410
Try manually downloading the plugin jar from here.
https://www.dropbox.com/s/bi2ws2jr53u9hsg/enigma.jar
Yes, i've downloaded also manually enigma.jar from the previous link. Try to open manually this jar and you will see that inside the enigmarunner.java doesn't have the updated version.
385
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 07, 2014, 02:48:43 pm »
Robert, thanks a lot for you help, but are you sure you committed correctly your modification ?
To be sure, i did a new clean install (i deleted the enigma-dev folder), and i've still the error, but it seems the code for the button is still here. If i open in the enigma.jar file the EnigmaRunner.java file, the code for the button is still here:
etc..
To be sure, i did a new clean install (i deleted the enigma-dev folder), and i've still the error, but it seems the code for the button is still here. If i open in the enigma.jar file the EnigmaRunner.java file, the code for the button is still here:
Code: [Select]
public JMenuItem busy, run, debug, design, compile, rebuild, stop;
public JButton stopb, runb, debugb, compileb;Code: [Select]
stop.setVisible(false);
stopb.setVisible(false);Code: [Select]
public void populateMenu()
{
stopb = new JButton(); //$NON-NLS-1$
stopb.addActionListener(this);
stopb.setToolTipText(Messages.getString("EnigmaRunner.MENU_STOP"));
stopb.setIcon(LGM.getIconForKey("EnigmaPlugin.STOP"));
LGM.tool.add(new JToolBar.Separator(), 4);Code: [Select]
public void compile(final int mode)
{
if (!assertReady()) return;
stop.setEnabled(true);
stopb.setEnabled(true);etc..
386
Issues Help Desk / Re: Can't rename a resource under linux KDE
« on: June 07, 2014, 08:55:16 am »
I worked again on this bug. I think i've finally found the culprit !
It seems it is the stopb button which is also managed in the plugin!! This button is used to stop the compiling process. It is enabled when we are starting the process, but anyway as far i can tell it is never displayed, so it is useless.
If i comment all lines which are related to this button in EnigmaRunner.java, the bug is gone. As this button is in fact never really used, what about removing this button and the corresponding stop menu ?
The stop menu and button are declared in EnigmaRunner.java :
If you search the stopb and stop keywords, you will find only a few lines of code, so it is very easy to comment.
By the way, i tested the other day another distro of Linux Mint (i think it was Mate). This is non KDE, but still the bug is present in this distro.
It seems it is the stopb button which is also managed in the plugin!! This button is used to stop the compiling process. It is enabled when we are starting the process, but anyway as far i can tell it is never displayed, so it is useless.If i comment all lines which are related to this button in EnigmaRunner.java, the bug is gone. As this button is in fact never really used, what about removing this button and the corresponding stop menu ?
The stop menu and button are declared in EnigmaRunner.java :
Quote
public JMenuItem busy, run, debug, design, compile, rebuild, stop;
public JButton stopb, runb, debugb, compileb;
If you search the stopb and stop keywords, you will find only a few lines of code, so it is very easy to comment.
By the way, i tested the other day another distro of Linux Mint (i think it was Mate). This is non KDE, but still the bug is present in this distro.
387
General ENIGMA / Re: Importing lateralgm plugin into eclipse
« on: June 07, 2014, 08:11:20 am »I am having trouble understanding what you are asking egofree. Are you saying you can't right click the jardescription and just build the plugin? Also, you have set the build description to link LGM's jar and everything right?
If i right click on the description.jardesc and build the jar, it says 'Can't find the manifest'. It's because it is looking for /lgmplugin/META-INF/MANIFEST.MF", but by default the project in Eclipse is Enigma not lgmplugin. It's very easy to fix : i just have to rename the folder 'Enigma' into 'lgmplugin'. I was just wondering if it was always like this.
388
General ENIGMA / Importing lateralgm plugin into eclipse
« on: June 07, 2014, 03:03:33 am »
Hello,
I've downloaded source code of Lateralgm plugin from Github and imported into Eclipse workspace. I don't know how eclipse creates the project name (from the namespace ?), but currently it's ENIGMA. If you want to create the jar, you have the description.jardesc, but it needs the folder to be named lgmplugin. So you have to rename the folder. Is this normal ? I know it's not serious, but i am just wondering.
I've downloaded source code of Lateralgm plugin from Github and imported into Eclipse workspace. I don't know how eclipse creates the project name (from the namespace ?), but currently it's ENIGMA. If you want to create the jar, you have the description.jardesc, but it needs the folder to be named lgmplugin. So you have to rename the folder. Is this normal ? I know it's not serious, but i am just wondering.
389
Announcements / Re: Timelines Implemented
« on: June 06, 2014, 03:50:33 pm »Can you provide a simple test-case game that works in GM:Studio but fails in Enigma? I'll have a look.
Ok, i did the exactly the same with GM, and everything works as expected. This is not the case with Enigma right now.
Here is the GM project zipped :
https://dl.dropboxusercontent.com/u/29802501/TestTimeLine.gmx.zip
For downloading the Enigma project, see my previous message.
With a simple project, i did three modifications to test timelines:
1) A time line with one step at 60:
timeline_0:
step 60 -> execute script -> show_message("60");
After two seconds, it displays 60. Works the same on GM and ENIGMA.
2) I add a step at 1, which just sets a variable:
timeline_0:
step1 -> execute script -> x=1;
step 60 -> execute script -> show_message("60");
On GM, it displays correctly the message 60 after 2 seconds. With ENIGMA, it displays the message immediately.
3) I added a third step at 120, which displays another message :
timeline_0:
step1 -> execute script -> x=1;
step 60 -> execute script -> show_message("60");
step 120 -> execute script -> show_message("120");
On GM, it displays correctly the message "60" after 2 seconds, and the message "120" after another delay of 2 seconds. With Enigma, it displays immediately the message "60" and after another delay of 2 seconds it displays "60".
Update : i've found that if you restart ENIGMA and load again the project everything works as expected. To be sure i made again from scratch the project with ENIGMA and the bug happens exactly as i described earlier. You can save the project, it doesn't change anything, but you have to close and restart Enigma if yout want to 'remove' this bug. Perhaps the bug is not within ENIGMA but LateralGM ?
Update2:
A lot of strange things happen with timelines if you don't restart ENIGMA and load again the project. Another slightly different example : if you first create step 1, which displays nothing, run the application, nothing happens as expected, but if you add another step at 60 which displays a message, and run the application, nothing is displayed ! If you restart ENIGMA and load the project, everything is again ok.
In conclusion, every time you make a modification to a timeline, you need to restart ENIGMA to be sure it works as expected.
390
Announcements / Re: Timelines Implemented
« on: June 06, 2014, 11:06:00 am »Timelines are in steps egofree, they don't work like alarms. So if your room speed is 30 then step 120 will occur at exactly 4 seconds. I believe, perhaps someone could add timeline documentation on the wiki.
Ok, but it's not step 120 which is triggered but step 60 twice ! In step 120 i display in a message box the value 120, but you never see this value displayed.