Permalink
Browse files

Fix transitivity

Read comments in commit, Swing has issues with toolbars and their focus
traversal policy when the look and feel does not decorate the window.
  • Loading branch information...
RobertBColton committed Nov 4, 2014
1 parent e86d680 commit befdc03419ad05f438ba956e34b16272438df92e
Showing with 12 additions and 5 deletions.
  1. +11 −4 org/lateralgm/main/LGM.java
  2. +1 −1 org/lateralgm/messages/messages.properties
@@ -2025,7 +2025,7 @@ public Icon getOpenIcon()
return null;
}
}
public static void applyPreferences() {
if (Prefs.direct3DAcceleration.equals("off")) { //$NON-NLS-1$
@@ -2060,9 +2060,9 @@ public static void applyPreferences() {
}
}
JFrame.setDefaultLookAndFeelDecorated(Prefs.decorateWindowBorders);
}
public static void main(final String[] args) throws InvocationTargetException, InterruptedException
{
// Set the default uncaught exception handler.
@@ -2086,7 +2086,9 @@ public static void main(final String[] args) throws InvocationTargetException, I
iconspack = Prefs.iconPack;
setLookAndFeel(Prefs.swingTheme);
themechanged = false;
// must be called after setting the look and feel
JFrame.setDefaultLookAndFeelDecorated(Prefs.decorateWindowBorders);
//TODO: Break down this code and refactor it properly and make sure we don't put anymore Swing code in the EDT
SwingUtilities.invokeLater(new Runnable() {
@@ -2495,6 +2497,11 @@ public void actionPerformed(ActionEvent evt) {
filterPanel.setLayout(filterLayout);
filterPanel.setFloatable(true);
filterPanel.setVisible(Prefs.showTreeFilter);
// This fixes an issue with Swing traversal comparator. Basically, Swing likes to throw false positives
// about transitivity when window decorations are disabled.
// The exception occurs on Windows 8 at startup from the Event Dispatch Thread with the Swing Look and Feel when
// window decorations are disabled.
filterPanel.setFocusTraversalPolicyProvider(true);
JScrollPane scroll = new JScrollPane(tree);
scroll.setPreferredSize(new Dimension(250,100));
@@ -120,7 +120,7 @@ QuickFind.HIGHLIGHT = Highlight All
AboutBox.TITLE=About LateralGM
AboutBox.ABOUT=<h1 style="white-space: nowrap">Copyright &copy; 2006-2014</h1>\
<p style="white-space: nowrap">Version: 1.8.6.758<br><br>\
<p style="white-space: nowrap">Version: 1.8.6.759<br><br>\
IsmAvatar \
&lt;<a href="mailto:IsmAvatar@gmail.com">IsmAvatar@gmail.com</a>&gt;<br>\
Clam \

0 comments on commit befdc03

Please sign in to comment.