Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow switching between perspectives in the Integrated IDE #52

Merged
merged 7 commits into from
Apr 24, 2017

Conversation

Mukarr
Copy link
Collaborator

@Mukarr Mukarr commented Aug 14, 2016

A new dialog box was added that allows :

  1. To choose the perspective that you want to use, when Integrated IDE starts.
  2. To switch to other perspective while working with one.

@martinec
Copy link
Member

It would be better to show the "Choose perspective" dialog in the center of the screen and always on top

@martinec
Copy link
Member

For the Classic perspective, It would be better to put the Perspective menu as a sub-menu of Window. This will be more consistent with the Window > Change Perspective menu of the Project-Oriented perspective.

@martinec
Copy link
Member

martinec commented Aug 14, 2016

In the following scenario, the change perspective feature does not work as expected:

What steps will reproduce the problem?

  • Launch GramLab.jar
  • Select the Classic perspective
  • Select English as language
  • Perspective > Change Perspective
  • Select the Project-oriented perspective
  • Window > Change Perspective
  • Select the Classic perspective
  • Select English as language

What is the expected behavior?

The IDE switches from the Project-oriented to the Classic perspective

What do you see instead?

An exception is thrown:

java.lang.ClassCastException: Cannot cast org.gramlab.core.gramlab.frames.GramlabInternalFrameManager to org.gramlab.core.umlv.unitex.frames.UnitexInternalFrameManager
at java.lang.Class.cast(Class.java:3186)
at org.gramlab.core.gramlab.project.GramlabProject.getFrameManagerAs(GramlabProject.java:517)
at org.gramlab.core.umlv.unitex.frames.UnitexFrame$5.languageChanged(UnitexFrame.java:288)
at org.gramlab.core.umlv.unitex.config.Config.fireLanguageChanged(Config.java:1600)
at org.gramlab.core.umlv.unitex.config.Config.setCurrentLanguage(Config.java:1066)
at org.gramlab.core.umlv.unitex.config.Config.chooseInitialLanguage(Config.java:1340)
at org.gramlab.core.umlv.unitex.config.Config.initConfig(Config.java:259)
at org.gramlab.core.Main$4$1$1.run(Main.java:176)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

java.lang.ClassCastException: Cannot cast org.gramlab.core.gramlab.frames.GramlabInternalFrameManager to org.gramlab.core.umlv.unitex.frames.UnitexInternalFrameManager
at java.lang.Class.cast(Class.java:3186)
at org.gramlab.core.gramlab.project.GramlabProject.getFrameManagerAs(GramlabProject.java:517)
at org.gramlab.core.umlv.unitex.frames.UnitexFrame$5.languageChanged(UnitexFrame.java:288)
at org.gramlab.core.umlv.unitex.config.Config.fireLanguageChanged(Config.java:1600)
at org.gramlab.core.umlv.unitex.config.Config.setCurrentLanguage(Config.java:1066)
at org.gramlab.core.umlv.unitex.config.Config.chooseInitialLanguage(Config.java:1340)
at org.gramlab.core.umlv.unitex.config.Config.initConfig(Config.java:259)
at org.gramlab.core.Main$4$1$1.run(Main.java:176)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

… the Integrated IDE

A new dialog box was added that allows :
1. To choose the perspective that you want to use, when Integrated IDE starts.
2. To switch to other perspective while working with one.
The dialog can be improved by adding a 'Remember me' checkbox, to avoid asking to choose perspective again and again.
@martinec
Copy link
Member

In the following scenario, the feature does not work as expected:

What steps will reproduce the problem?

  • Launch GramLab.jar
  • Select the Project-oriented perspective
  • Click on New project > Create a project from a Unitex user directory
  • Set Name: Test, Language: English (en), Directory to import: /foo/bar/Unitex-GramLab-3.1/English/
  • Click on Test > src > Graphs > Preprocessing > Sentence > Sentence.grf
  • Select the Open a sup-graph icon from the graph toolbox.
  • Click on the Interjection box

What is the expected behavior?

The IDE open the graph Interjection

What do you see instead?

An exception is thrown:

java.lang.NullPointerException
at org.gramlab.core.umlv.unitex.graphrendering.GraphicalZone$MyMouseListener.customMouseClicked(GraphicalZone.java:1395)
at org.gramlab.core.umlv.unitex.graphrendering.GraphicalZone$MyMouseListener.mouseReleased(GraphicalZone.java:1542)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6535)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

…ted perspectives"

This reverts commit db8b04e. The approach failed.
…ted perspectives

This commit would save instance of project-manager of particular perspective. This would enable re-switching to a perspective after switching to the other perspective.
center.add(projectOriented);
bg.add(classic);
bg.add(projectOriented);
final JLabel error = new JLabel("You are already using "+currPerspective+" Perspective.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to avoid this kind of feedback. What about to disable by default the radio button corresponding to the current active perspective?

@martinec
Copy link
Member

In the following scenario, the feature does not work as expected:

What steps will reproduce the problem?

  • Launch GramLab.jar (The splash screen is displayed)
  • Select the Classic perspective (The splash screen is displayed again)

What is the expected behavior?

The splash screen is displayed once.

What do you see instead?

The splash screen is displayed twice.

@martinec
Copy link
Member

In the following scenario, the feature does not work as expected:

What steps will reproduce the problem?

  • Launch GramLab.jar
  • Select the Classic perspective
  • Select English as language
  • Click on FSGraph > Open > Preprocessing > Sentence > Sentence.grf
  • Click on Window > Perspective > Change Perspective
  • Select the Project-oriented perspective
  • Click on Window > Change Perspective
  • Select the Classic perspective
  • Select the Graphs that call this one icon from the Sentence.grf graph toolbox

What is the expected behavior?

The panel containing the list of graphs that call Sentence.grfis show

What do you see instead?

An exception is thrown:

java.lang.ClassCastException: Cannot cast org.gramlab.core.umlv.unitex.project.manager.UnitexProjectManager to org.gramlab.core.gramlab.project.GramlabProjectManager
at java.lang.Class.cast(Class.java:3369)
at org.gramlab.core.umlv.unitex.common.project.manager.GlobalProjectManager.getAs(GlobalProjectManager.java:64)
at org.gramlab.core.gramlab.project.config.ProjectPreferences.getCurrentLanguageDir(ProjectPreferences.java:297)
at org.gramlab.core.umlv.unitex.frames.GraphFrame.showGraphDependencies(GraphFrame.java:947)
at org.gramlab.core.umlv.unitex.frames.GraphFrame$31.actionPerformed(GraphFrame.java:777)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6535)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@Mukarr
Copy link
Collaborator Author

Mukarr commented Aug 20, 2016

@aleksandrachasch The above mentioned scenario always throws an exception, even in the current version of gramlab-ide. You can also check with master branch.
Since you are trying to open a file that is not present in the current project's workspace, it throws an exception.
I think a separate issue should be opened for this, as this is not pertaining to this PR.

@aleksandrachasch
Copy link
Collaborator

To my mind, it would be more convenient if the buttons cancel and OK in Select perspective frame are switched, as usually the OK button is situated on the left, while Cancel is situated on the right.

@martinec
Copy link
Member

In the following scenario, the feature does not work as expected:

What steps will reproduce the problem?

  • Launch GramLab.jar
  • Select the Project-oriented perspective
  • Click on New project > Create a project from a Unitex user directory
  • Set Name: Test, Language: English (en), Directory to import: /foo/bar/Unitex-GramLab-3.1/English/
  • Click on Test > src > Graphs > Preprocessing > Sentence > Sentence.grf
  • Select the Remove a box icon from the graph toolbox.

What is the expected behavior?

The cursor is set to the icon of the Remove a box tool

gramlab-graph-toolbox

What do you see instead?

The cursor is not set to the icon of the Remove a box tool

gramlab-graph-toolbox_no_icon

@martinec martinec changed the title Allow switching between perspectives(Classic and Project-oriented) in the Integrated IDE Allow switching between perspectives in the Integrated IDE Feb 20, 2017
@martinec
Copy link
Member

LGTM. I’m merging this pull request but there is still a minor issue to fix concerning mouse icons. @Mukarr would you mind to take a look? Thank you

@martinec martinec merged commit cafc576 into UnitexGramLab:feature/plugins Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants