Skip to content

Allow switching between perspectives in the Integrated IDE#52

Merged
martinec merged 7 commits into
UnitexGramLab:feature/pluginsfrom
Mukarr:addswitch
Apr 24, 2017
Merged

Allow switching between perspectives in the Integrated IDE#52
martinec merged 7 commits into
UnitexGramLab:feature/pluginsfrom
Mukarr:addswitch

Conversation

@Mukarr

@Mukarr Mukarr commented Aug 14, 2016

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Member

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

@martinec

Copy link
Copy Markdown
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

martinec commented Aug 14, 2016

Copy link
Copy Markdown
Member

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
Copy Markdown
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)

Mukarr added 2 commits August 17, 2016 18:58
…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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Mukarr commented Aug 20, 2016

Copy link
Copy Markdown
Collaborator Author

@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
Copy Markdown
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
Copy Markdown
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

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