(netbeans) branch master updated: [NETBEANS-5729] MacOS: Support HiDPI scaling in TreeView's long file name tooltip (e.g. in Projects pane)

2024-08-15 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 42d86921c1 [NETBEANS-5729] MacOS: Support HiDPI scaling in TreeView's 
long file name tooltip (e.g. in Projects pane)
42d86921c1 is described below

commit 42d86921c1088966061384414deb6288b243349a
Author: Eirik Bakke 
AuthorDate: Mon Aug 12 15:43:23 2024 -0400

[NETBEANS-5729] MacOS: Support HiDPI scaling in TreeView's long file name 
tooltip (e.g. in Projects pane)

The relevant improvement had already been made for Windows back in 2016, 
but seems to have been left unactivated for MacOS, probably because the author 
didn't have a Mac to test on. The trick is to create the BufferedImage via 
JComponent.createVolatileImage instead of 'new BufferedImage' (matching my own 
earlier experience with how HiDPI support in implemented in Swing). I simply 
removed the !isMac() condition.

The historical commit that introduced the related code is here: 
https://github.com/eirikbakke/netbeans-releases/commit/707013e449d6147402c92e2ba7d348a933c3e8d6#diff-4bc2ee6c72afdca0c960c205bedd2a606eb0657dad93ff82c7a93fbd1d5b0dc5R524

This issue was previously tracked at 
https://issues.apache.org/jira/browse/NETBEANS-5729
---
 .../openide.explorer/src/org/openide/explorer/view/ViewTooltips.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/platform/openide.explorer/src/org/openide/explorer/view/ViewTooltips.java 
b/platform/openide.explorer/src/org/openide/explorer/view/ViewTooltips.java
index 1781bded51..38ab5fd421 100644
--- a/platform/openide.explorer/src/org/openide/explorer/view/ViewTooltips.java
+++ b/platform/openide.explorer/src/org/openide/explorer/view/ViewTooltips.java
@@ -496,8 +496,7 @@ final class ViewTooltips extends MouseAdapter implements 
MouseMotionListener {
 // get some reasonable limit for the width
 int width = Math.min(dd.width, 2 * currentScreenBounds.width);
 int height = Math.min(dd.height + 2, 2 * 
currentScreenBounds.height);
-Image nue = !Utilities.isMac() ? owner.createVolatileImage(width, 
height) :
-new BufferedImage(width, height, 
BufferedImage.TYPE_INT_ARGB);
+Image nue = owner.createVolatileImage(width, height);
 Graphics g = nue.getGraphics();
 g.setColor (bg);
 g.fillRect (0, 0, width, dd.height + 2);


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) branch master updated: Adjust the Icon implementation in ImageUtilities to make SVG/HiDPI icons work in the MacOS menu bar.

2024-07-17 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8d39338e2a2 Adjust the Icon implementation in ImageUtilities to make 
SVG/HiDPI icons work in the MacOS menu bar.
8d39338e2a2 is described below

commit 8d39338e2a243b03deefd27a7fa6a1da621be04f
Author: Eirik Bakke 
AuthorDate: Sat Dec 2 18:41:33 2023 -0500

Adjust the Icon implementation in ImageUtilities to make SVG/HiDPI icons 
work in the MacOS menu bar.
---
 platform/openide.util.ui/manifest.mf   |  1 -
 .../openide.util.ui/nbproject/project.properties   |  3 +-
 .../src/org/openide/util/ImageUtilities.java   | 87 +++
 .../unit/src/org/openide/util/UtilitiesTest.java   | 98 +-
 4 files changed, 76 insertions(+), 113 deletions(-)

diff --git a/platform/openide.util.ui/manifest.mf 
b/platform/openide.util.ui/manifest.mf
index 1d8866d38e0..a2a1c97ac14 100644
--- a/platform/openide.util.ui/manifest.mf
+++ b/platform/openide.util.ui/manifest.mf
@@ -2,4 +2,3 @@ Manifest-Version: 1.0
 OpenIDE-Module: org.openide.util.ui
 OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
 OpenIDE-Module-Specification-Version: 9.34
-
diff --git a/platform/openide.util.ui/nbproject/project.properties 
b/platform/openide.util.ui/nbproject/project.properties
index 5ba993f13de..d56fbb7147a 100644
--- a/platform/openide.util.ui/nbproject/project.properties
+++ b/platform/openide.util.ui/nbproject/project.properties
@@ -16,8 +16,7 @@
 # under the License.
 
 javac.compilerargs=-Xlint -Xlint:-serial -Xlint:-processing
-javac.source=1.8
-javac.target=1.8
+javac.release=11
 module.jar.dir=lib
 
 
diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index d66dd82b633..526f659594a 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -34,6 +34,7 @@ import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
 import java.awt.image.ImageObserver;
+import java.awt.image.MultiResolutionImage;
 import java.awt.image.RGBImageFilter;
 import java.awt.image.WritableRaster;
 import java.io.IOException;
@@ -46,6 +47,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
@@ -322,10 +324,9 @@ public final class ImageUtilities {
  * @return icon corresponding icon
  */
 public static final Icon image2Icon(Image image) {
-/* Make sure to always return a ToolTipImage, to take advantage of its 
rendering tweaks for
-HiDPI screens. */
-return (image instanceof ToolTipImage)
+ToolTipImage ret = (image instanceof ToolTipImage)
 ? (ToolTipImage) image : assignToolTipToImageInternal(image, 
"");
+return ret.asImageIconIfRequiredForRetina();
 }
 
 /**
@@ -376,8 +377,9 @@ public final class ImageUtilities {
 // so let's try second most used one type, it satisfies 
AbstractButton, JCheckbox. Not all cases are
 // covered, however.
 icon.paintIcon(dummyIconComponentButton, g, 0, 0);
+} finally {
+g.dispose();
 }
-g.dispose();
 return image;
 }
 
@@ -1049,17 +1051,12 @@ public final class ImageUtilities {
 it volatile instead, to be completely sure that the class is still 
thread-safe. */
 private volatile Icon delegate;
 
-private IconImageIcon(Icon delegate) {
-super(icon2Image(delegate));
+IconImageIcon(ToolTipImage delegate) {
+super(delegate);
 Parameters.notNull("delegate", delegate);
 this.delegate = delegate;
 }
 
-private static ImageIcon create(Icon delegate) {
-return (delegate instanceof ImageIcon)
-? (ImageIcon) delegate : new IconImageIcon(delegate);
-}
-
 @Override
 public synchronized void paintIcon(Component c, Graphics g, int x, int 
y) {
 delegate.paintIcon(c, g, x, y);
@@ -1089,9 +1086,15 @@ public final class ImageUtilities {
 }
 
 /**
- * Image with tool tip text (for icons with badges)
+ * Image with tool tip text (for icons with badges).
+ *
+ * On MacOS, HiDPI (Retina) support in JMenuItem.setIcon(Icon) requires 
the Icon argument to
+ * be an instance of ImageIcon wrapping a MultiResolutionImage (see
+ * com.apple.laf.ScreenMenuIcon.setIcon, 
com.apple.laf.AquaIcon.getImageForIcon, and
+ * sun.lwawt.macosx.CImage.Creator.creat

(netbeans) branch master updated: Replace various instances of 'new ImageIcon' with ImageUtilities.image2Icon in the platform module. This preserves HiDPI icons (e.g. SVG icons loaded by ImageUtilitie

2024-07-02 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 37bdd47fdb Replace various instances of 'new ImageIcon' with 
ImageUtilities.image2Icon in the platform module. This preserves HiDPI icons 
(e.g. SVG icons loaded by ImageUtilities) where relevant.
37bdd47fdb is described below

commit 37bdd47fdb8d9876503873c7a3cf52c92fba2309
Author: Eirik Bakke 
AuthorDate: Sat Dec 2 16:36:23 2023 -0500

Replace various instances of 'new ImageIcon' with ImageUtilities.image2Icon 
in the platform module. This preserves HiDPI icons (e.g. SVG icons loaded by 
ImageUtilities) where relevant.
---
 .../src/org/openide/awt/NotificationDisplayer.java   |  8 
 .../openide/explorer/propertysheet/DescriptionComponent.java |  3 +--
 .../explorer/propertysheet/EditorPropertyDisplayer.java  |  3 +--
 .../org/openide/explorer/propertysheet/RendererFactory.java  |  4 +---
 .../openide/explorer/propertysheet/SheetCellRenderer.java|  3 ++-
 .../src/org/openide/explorer/view/MenuView.java  |  6 ++
 .../src/org/openide/actions/NewTemplateAction.java   |  2 +-
 platform/openide.loaders/src/org/openide/awt/MenuBar.java| 12 
 .../src/org/netbeans/spi/actions/ContextAction.java  |  3 +--
 9 files changed, 17 insertions(+), 27 deletions(-)

diff --git 
a/platform/openide.awt/src/org/openide/awt/NotificationDisplayer.java 
b/platform/openide.awt/src/org/openide/awt/NotificationDisplayer.java
index 287b8a9316..f76e188775 100644
--- a/platform/openide.awt/src/org/openide/awt/NotificationDisplayer.java
+++ b/platform/openide.awt/src/org/openide/awt/NotificationDisplayer.java
@@ -46,14 +46,14 @@ public abstract class NotificationDisplayer {
  * Priority of Notification
  */
 public static enum Priority {
-HIGH(new 
ImageIcon(ImageUtilities.loadImage("org/openide/awt/resources/priority_high.png"))),
 //NOI18N
-NORMAL(new 
ImageIcon(ImageUtilities.loadImage("org/openide/awt/resources/priority_normal.png"))),
 //NOI18N
-LOW(new 
ImageIcon(ImageUtilities.loadImage("org/openide/awt/resources/priority_low.png"))),
 //NOI18N
+
HIGH(ImageUtilities.image2Icon(ImageUtilities.loadImage("org/openide/awt/resources/priority_high.png"))),
 //NOI18N
+
NORMAL(ImageUtilities.image2Icon(ImageUtilities.loadImage("org/openide/awt/resources/priority_normal.png"))),
 //NOI18N
+
LOW(ImageUtilities.image2Icon(ImageUtilities.loadImage("org/openide/awt/resources/priority_low.png"))),
 //NOI18N
 /** Priority that shows the notification without details.
  * Details shall be shown only later, per user request.
  * @since 7.18
  */
-SILENT(new 
ImageIcon(ImageUtilities.loadImage("org/openide/awt/resources/priority_silent.png")));
 //NOI18N
+
SILENT(ImageUtilities.image2Icon(ImageUtilities.loadImage("org/openide/awt/resources/priority_silent.png")));
 //NOI18N
 
 private final Icon icon;
 
diff --git 
a/platform/openide.explorer/src/org/openide/explorer/propertysheet/DescriptionComponent.java
 
b/platform/openide.explorer/src/org/openide/explorer/propertysheet/DescriptionComponent.java
index 1f94558dc6..2bf4846610 100644
--- 
a/platform/openide.explorer/src/org/openide/explorer/propertysheet/DescriptionComponent.java
+++ 
b/platform/openide.explorer/src/org/openide/explorer/propertysheet/DescriptionComponent.java
@@ -33,7 +33,6 @@ import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import javax.accessibility.AccessibleRole;
 import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JComponent.AccessibleJComponent;
@@ -114,7 +113,7 @@ class DescriptionComponent extends JComponent implements 
ActionListener, MouseLi
 } else {
 Image help = 
ImageUtilities.loadImage("org/openide/resources/propertysheet/propertySheetHelp.png",
 true); //NOI18N
 
-btn = new JButton(new ImageIcon(help));
+btn = new JButton(ImageUtilities.image2Icon(help));
 btn.addActionListener(this);
 
 toolbar = new JToolBar ();
diff --git 
a/platform/openide.explorer/src/org/openide/explorer/propertysheet/EditorPropertyDisplayer.java
 
b/platform/openide.explorer/src/org/openide/explorer/propertysheet/EditorPropertyDisplayer.java
index d46161b2d3..b4df4e7057 100644
--- 
a/platform/openide.explorer/src/org/openide/explorer/propertysheet/EditorPropertyDisplayer.java
+++ 
b/platform/openide.explorer/src/org/openide/explorer/propertysheet/EditorPropertyDisplayer.java
@@ -25,7 +25,6 @@ package org.openide.explo

(netbeans) branch master updated (09ce82b57f2 -> e1c9ff4d396)

2024-06-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 09ce82b57f2 Merge pull request #7498 from 
junichi11/php-gh-6716-formatting-for-empty-method-body
 new 6ae7a5ee10d Fix an 'illegal reflective access' warning on startup.
 new e1c9ff4d396 Remove the dead code, as requested in PR review. (Will 
squash this commit before merging.)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/org/openide/util/RequestProcessor.java | 25 --
 1 file changed, 4 insertions(+), 21 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) 02/02: Remove the dead code, as requested in PR review. (Will squash this commit before merging.)

2024-06-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit e1c9ff4d3967988b78609a4f3b0d2d3b71340478
Author: Eirik Bakke 
AuthorDate: Thu Jun 20 11:39:24 2024 +0200

Remove the dead code, as requested in PR review. (Will squash this commit 
before merging.)
---
 .../src/org/openide/util/RequestProcessor.java | 36 +++---
 1 file changed, 4 insertions(+), 32 deletions(-)

diff --git a/platform/openide.util/src/org/openide/util/RequestProcessor.java 
b/platform/openide.util/src/org/openide/util/RequestProcessor.java
index 8db6a7d3854..d0e8498d5c5 100644
--- a/platform/openide.util/src/org/openide/util/RequestProcessor.java
+++ b/platform/openide.util/src/org/openide/util/RequestProcessor.java
@@ -19,7 +19,6 @@
 
 package org.openide.util;
 
-import java.lang.reflect.Method;
 import java.security.PrivilegedAction;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -1051,37 +1050,10 @@ outer:  do {
 private static final TopLevelThreadGroup TOP_GROUP = new 
TopLevelThreadGroup();
 private static final class TopLevelThreadGroup implements 
PrivilegedAction {
 public ThreadGroup getTopLevelThreadGroup() {
-/* An old bugfix for Applet/JNLP environments now triggers an 
"Illegal reflective access"
-warning on modern Java versions. Since Applets and JNLP have now 
long been deprecated,
-we can disable said bugfix. I never ever saw the "differs from 
originally used" log
-message below occur in a regular NetBeans IDE or NetBeans Platform 
application context
-either. See https://bz.apache.org/netbeans/show_bug.cgi?id=184494 
*/
-final boolean INCLUDE_APPLET_BUGFIX_184494 = false;
-
-ThreadGroup orig = 
java.security.AccessController.doPrivileged(this);
-if (INCLUDE_APPLET_BUGFIX_184494) {
-ThreadGroup nuova = null;
-
-try {
-Class appContext = Class.forName("sun.awt.AppContext");
-Method instance = appContext.getMethod("getAppContext");
-Method getTG = appContext.getMethod("getThreadGroup");
-nuova = (ThreadGroup) getTG.invoke(instance.invoke(null));
-} catch (Exception exception) {
-logger().log(Level.FINE, "Cannot access 
sun.awt.AppContext", exception);
-return orig;
-}
-
-assert nuova != null;
-
-if (nuova != orig) {
-logger().log(Level.WARNING, "AppContext group {0} differs 
from originally used {1}", new Object[]{nuova, orig});
-}
-return nuova;
-} else {
-return orig;
-}
-
+/* There used to be a workaround for
+https://bz.apache.org/netbeans/show_bug.cgi?id=184494 here, 
relating to Applet and JNLP
+environments. It was removed, since these environments are never 
used anymore. */
+return java.security.AccessController.doPrivileged(this);
 }
 @Override
 public ThreadGroup run() {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) 01/02: Fix an 'illegal reflective access' warning on startup.

2024-06-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 6ae7a5ee10d24381b4203137f39c5e7d42faea78
Author: Eirik Bakke 
AuthorDate: Mon Oct 2 16:23:23 2023 -0400

Fix an 'illegal reflective access' warning on startup.

This commit removes the warning below, which was observed when starting a 
NetBeans Platform application:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
org.openide.util.RequestProcessor$TopLevelThreadGroup 
(file:/C:/Users/ebakke/.m2/repository/org/netbeans/api/org-openide-util/RELEASE180ULT7/org-openide-util-RELEASE180ULT7.jar)
 to method sun.awt.AppContext.getAppContext()
WARNING: Please consider reporting this to the maintainers of 
org.openide.util.RequestProcessor$TopLevelThreadGroup
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
---
 .../src/org/openide/util/RequestProcessor.java | 39 ++
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/platform/openide.util/src/org/openide/util/RequestProcessor.java 
b/platform/openide.util/src/org/openide/util/RequestProcessor.java
index 72a47e53e6d..8db6a7d3854 100644
--- a/platform/openide.util/src/org/openide/util/RequestProcessor.java
+++ b/platform/openide.util/src/org/openide/util/RequestProcessor.java
@@ -1051,25 +1051,36 @@ outer:  do {
 private static final TopLevelThreadGroup TOP_GROUP = new 
TopLevelThreadGroup();
 private static final class TopLevelThreadGroup implements 
PrivilegedAction {
 public ThreadGroup getTopLevelThreadGroup() {
+/* An old bugfix for Applet/JNLP environments now triggers an 
"Illegal reflective access"
+warning on modern Java versions. Since Applets and JNLP have now 
long been deprecated,
+we can disable said bugfix. I never ever saw the "differs from 
originally used" log
+message below occur in a regular NetBeans IDE or NetBeans Platform 
application context
+either. See https://bz.apache.org/netbeans/show_bug.cgi?id=184494 
*/
+final boolean INCLUDE_APPLET_BUGFIX_184494 = false;
+
 ThreadGroup orig = 
java.security.AccessController.doPrivileged(this);
-ThreadGroup nuova = null;
+if (INCLUDE_APPLET_BUGFIX_184494) {
+ThreadGroup nuova = null;
 
-try {
-Class appContext = Class.forName("sun.awt.AppContext");
-Method instance = appContext.getMethod("getAppContext");
-Method getTG = appContext.getMethod("getThreadGroup");
-nuova = (ThreadGroup) getTG.invoke(instance.invoke(null));
-} catch (Exception exception) {
-logger().log(Level.FINE, "Cannot access sun.awt.AppContext", 
exception);
-return orig;
-}
+try {
+Class appContext = Class.forName("sun.awt.AppContext");
+Method instance = appContext.getMethod("getAppContext");
+Method getTG = appContext.getMethod("getThreadGroup");
+nuova = (ThreadGroup) getTG.invoke(instance.invoke(null));
+} catch (Exception exception) {
+logger().log(Level.FINE, "Cannot access 
sun.awt.AppContext", exception);
+return orig;
+}
 
-assert nuova != null;
+assert nuova != null;
 
-if (nuova != orig) {
-logger().log(Level.WARNING, "AppContext group {0} differs from 
originally used {1}", new Object[]{nuova, orig});
+if (nuova != orig) {
+logger().log(Level.WARNING, "AppContext group {0} differs 
from originally used {1}", new Object[]{nuova, orig});
+}
+return nuova;
+} else {
+return orig;
 }
-return nuova;
 
 }
 @Override


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) branch master updated: On FlatLAF, add a thin top border on the quick search pane that is shown when the user starts typing in an Outline or TreeView component.

2024-06-20 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new db0f59f623b On FlatLAF, add a thin top border on the quick search pane 
that is shown when the user starts typing in an Outline or TreeView component.
db0f59f623b is described below

commit db0f59f623b47138a5c41f0a5bed2194fc76fc6d
Author: Eirik Bakke 
AuthorDate: Mon Feb 5 16:31:07 2024 -0500

On FlatLAF, add a thin top border on the quick search pane that is shown 
when the user starts typing in an Outline or TreeView component.
---
 .../src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java  | 2 ++
 platform/openide.awt/src/org/openide/awt/QuickSearch.java  | 7 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
index 4aab548f173..a3e47b104f9 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
@@ -89,6 +89,8 @@ public class FlatLFCustoms extends LFCustoms {
 
 EDITOR_TABSCOMPONENT_BORDER, BorderFactory.createEmptyBorder(),
 EDITOR_TOOLBAR_BORDER, new CompoundBorder(DPISafeBorder.matte(0, 
0, 1, 0, editorContentBorderColor), BorderFactory.createEmptyBorder(1, 0, 1, 
0)),
+"NbExplorerView.quicksearch.border.instance",
+new CompoundBorder(DPISafeBorder.matte(1, 0, 0, 0, 
editorContentBorderColor), BorderFactory.createEmptyBorder(2, 6, 2, 2)),
 EDITOR_TAB_CONTENT_BORDER, DPISafeBorder.matte(0, 1, 1, 1, 
editorContentBorderColor),
 VIEW_TAB_CONTENT_BORDER, DPISafeBorder.matte(0, 1, 1, 1, 
UIManager.getColor("TabbedContainer.view.contentBorderColor")), // NOI18N
 
diff --git a/platform/openide.awt/src/org/openide/awt/QuickSearch.java 
b/platform/openide.awt/src/org/openide/awt/QuickSearch.java
index 240b3057795..c88f1a8fa0f 100644
--- a/platform/openide.awt/src/org/openide/awt/QuickSearch.java
+++ b/platform/openide.awt/src/org/openide/awt/QuickSearch.java
@@ -23,6 +23,7 @@ import java.awt.event.*;
 import java.lang.ref.WeakReference;
 import java.util.function.Consumer;
 import javax.swing.*;
+import javax.swing.border.Border;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.event.PopupMenuEvent;
@@ -610,7 +611,11 @@ public class QuickSearch {
 public SearchPanel(JComponent component, boolean alwaysShown) {
 this.component = component;
 this.alwaysShown = alwaysShown;
-if (isAquaLaF) {
+
+Border customBorder = 
UIManager.getBorder("NbExplorerView.quicksearch.border.instance");
+if (customBorder != null) {
+setBorder(customBorder);
+} else if (isAquaLaF) {
 setBorder(BorderFactory.createEmptyBorder(9,6,8,2));
 } else {
 setBorder(BorderFactory.createEmptyBorder(2,6,2,2));


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) branch master updated: Make the Notification-bubble-with-number-inside-it icon sharp on HiDPI/Retina screens.

2024-06-18 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new bfa14aebfff Make the Notification-bubble-with-number-inside-it icon 
sharp on HiDPI/Retina screens.
bfa14aebfff is described below

commit bfa14aebfffbbc28a0de4670f4b416ed51e69d4d
Author: Eirik Bakke 
AuthorDate: Mon Dec 4 18:49:13 2023 -0500

Make the Notification-bubble-with-number-inside-it icon sharp on 
HiDPI/Retina screens.
---
 .../modules/notifications/FlashingIcon.java| 59 --
 1 file changed, 44 insertions(+), 15 deletions(-)

diff --git 
a/ide/notifications/src/org/netbeans/modules/notifications/FlashingIcon.java 
b/ide/notifications/src/org/netbeans/modules/notifications/FlashingIcon.java
index 3b54307525d..cba4d56f98f 100644
--- a/ide/notifications/src/org/netbeans/modules/notifications/FlashingIcon.java
+++ b/ide/notifications/src/org/netbeans/modules/notifications/FlashingIcon.java
@@ -24,13 +24,11 @@ import java.awt.Cursor;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.Graphics;
-import java.awt.Graphics2D;
 import java.awt.Point;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
-import java.awt.image.BufferedImage;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import javax.swing.BorderFactory;
@@ -41,10 +39,10 @@ import javax.swing.JToolTip;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import org.netbeans.modules.notifications.center.NotificationCenterManager;
+import org.openide.awt.GraphicsUtils;
 import org.openide.awt.NotificationDisplayer;
 import org.openide.util.ImageUtilities;
 import org.openide.util.NbBundle;
-import org.openide.util.RequestProcessor.Task;
 import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
@@ -223,25 +221,56 @@ class FlashingIcon extends JLabel implements 
MouseListener, PropertyChangeListen
 } else {
 icon = 
ImageUtilities.loadImageIcon("org/netbeans/modules/notifications/resources/notifications.png",
 true);
 }
-BufferedImage countIcon = new BufferedImage(16, 16, 
BufferedImage.TYPE_INT_ARGB);
-Graphics2D g = countIcon.createGraphics();
-g.setFont(getFont().deriveFont(10f));
+Font font = getFont().deriveFont(10f);
 Color color;
 if ("Nimbus".equals(UIManager.getLookAndFeel().getID())) {
 color = isError ? Color.RED : Color.BLACK;
 } else {
 color = isError ? UIManager.getColor("nb.errorForeground") : 
UIManager.getColor("Label.foreground");
 }
-g.setColor(color);
-if (unread < 10) {
-g.setFont(g.getFont().deriveFont(Font.BOLD));
-g.drawString(Integer.toString(unread), 5, 10);
-} else if (unread < 100) {
-g.drawString(Integer.toString(unread), 3, 10);
-} else {
-g.drawString("...", 2, 10);
+/* Use a proper Icon implementation rather than going through 
BufferedImage, to get sharp
+results on HiDPI/Retina screens. */
+return new CountIcon(icon, font, color, unread);
+}
+
+private static final class CountIcon implements Icon {
+private final Icon baseIcon;
+private final Font font;
+private final Color color;
+private final int unread;
+
+public CountIcon(Icon baseIcon, Font font, Color color, int unread) {
+this.baseIcon = baseIcon;
+this.font = font;
+this.color = color;
+this.unread = unread;
+}
+
+@Override
+public int getIconWidth() {
+return 16;
+}
+
+@Override
+public int getIconHeight() {
+return 16;
+}
+
+@Override
+public void paintIcon(Component c, Graphics g, int x, int y) {
+GraphicsUtils.configureDefaultRenderingHints(g);
+baseIcon.paintIcon(c, g, x, y);
+g.setFont(font);
+g.setColor(color);
+if (unread < 10) {
+g.setFont(font.deriveFont(Font.BOLD));
+g.drawString(Integer.toString(unread), x + 5, y + 10);
+} else if (unread < 100) {
+g.drawString(Integer.toString(unread), x + 3, y + 10);
+} else {
+g.drawString("...", x + 2, y + 10);
+}
 }
-return new ImageIcon(ImageUtilities.mergeImages(icon.getImage(), 
countIcon, 0, 0));
 }
 
 private class MyIcon implements Icon {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.or

(netbeans) branch master updated: Do not set the MainWindow's icon images on macOS.

2024-03-29 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1dccf14fad Do not set the MainWindow's icon images on macOS.
1dccf14fad is described below

commit 1dccf14fadb874e95b8e8ae3517a804a23cb3e82
Author: Christian Oyarzun 
AuthorDate: Mon Mar 4 10:52:51 2024 -0500

Do not set the MainWindow's icon images on macOS.

This allows macOS to use the icns to create a minimized icon for the Dock
---
 .../src/org/netbeans/core/windows/view/ui/MainWindow.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java
index 32e877efb1..c60129c73b 100755
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java
@@ -511,8 +511,8 @@ public final class MainWindow {
private static final String ICON_1024 = 
"org/netbeans/core/startup/frame1024.png"; // NOI18N
static void initFrameIcons(Frame f) {
List currentIcons = f.getIconImages();
-   if( !currentIcons.isEmpty() )
-   return; //do not override icons if they have been already provided 
elsewhere (JDev)
+   if( !currentIcons.isEmpty() || Utilities.isMac())
+   return; //do not override icons if they have been already provided 
elsewhere (JDev / macOS uses Dock icon)
f.setIconImages(Arrays.asList(
ImageUtilities.loadImage(ICON_16, true),
ImageUtilities.loadImage(ICON_32, true),


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



(netbeans) branch master updated: [NETBEANS-1914] Fix startup problems on Windows after moving NetBeans install directory.

2024-01-04 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new a4807c0ec0 [NETBEANS-1914] Fix startup problems on Windows after 
moving NetBeans install directory.
a4807c0ec0 is described below

commit a4807c0ec0a64ca6d5dcd0a39fde4a8fe9b50170
Author: Eirik Bakke 
AuthorDate: Wed Nov 23 00:25:36 2022 -0500

[NETBEANS-1914] Fix startup problems on Windows after moving NetBeans 
install directory.

On Windows, renaming or moving the NetBeans installation directory caused 
errors on startup, due to references to old paths in all-layers.dat in the 
cache directory. The bug did not seem to happen on Linux or MacOS; I'm not sure 
why. See https://issues.apache.org/jira/browse/NETBEANS-1914 for an example 
stack trace.

The solution in this patch is to include the netbeans.home path in the 
all-checksum.txt file, on Windows. This will invalidate the cache if the 
installation directory is changed. Some tests had to be modified to permit this 
change.
---
 .../startup/layers/CachingPreventsFileTouchesTest.java| 15 ---
 .../modules/netbinox/CachingPreventsFileTouchesTest.java  |  3 ++-
 platform/o.n.bootstrap/src/org/netbeans/Stamps.java   | 10 ++
 .../test/unit/src/org/netbeans/StampsRenameTest.java  |  7 +++
 4 files changed, 31 insertions(+), 4 deletions(-)

diff --git 
a/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CachingPreventsFileTouchesTest.java
 
b/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CachingPreventsFileTouchesTest.java
index 1df60a00d3..8470cd7977 100644
--- 
a/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CachingPreventsFileTouchesTest.java
+++ 
b/platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/CachingPreventsFileTouchesTest.java
@@ -161,9 +161,18 @@ public class CachingPreventsFileTouchesTest extends 
NbTestCase {
 Collections.shuffle(Arrays.asList(arr));
 for (File f : arr) {
 if (!f.isDirectory()) {
-System.err.println("checking " + f);
-cnt++;
-assertFileDoesNotContain(f, install);
+if (f.getName().equals("all-checksum.txt")) {
+/* In org.netbeans.Stamps, we intentionally include the 
full netbeans.home path
+on Windows as a workaround for NETBEANS-1914. This is 
meant to invalidate the
+cache on changes to netbeans.home in case, despite the 
intentions of those who
+implemented the cache directory system, an absolute path 
to netbeas.home did end
+up in the cache directory. */
+System.err.println("skipping checksum file " + f);
+} else {
+System.err.println("checking " + f);
+cnt++;
+assertFileDoesNotContain(f, install);
+}
 }
 }
 assertTrue("Some cache files found", cnt > 4);
diff --git 
a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CachingPreventsFileTouchesTest.java
 
b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CachingPreventsFileTouchesTest.java
index f56e35c35d..1afe0a8815 100644
--- 
a/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CachingPreventsFileTouchesTest.java
+++ 
b/platform/netbinox/test/unit/src/org/netbeans/modules/netbinox/CachingPreventsFileTouchesTest.java
@@ -238,7 +238,8 @@ public class CachingPreventsFileTouchesTest extends 
NbTestCase {
 final File[] arr = recursiveFiles(cacheDir, new ArrayList());
 Collections.shuffle(Arrays.asList(arr));
 for (File f : arr) {
-if (!f.isDirectory()) {
+// Same as in 
o.n.core.startup.layers.CachingPreventsFileTouchesTest
+if (!f.isDirectory() && !f.getName().equals("all-checksum.txt")) {
 cnt++;
 assertFileDoesNotContain(f, install);
 }
diff --git a/platform/o.n.bootstrap/src/org/netbeans/Stamps.java 
b/platform/o.n.bootstrap/src/org/netbeans/Stamps.java
index f274d5d0ab..c2632cd5ca 100644
--- a/platform/o.n.bootstrap/src/org/netbeans/Stamps.java
+++ b/platform/o.n.bootstrap/src/org/netbeans/Stamps.java
@@ -55,6 +55,7 @@ import java.util.logging.Logger;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 import org.openide.modules.Places;
+import org.openide.util.BaseUtilities;
 import org.openide.util.Exceptions;
 import org.openide.util.NbBundle;
 
@@ -337,6 +338,15 @@ public final class Stamps {
 sb.append("branding=").append(NbBundle.getBranding()).append('\n');
 
sb.append(&

[netbeans] branch master updated: Copy FlatLAF label positioning improvements into the Windows LAF.

2023-08-28 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 56b82d2f2b Copy FlatLAF label positioning improvements into the 
Windows LAF.
56b82d2f2b is described below

commit 56b82d2f2b62f8b6e1ecde0a73e126e90a88f44d
Author: Eirik Bakke 
AuthorDate: Wed Aug 11 14:27:48 2021 +0200

Copy FlatLAF label positioning improvements into the Windows LAF.

This commit copies the previously committed improvements in
FlatEditorTabCellRenderer/FlatEditorTabDisplayerUI into the
WinFlatEditorTabCellRenderer/WinFlatEditorTabDisplayerUI classes, which were
originally copied from the former.

(At some point we might want to move the FlatLAF tab control implementations
into o.n.swing.tabcontrol so the code can be shared, but they have some
dependencies on FlatLAF-specific UI scaling utilities and so on.)
---
 .../plaf/WinFlatEditorTabCellRenderer.java | 35 +++---
 .../plaf/WinFlatEditorTabDisplayerUI.java  | 15 --
 .../tabcontrol/plaf/WinFlatViewTabDisplayerUI.java | 11 ---
 3 files changed, 30 insertions(+), 31 deletions(-)

diff --git 
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabCellRenderer.java
 
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabCellRenderer.java
index 24fed97c16..5d5f6f6217 100644
--- 
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabCellRenderer.java
+++ 
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabCellRenderer.java
@@ -21,13 +21,14 @@ package org.netbeans.swing.tabcontrol.plaf;
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
-import java.awt.FontMetrics;
+import java.awt.Font;
 import java.awt.GradientPaint;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Insets;
 import java.awt.Polygon;
 import java.awt.Rectangle;
+import java.awt.font.FontRenderContext;
 import javax.swing.Icon;
 import javax.swing.JComponent;
 import javax.swing.UIManager;
@@ -99,25 +100,23 @@ class WinFlatEditorTabCellRenderer extends 
AbstractTabCellRenderer {
 }
 
 @Override
-protected int getCaptionYAdjustment() {
-// Workaround for a issue in 
AbstractTabCellRenderer.paintIconAndText(Graphics),
-// which uses font height (which includes font descent) to calculate 
Y-coordinate
-// when available height is equal to font height (availH <= txtH),
-// but HtmlRenderer.renderString() expects Y-coordinate at baseline.
-// So the text is painted vertically out of center.
-//
-// This seems to be no issue with other LAFs because they seem to use
-// TabPainter insets differently and the available height is larger 
than
-// the font height (availH > txtH), in which case 3 pixels are removed 
from
-// the Y-coordinate to avoid that the text is painted vertically out 
of center.
-
-FontMetrics fm = getFontMetrics(getFont());
-int txtH = fm.getHeight();
+protected int getCaptionYPosition(Graphics g) {
+Font font = getFont();
+FontRenderContext frc = (g instanceof Graphics2D)
+? ((Graphics2D) g).getFontRenderContext()
+: g.getFontMetrics(font).getFontRenderContext();
+/* Don't rely on FontMetrics.getAscent() to get the ascent; it can 
return values much bigger
+than the actual, visual size of the letters. Use the actual height of 
a flat-topped
+upper-case letter instead. */
+double txtVisualAscent = font.createGlyphVector(frc, "H")
+.getVisualBounds().getHeight();
 Insets ins = getInsets();
 int availH = getHeight() - (ins.top + ins.bottom);
-// Ad hoc adjustment for the Windows LAF.
-int yAdjustment = -1;
-return ((availH <= txtH) ? -fm.getDescent() : -1) + yAdjustment;
+final int effectiveIconYAdjustment = 1 + getIconYAdjustment();
+
+// Center the visual ascent portion of the text vertically with 
respect to the icon.
+return ins.top + (int) Math.round((availH + txtVisualAscent) / 2)
++ effectiveIconYAdjustment;
 }
 
 @Override
diff --git 
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabDisplayerUI.java
 
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabDisplayerUI.java
index 81b59e28bb..2d0242c2bb 100644
--- 
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabDisplayerUI.java
+++ 
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/WinFlatEditorTabDisplayerUI.java
@@ -66,15 +66,12 @@ public class Win

[netbeans] branch master updated (2f73c05997 -> 14c3a1ce4f)

2023-08-24 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 2f73c05997 Merge pull request #6344 from 
sdedic/maven/configure-resolver
 add 8d61a00361 Update FlatLaf from 3.1 to 3.2.
 add 14c3a1ce4f Avoid rounded TabbedPane tabs on FlatLaf 3.2, for 
consistency with regular NetBeans document tabs.

No new revisions were added by this update.

Summary of changes:
 platform/libs.flatlaf/external/binaries-list |  2 +-
 .../{flatlaf-3.1-license.txt => flatlaf-3.2-license.txt} |  4 ++--
 platform/libs.flatlaf/manifest.mf|  2 +-
 platform/libs.flatlaf/nbproject/project.properties   | 12 +++-
 platform/libs.flatlaf/nbproject/project.xml  |  4 ++--
 .../src/org/netbeans/swing/laf/flatlaf/FlatLaf.properties|  1 +
 6 files changed, 14 insertions(+), 11 deletions(-)
 rename platform/libs.flatlaf/external/{flatlaf-3.1-license.txt => 
flatlaf-3.2-license.txt} (99%)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Fix a 'Cannot call invokeAndWait from the event dispatcher thread' exception when calling DatabaseConnection.showConnectionDialog from the EDT.

2023-07-10 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new cadff49dc7 Fix a 'Cannot call invokeAndWait from the event dispatcher 
thread' exception when calling DatabaseConnection.showConnectionDialog from the 
EDT.
cadff49dc7 is described below

commit cadff49dc7447058ca164a9b3d05107c5e02c8cd
Author: Eirik Bakke 
AuthorDate: Mon Jun 5 19:14:39 2023 -0400

Fix a 'Cannot call invokeAndWait from the event dispatcher thread' 
exception when calling DatabaseConnection.showConnectionDialog from the EDT.
---
 .../modules/db/explorer/action/ConnectAction.java  | 37 ++
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java 
b/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
index bbe0f41327..ffe4ca8c53 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
+++ b/ide/db/src/org/netbeans/modules/db/explorer/action/ConnectAction.java
@@ -223,27 +223,24 @@ public class ConnectAction extends AbstractAction 
implements ContextAwareAction,
 
 dbcon.addPropertyChangeListener(connectionListener);
 
-try {
-if (headless) {
-connectWithNewInfo(dbcon, input);
-} else {
-ActionListener actionListener = new ActionListener() {
-@Override
-public void actionPerformed(ActionEvent event) {
-if (event.getSource() == 
DialogDescriptor.OK_OPTION) {
-connectWithNewInfo(dbcon, input);
-}
+if (headless) {
+connectWithNewInfo(dbcon, input);
+} else {
+ActionListener actionListener = new ActionListener() {
+@Override
+public void actionPerformed(ActionEvent event) {
+if (event.getSource() == 
DialogDescriptor.OK_OPTION) {
+connectWithNewInfo(dbcon, input);
 }
-};
-
-SwingUtilities.invokeAndWait(() -> {
-ConnectPanel basePanel = input.getConnectPanel();
-dlg = new ConnectionDialog(this, basePanel, 
basePanel.getTitle(), CONNECT_ACTION_HELPCTX, actionListener);
-dlg.setVisible(true);
-});
-}
-} catch (InterruptedException | InvocationTargetException ex) {
-Exceptions.printStackTrace(ex);
+}
+};
+
+Mutex.EVENT.writeAccess((Mutex.Action) () -> {
+ConnectPanel basePanel = input.getConnectPanel();
+dlg = new ConnectionDialog(this, basePanel, 
basePanel.getTitle(), CONNECT_ACTION_HELPCTX, actionListener);
+dlg.setVisible(true);
+return null;
+});
 }
 dbcon.removeExceptionListener(excListener);
 } else { // without dialog with connection data (username, 
password), just with progress dlg


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Enable sub-pixel anti-aliasing for the splash screen progress text.

2023-06-02 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c556867ded Enable sub-pixel anti-aliasing for the splash screen 
progress text.
c556867ded is described below

commit c556867dedd6280a2814ae7e076536fc2a1f4de1
Author: Eirik Bakke 
AuthorDate: Sat Jan 21 22:36:16 2023 -0500

Enable sub-pixel anti-aliasing for the splash screen progress text.
---
 .../src/org/netbeans/core/startup/Splash.java   | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java 
b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
index c9985ca2cb..1338029986 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
@@ -27,7 +27,9 @@ import java.awt.image.BufferedImage;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.StringTokenizer;
@@ -643,8 +645,7 @@ public final class Splash implements Stamps.Updater {
 image.paintIcon(comp, graphics, 0, 0);
 }
 // turn anti-aliasing on for the splash text
-graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
-RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+configureDefaultRenderingHints(graphics);
 
 if (versionBox != null) {
 String buildNumber = 
System.getProperty("netbeans.buildnumber");
@@ -676,6 +677,18 @@ public final class Splash implements Stamps.Updater {
 }
 }
 
+/* A simplified version of 
org.openide.awt.GraphicsUtils.configureDefaultRenderingHints. (We
+can't use the org.openide.awt module here.) */
+public static void configureDefaultRenderingHints(Graphics2D graphics) {
+Map ret =
+(Map) 
(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+if (ret == null) {
+ret = new HashMap();
+ret.put(RenderingHints.KEY_TEXT_ANTIALIASING, 
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+}
+graphics.addRenderingHints(ret);
+}
+
 private static class SplashDialog extends JDialog implements 
ActionListener {
 /** generated Serialized Version UID */
 static final long serialVersionUID = 5185644855500178404L;


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Replace calls to KeyEvent.getKeyText with Actions.keyStrokeToString where safe/appropriate.

2023-04-15 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 81c25719953416a62de7ac1e94e0ade18396a390
Author: Eirik Bakke 
AuthorDate: Sat Mar 25 17:50:10 2023 -0400

Replace calls to KeyEvent.getKeyText with Actions.keyStrokeToString where 
safe/appropriate.

The Actions.keyStrokeToString method shows more user-friendly keyboard 
shortcut strings on MacOS, and in some other cases. This commit replaces calls 
to KeyEvent.getKeyText with Actions.keyStrokeToString in various places around 
the NetBeans codebase, for cases where I'm reasonably sure that the resulting 
string is used only for UI display purposes.

The options.keymap module has not been touched, as this module probably 
makes assumptions about the format of the generated shortcut strings, e.g. for 
persistence of keymap configuration. Displaying better shortcut strings on 
MacOS in the Keymap options pane is better left as a separate project.

For this commit, all occurrences of the following strings were reviewed, 
via "git grep":
* KeyEvent.getKeyText
* KeyEvent.getKeyModifiersText
* InputEvent.getModifiersExText
---
 .../org/netbeans/jellytools/actions/Action.java|  6 ++---
 .../bookmarks/ui/GotoLineOrBookmarkPanel.java  |  5 ++--
 .../src/org/netbeans/editor/MultiKeymap.java   |  3 ++-
 .../editor/lib2/actions/EditorActionUtilities.java | 31 +++---
 .../java/editor/overridden/ComputeAnnotations.java |  4 +--
 .../modules/java/navigation/ToolTipManagerEx.java  |  6 -
 .../o.n.core/src/org/netbeans/core/NbKeymap.java   | 13 ++---
 .../modules/profiler/api/ActionsSupport.java   | 20 --
 8 files changed, 24 insertions(+), 64 deletions(-)

diff --git 
a/harness/jellytools.platform/src/org/netbeans/jellytools/actions/Action.java 
b/harness/jellytools.platform/src/org/netbeans/jellytools/actions/Action.java
index da3b74d6e7..8aa364c31c 100644
--- 
a/harness/jellytools.platform/src/org/netbeans/jellytools/actions/Action.java
+++ 
b/harness/jellytools.platform/src/org/netbeans/jellytools/actions/Action.java
@@ -23,7 +23,6 @@ import java.awt.Container;
 import java.awt.EventQueue;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
 import javax.swing.KeyStroke;
 import javax.swing.tree.TreePath;
 
@@ -44,6 +43,7 @@ import 
org.netbeans.jemmy.operators.Operator.ComponentVisualizer;
 import org.netbeans.jemmy.operators.Operator.DefaultStringComparator;
 import org.netbeans.jemmy.operators.Operator.StringComparator;
 import org.netbeans.jemmy.util.EmptyVisualizer;
+import org.openide.awt.Actions;
 import org.openide.cookies.InstanceCookie;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
@@ -1281,8 +1281,8 @@ public class Action {
  */
 @Override
 public String toString() {
-String s = KeyEvent.getKeyModifiersText(getKeyModifiers());
-return s + (s.length() > 0 ? "+" : "") + 
KeyEvent.getKeyText(getKeyCode());
+return Actions.keyStrokeToString(
+KeyStroke.getKeyStroke(getKeyCode(), getKeyModifiers()));
 }
 }
 }
diff --git 
a/ide/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ui/GotoLineOrBookmarkPanel.java
 
b/ide/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ui/GotoLineOrBookmarkPanel.java
index fbbb4abea5..e6f6c9834a 100644
--- 
a/ide/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ui/GotoLineOrBookmarkPanel.java
+++ 
b/ide/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/ui/GotoLineOrBookmarkPanel.java
@@ -68,6 +68,7 @@ import org.netbeans.modules.editor.bookmarks.BookmarkInfo;
 import org.netbeans.modules.editor.bookmarks.BookmarkManager;
 import org.netbeans.modules.editor.bookmarks.BookmarkUtils;
 import org.openide.actions.GotoAction;
+import org.openide.awt.Actions;
 import org.openide.util.NbBundle;
 import org.openide.util.actions.SystemAction;
 
@@ -193,10 +194,8 @@ public class GotoLineOrBookmarkPanel extends JPanel 
implements ActionListener, F
 JPanel southPanel = new JPanel();
 southPanel.setLayout(new GridBagLayout());
 JLabel keyChooserLabel = new JLabel();
-String ksText = 
KeyEvent.getKeyModifiersText(ks.getModifiers()) + "+" + // NOI18N
-KeyEvent.getKeyText(ks.getKeyCode());
 
keyChooserLabel.setText(NbBundle.getMessage(GotoLineOrBookmarkPanel.class,
-"CTL_gotoDialogBookmarkKeyChooserLabel", ksText));
+"CTL_gotoDialogBookmarkKeyChooserLabel", 
Actions.keyStrokeToString(ks)));
 InputMap inputMap = 
rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_F

[netbeans] 01/02: Centralize presentation string generation for keyboard shortcuts in a new method Actions.keyStrokeToString, and make some improvements.

2023-04-15 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit f5c239ad21708fa614d045c36b2a429a8538e0ea
Author: Eirik Bakke 
AuthorDate: Thu Sep 22 22:55:13 2022 -0400

Centralize presentation string generation for keyboard shortcuts in a new 
method Actions.keyStrokeToString, and make some improvements.

Details:
* Move the logic in o.n.editor.Utilities.keyStrokeToString to a new public 
method org.openide.awt.Actions.keyStrokeToString, and delegate to the latter. 
This avoids duplication of logic, and makes the logic available from modules 
that do not depend on the editor infrastructure.
* Use InputEvent.getModifiersExText instead of the deprecated 
KeyEvent.getKeyModifiersText.
* On MacOS, use proper modifier key symbols in the canonical order, without 
a plus sign between them.
* Use NetBeans' preferred 'NumPad-' prefix instead of 'KP_' for e.g. 
'KP_LEFT'.
---
 .../src/org/netbeans/editor/Utilities.java | 42 ++
 platform/openide.awt/apichanges.xml| 17 
 .../openide.awt/src/org/openide/awt/Actions.java   | 98 +++---
 .../src/org/openide/awt/Bundle.properties  |  3 +
 4 files changed, 112 insertions(+), 48 deletions(-)

diff --git a/ide/editor.lib/src/org/netbeans/editor/Utilities.java 
b/ide/editor.lib/src/org/netbeans/editor/Utilities.java
index ddb3af35ba..e5fa316eb6 100644
--- a/ide/editor.lib/src/org/netbeans/editor/Utilities.java
+++ b/ide/editor.lib/src/org/netbeans/editor/Utilities.java
@@ -83,6 +83,7 @@ import org.netbeans.modules.editor.lib.BeforeSaveTasks;
 import org.netbeans.modules.editor.lib2.EditorPreferencesDefaults;
 import org.netbeans.modules.editor.lib2.view.DocumentView;
 import org.netbeans.modules.editor.lib2.view.EditorView;
+import org.openide.awt.Actions;
 import org.openide.util.Exceptions;
 import org.openide.util.Mutex;
 import org.openide.util.NbBundle;
@@ -1292,47 +1293,14 @@ public class Utilities {
 
 /**
  * Creates nice textual representation of KeyStroke.
- * Modifiers and an actual key label are concated by plus signs
+ * Modifiers and an actual key label are concated per the 
platform-specific convention
  * @param stroke the KeyStroke to get description of
  * @return String describing the KeyStroke
  */
 public static String keyStrokeToString( KeyStroke stroke ) {
-String modifText = KeyEvent.getKeyModifiersText( stroke.getModifiers() 
);
-String keyText = (stroke.getKeyCode() == KeyEvent.VK_UNDEFINED) ? 
-String.valueOf(stroke.getKeyChar()) : 
getKeyText(stroke.getKeyCode());
-if( modifText.length() > 0 ) return modifText + '+' + keyText;
-else return keyText;
-}
-
-/** @return slight modification of what KeyEvent.getKeyText() returns.
- *  The numpad Left, Right, Down, Up get extra result.
- */
-private static String getKeyText(int keyCode) {
-String ret = KeyEvent.getKeyText(keyCode);
-if (ret != null) {
-switch (keyCode) {
-case KeyEvent.VK_KP_DOWN:
-ret = prefixNumpad(ret, KeyEvent.VK_DOWN);
-break;
-case KeyEvent.VK_KP_LEFT:
-ret = prefixNumpad(ret, KeyEvent.VK_LEFT);
-break;
-case KeyEvent.VK_KP_RIGHT:
-ret = prefixNumpad(ret, KeyEvent.VK_RIGHT);
-break;
-case KeyEvent.VK_KP_UP:
-ret = prefixNumpad(ret, KeyEvent.VK_UP);
-break;
-}
-}
-return ret;
-}
-
-private static String prefixNumpad(String key, int testKeyCode) {
-if (key.equals(KeyEvent.getKeyText(testKeyCode))) {
-key = 
NbBundle.getBundle(BaseKit.class).getString("key-prefix-numpad") + key;
-}
-return key;
+/* The related logic has now been moved into org.openide.awt.Actions, 
so that it can be used
+by modules that do not depend on the editor infrastructure. */
+return Actions.keyStrokeToString(stroke);
 }
 
 private static void checkOffsetValid(Document doc, int offset) throws 
BadLocationException {
diff --git a/platform/openide.awt/apichanges.xml 
b/platform/openide.awt/apichanges.xml
index 3413a01ae5..656ddf2f87 100644
--- a/platform/openide.awt/apichanges.xml
+++ b/platform/openide.awt/apichanges.xml
@@ -26,6 +26,23 @@
 AWT API
 
 
+
+
+Add Actions.keyStrokeToString utility method.
+
+
+
+
+
+The Actions.keyStrokeToString method has been added as a public 
API, to avoid
+   duplication of the same logic in the editor.lib module. This 
method has identical
+   semantics to the existin

[netbeans] branch master updated (71152a1e27 -> 81c2571995)

2023-04-15 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 71152a1e27 Merge pull request #5826 from mbien/cos-off
 new f5c239ad21 Centralize presentation string generation for keyboard 
shortcuts in a new method Actions.keyStrokeToString, and make some improvements.
 new 81c2571995 Replace calls to KeyEvent.getKeyText with 
Actions.keyStrokeToString where safe/appropriate.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/netbeans/jellytools/actions/Action.java|  6 +-
 .../bookmarks/ui/GotoLineOrBookmarkPanel.java  |  5 +-
 .../src/org/netbeans/editor/MultiKeymap.java   |  3 +-
 .../src/org/netbeans/editor/Utilities.java | 42 ++
 .../editor/lib2/actions/EditorActionUtilities.java | 31 +--
 .../java/editor/overridden/ComputeAnnotations.java |  4 +-
 .../modules/java/navigation/ToolTipManagerEx.java  |  6 +-
 .../o.n.core/src/org/netbeans/core/NbKeymap.java   | 13 +--
 platform/openide.awt/apichanges.xml| 17 
 .../openide.awt/src/org/openide/awt/Actions.java   | 98 +++---
 .../src/org/openide/awt/Bundle.properties  |  3 +
 .../modules/profiler/api/ActionsSupport.java   | 20 ++---
 12 files changed, 136 insertions(+), 112 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Improve the appearance of disabled icons on dark LAFs, by adjusting ImageUtilities.DisabledButtonFilter.

2023-04-12 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c6e7f25fb1 Improve the appearance of disabled icons on dark LAFs, by 
adjusting ImageUtilities.DisabledButtonFilter.
c6e7f25fb1 is described below

commit c6e7f25fb14e3a437276e83965c63e5bf3c63607
Author: Eirik Bakke 
AuthorDate: Sat Apr 1 17:13:02 2023 -0400

Improve the appearance of disabled icons on dark LAFs, by adjusting 
ImageUtilities.DisabledButtonFilter.

Also adjust the disabled TabControlIcon color on both FlatLAF Light and 
FlatLAF Dark, to make these buttons more obviously disabled.
---
 .../swing/laf/flatlaf/FlatDarkLaf.properties   |  2 ++
 .../netbeans/swing/laf/flatlaf/FlatLaf.properties  |  2 +-
 .../src/org/openide/util/ImageUtilities.java   | 30 ++
 3 files changed, 23 insertions(+), 11 deletions(-)

diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
index 374489a103..c5b28b468e 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
@@ -50,6 +50,8 @@ EditorTab.underlineColor=$TabbedPane.underlineColor
 EditorTab.inactiveUnderlineColor=#
 EditorTab.tabSeparatorColor=darken($Component.borderColor,15%)
 
+TabControlIcon.disabledForeground=lighten(@background,15%)
+
 # ViewTab 
 
 ViewTab.background=$EditorTab.background
diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLaf.properties
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLaf.properties
index 72b253d074..4a28bafb68 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLaf.properties
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLaf.properties
@@ -85,7 +85,7 @@ nb.completion.selectedForeground=@selectionForeground
 # TabControlIcon 
 
 TabControlIcon.foreground=tint(@foreground,40%)
-TabControlIcon.disabledForeground=lighten($TabControlIcon.foreground,25%)
+TabControlIcon.disabledForeground=lighten($TabControlIcon.foreground,27%)
 TabControlIcon.rolloverBackground=$Button.toolbar.hoverBackground
 TabControlIcon.pressedBackground=$Button.toolbar.pressedBackground
 TabControlIcon.close.rolloverBackground=#c74f50
diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index f25db81bfd..d66dd82b63 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -457,7 +457,8 @@ public final class ImageUtilities {
 /* FilteredIcon's Javadoc mentions a caveat about the Component 
parameter that is passed to
 Icon.paintIcon. It's not really a problem; previous implementations 
had the same
 behavior. */
-return FilteredIcon.create(DisabledButtonFilter.INSTANCE, icon);
+return FilteredIcon.create(isDarkLaF()
+? DisabledButtonFilter.INSTANCE_DARK : 
DisabledButtonFilter.INSTANCE_LIGHT, icon);
 }
 
 /**
@@ -1238,24 +1239,33 @@ public final class ImageUtilities {
 }
 }
 
-private static class DisabledButtonFilter extends RGBImageFilter {
-public static final RGBImageFilter INSTANCE = new 
DisabledButtonFilter();
+private static final class DisabledButtonFilter extends RGBImageFilter {
+public static final RGBImageFilter INSTANCE_LIGHT = new 
DisabledButtonFilter(false);
+public static final RGBImageFilter INSTANCE_DARK  = new 
DisabledButtonFilter(true);
+private final int baseGray;
 
-DisabledButtonFilter() {
+DisabledButtonFilter(boolean dark) {
 canFilterIndexColorModel = true;
+baseGray = dark ? 0x44 : 0x88;
 }
 
-public int filterRGB(int x, int y, int rgb) {
-// Reduce the color bandwidth in quarter (>> 2) and Shift 0x88.
-return (rgb & 0xff00) + 0x88 + rgb >> 16) & 0xff) >> 
2) << 16) + rgb >> 8) & 0xff) >> 2) << 8) + (((rgb) & 0xff) >> 2);
+@Override
+public int filterRGB(int x, int y, int argb) {
+return
+// Keep the alpha channel unmodified.
+(argb & 0xff00) +
+// Reduce the color bandwidth by a quarter (>> 2), and mix 
with gray.
+baseGray +
+argb >> 16) & 0xff) >> 2) << 1

[netbeans] branch master updated: Added CompletionItem.shouldSingleClickInvokeDefaultAction to the Editor Completion API.

2023-03-12 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 27c9f3ba08 Added CompletionItem.shouldSingleClickInvokeDefaultAction 
to the Editor Completion API.
27c9f3ba08 is described below

commit 27c9f3ba08cdff765b95639f7db815b34468247e
Author: Eirik Bakke 
AuthorDate: Sat Oct 1 10:21:15 2022 -0400

Added CompletionItem.shouldSingleClickInvokeDefaultAction to the Editor 
Completion API.
---
 ide/editor.completion/apichanges.xml   |  18 
 .../editor/completion/CompletionLayout.java| 108 ++---
 .../spi/editor/completion/CompletionItem.java  |   8 ++
 3 files changed, 97 insertions(+), 37 deletions(-)

diff --git a/ide/editor.completion/apichanges.xml 
b/ide/editor.completion/apichanges.xml
index 92daa525f7..4fe52d6c7b 100644
--- a/ide/editor.completion/apichanges.xml
+++ b/ide/editor.completion/apichanges.xml
@@ -84,6 +84,24 @@ is the proper place.
 
 
 
+
+
+Addition of optional 
CompletionItem.shouldSingleClickInvokeDefaultAction() method
+
+
+
+
+
+
+
CompletionItem.shouldSingleClickInvokeDefaultAction method was 
added
+to to indicate that a single mouse click on the 
CompletionItem in the
+completion list, rather than only a double-click, will invoke 
its default action.
+A default method is provided in the method which returns 
false, preserving the old
+behavior by default.
+
+
+
+
 
 
 Addition of 
CompletionUtilities.newCompletionItemBuilder() method
diff --git 
a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayout.java
 
b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayout.java
index 43303cae6b..1486334cb7 100644
--- 
a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayout.java
+++ 
b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayout.java
@@ -367,48 +367,82 @@ public final class CompletionLayout {
 completionScrollPane = new CompletionScrollPane(
 editorComponent, listSelectionListener,
 new MouseAdapter() {
+CompletionItem selectedItemOnPress;
+
+@Override
+public void mousePressed(MouseEvent evt) {
+if (!SwingUtilities.isLeftMouseButton(evt)) {
+return;
+}
+selectedItemOnPress = 
completionScrollPane.getSelectedCompletionItem();
+}
+
+@Override
+public void mouseReleased(MouseEvent evt) {
+/* Handle single-click via mouseReleased, rather 
than in mouseClick with
+getClickCount() == 1, since the latter kind of 
event will not be fired if
+the mouse pointer ends up being dragged a tiny bit 
while the button is
+clicked (common on touchpads). */
+if (!SwingUtilities.isLeftMouseButton(evt)) {
+return;
+}
+CompletionItem selectedItem = 
completionScrollPane.getSelectedCompletionItem();
+boolean shouldInvokeDefaultAction =
+selectedItem != null && selectedItem == 
selectedItemOnPress &&
+
selectedItem.shouldSingleClickInvokeDefaultAction();
+selectedItemOnPress = null;
+if (shouldInvokeDefaultAction) {
+invokeDefaultAction(selectedItem);
+}
+}
+
 @Override
 public void mouseClicked(MouseEvent evt) {
-   JTextComponent c = getEditorComponent();
-if (SwingUtilities.isLeftMouseButton(evt)) {
-if 
(completionScrollPane.getView().getSize().width - CompletionJList.arrowSpan() 
<= evt.getPoint().x) {
-CompletionItem selectedItem = 
completionScrollPane.getSelectedCompletionItem();
-if (selectedItem instanceof 
CompositeCompletionItem && 
!((CompositeCompletionItem)selectedItem).getSubItems().isEmpty()) {
-
CompletionImpl.g

[netbeans] branch master updated (c8c7f11d16 -> 4b7776a679)

2023-03-12 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from c8c7f11d16 Remove JDK8 as minimum for build of VSNetBeans. (#5587)
 add 4b7776a679 Four small UI improvements (3 cosmetic + one focus handling 
adjustment), in various areas.

No new revisions were added by this update.

Summary of changes:
 ide/db/src/org/netbeans/modules/db/util/PropertyEditorPanel.form   | 1 +
 ide/db/src/org/netbeans/modules/db/util/PropertyEditorPanel.java   | 7 +--
 .../src/org/netbeans/modules/navigator/NavigatorTC.java| 7 +--
 .../src/org/openide/explorer/propertysheet/MarginViewportUI.java   | 3 ++-
 .../openide.util.ui/src/org/openide/util/actions/SystemAction.java | 2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Linux launcher: Auto-detect subpixel text rendering mode on KDE.

2023-01-07 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 54f142898d Linux launcher: Auto-detect subpixel text rendering mode on 
KDE.
54f142898d is described below

commit 54f142898d48be5d04844bdb6465149ebc55dc2b
Author: Eirik Bakke 
AuthorDate: Thu Dec 29 17:12:36 2022 +0100

Linux launcher: Auto-detect subpixel text rendering mode on KDE.
---
 .../apisupport.harness/release/launchers/app.sh| 20 +--
 nb/ide.launcher/unix/netbeans  | 29 +++---
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/harness/apisupport.harness/release/launchers/app.sh 
b/harness/apisupport.harness/release/launchers/app.sh
index 76bcc63d11..e92dc039e9 100644
--- a/harness/apisupport.harness/release/launchers/app.sh
+++ b/harness/apisupport.harness/release/launchers/app.sh
@@ -159,8 +159,24 @@ case "`uname`" in
 
# See longer comments in nb/ide.launcher/unix/netbeans.
if [ ! -z "$KDE_FULL_SESSION" ] ; then
-   echo "Detected KDE; adding awt.useSystemAAFontSettings=on"
-   extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+   case "`command xrdb -query 2> /dev/null | grep Xft.rgba | cut -d 
':' -f2 | xargs`" in
+   rgb)
+   
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hrgb"
+   ;;
+   bgr)
+   
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hbgr"
+   ;;
+   vrgb)
+   
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vrgb"
+   ;;
+   vbgr)
+   
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vbgr"
+   ;;
+   *)
+   extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+   ;;
+   esac
+   echo "Detected KDE; use explicit setting for font antialiasing 
($extra_automatic_options)"
fi
 
# Add extra_automatic_options before default_options, to allow system
diff --git a/nb/ide.launcher/unix/netbeans b/nb/ide.launcher/unix/netbeans
index b033a371a0..bf9b842b8a 100644
--- a/nb/ide.launcher/unix/netbeans
+++ b/nb/ide.launcher/unix/netbeans
@@ -206,8 +206,8 @@ case "`uname`" in
 extra_automatic_options=""
 
 # Java/AWT/Swing will correctly detect text anti-aliasing settings on
-# GNOME, but not on KDE. Force anti-aliasing on in this case using the
-# "awt.useSystemAAFontSettings" property, as recommended in
+# GNOME, but not (always) on KDE. Force anti-aliasing on in this case
+# using the "awt.useSystemAAFontSettings" property, as recommended in
 # https://bugs.openjdk.java.net/browse/JDK-6408759 . Said bug is old,
 # but the relevant logic (in 
sun.awt.X11.XToolkit.initXSettingsIfNeeded ,
 # and fontpath.c ) seems not to have changed significantly since then.
@@ -222,8 +222,29 @@ case "`uname`" in
 # information."
 # 
https://userbase.kde.org/KDE_System_Administration/Environment_Variables
 if [ ! -z "$KDE_FULL_SESSION" ] ; then
-echo "Detected KDE; adding awt.useSystemAAFontSettings=on"
-extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+# Try to detect the correct subpixel antialiasing mode
+# (https://github.com/apache/netbeans/issues/4228)
+
+# See https://docs.gtk.org/gtk4/property.Settings.gtk-xft-rgba.html
+# See 
https://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html#aaFonts
+case "`command xrdb -query 2> /dev/null | grep Xft.rgba | cut -d 
':' -f2 | xargs`" in
+rgb)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hrgb"
+;;
+bgr)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hbgr"
+;;
+vrgb)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vrgb"
+;;
+vbgr)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vbgr"
+;;
+*)
+
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+;;
+esac
+echo "Detected KDE; use explicit setting for font antialiasing 
($extra_autom

[netbeans] branch master updated: Have "Close All" and friends honor "Cancel" in save prompt dialogs

2022-12-16 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 9f212e884d Have "Close All" and friends honor "Cancel" in save prompt 
dialogs
9f212e884d is described below

commit 9f212e884d314ae221e25fcc721aaeb7dcad40c6
Author: Eirik Bakke 
AuthorDate: Sat Nov 5 16:20:12 2022 -0400

Have "Close All" and friends honor "Cancel" in save prompt dialogs

When invoking "Close All" on a tab, some tabs may pop up confirmation 
dialogs asking whether their work should be saved or not. Pressing the "Cancel" 
button in any dialog, as opposed to "Save" or "Discard", should stop showing 
further dialogs, and stop the overall operation. This was not previously done. 
(In some cases, a bunch of dialogs would be shown on top of each other 
simultaneously, creating visual artifacts.)

This change was made to the Close All and Close Other actions, as well as 
for the newly introduced "Close whole documents list at once" button in the 
document list dropdown (PR #4792).

In a previous discussion, it was suggested to make the whole operation 
atomic (i.e. don't close any tabs at all if the user presses Cancel after 
several tabs have already been iterated), but this is not possible given the 
existing APIs. (We don't know if Cancel was pressed until TopComponent.close() 
was called.) Moreover, the behavior implemented in this PR is more standard in 
any case; it matches the behavior in e.g. Photoshop and VSCode.

It was also suggested to implement similar behavior in the save prompt that 
shows up when exiting the IDE, but this is a rather different operation that 
does not actually close any tabs (they remain "open" and persisted for the next 
time the IDE starts). I'm not quite sure how to improve it; it might require 
more discussion. See the "Savable" API and the o.n.core.ExitDialog class.

I would also have liked to focus each TopComponent in turn when prompts to 
save come up, but this is a bit more work due to the various levels of 
abstractions involved. More work on this can be done later. See 
MultiViewFactory.resolveCloseOperation for a relevant starting point.
---
 .../core/multitabs/impl/DocumentSwitcherTable.java | 27 +++-
 .../netbeans/core/windows/actions/ActionUtils.java | 71 --
 2 files changed, 50 insertions(+), 48 deletions(-)

diff --git 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
index 006a3afc8f..4ff3786b3a 100644
--- 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
+++ 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
@@ -49,6 +49,7 @@ import org.netbeans.swing.tabcontrol.TabData;
 import org.netbeans.swing.tabcontrol.TabbedContainer;
 import org.netbeans.swing.tabcontrol.event.TabActionEvent;
 import org.openide.awt.CloseButtonFactory;
+import org.openide.windows.TopComponent;
 
 /**
  * Slightly enhanced switcher table which adds close button to selected item
@@ -196,15 +197,35 @@ class DocumentSwitcherTable extends SwitcherTable {
 for ( TabData tab : tabs ) {  
 ProjectProxy projectForTab = projectSupport.getProjectForTab( tab 
);
 if (( project == null && projectForTab == null ) || ( 
projectForTab != null && projectForTab.equals( project ))) {
-int tabIndex = controller.getTabModel().indexOf( tab );
-TabActionEvent tae = new TabActionEvent( this, 
TabbedContainer.COMMAND_CLOSE, tabIndex );
-controller.postActionEvent( tae );
+Component tabComponent = tab.getComponent();
+if (tabComponent instanceof TopComponent) {
+TopComponent curTC = (TopComponent) tabComponent;
+/* As in 
o.n.core.windows.actions.ActionUtils.closeAll(Iterable).
+We have to be a little more general here since, 
theoretically, there could be
+tab components that do not extend from TopComponent. */
+if(!isClosingEnabled(curTC)) {
+continue;
+}
+curTC.putClientProperty("inCloseAll", Boolean.TRUE);
+if (!curTC.close()) {
+break;
+}
+} else {
+int tabIndex = controller.getTabModel().indexOf( tab );
+TabActionEvent tae = new TabActionEvent( this, 
TabbedContainer.COMMAND_CLOSE, tabIndex );
+c

[netbeans] branch master updated: implemented closing of a whole document

2022-11-16 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8539677f39 implemented closing of a whole document
8539677f39 is described below

commit 8539677f39ced4c58daaf35745b16f491ef0582d
Author: Richard Michalik 
AuthorDate: Sat Oct 15 14:12:08 2022 +0200

implemented closing of a whole document

fixed code according to review

added missing condition, refactored code

extracted method to close document list

removed unused code and variable

renamed closing method

fixed bug where popup was closing when only one tab was remaining in other 
project

Made changes based on review
---
 .../core/multitabs/impl/ButtonPopupSwitcher.java   | 13 +++--
 .../core/multitabs/impl/DocumentSwitcherTable.java | 59 +-
 2 files changed, 55 insertions(+), 17 deletions(-)

diff --git 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/ButtonPopupSwitcher.java
 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/ButtonPopupSwitcher.java
index 5cc8eb9889..c24c95e74d 100644
--- 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/ButtonPopupSwitcher.java
+++ 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/ButtonPopupSwitcher.java
@@ -205,8 +205,7 @@ final class ButtonPopupSwitcher implements 
MouseInputListener, AWTEventListener,
 
 @Override
 public void mousePressed(MouseEvent e) {
-int tabCount = controller.getTabModel().size();
-if( pTable.onMouseEvent(e) && tabCount == 1 ) {
+if( pTable.onMouseEvent(e) ) {
 hideCurrentPopup();
 }
 e.consume();
@@ -230,8 +229,8 @@ final class ButtonPopupSwitcher implements 
MouseInputListener, AWTEventListener,
 p = SwingUtilities.convertPoint((Component) e.getSource(), p, pTable);
 if (pTable.contains(p)) {
 if( !pTable.onMouseEvent(e) ) {
-final SwitcherTableItem item = pTable.getSelectedItem();
-if (item != null) {
+final DocumentSwitcherTable.Item item = 
pTable.getSelectedItem();
+if (item != null && !item.isSeparator()) {
 hideCurrentPopup();
 item.activate();
 }
@@ -343,7 +342,7 @@ final class ButtonPopupSwitcher implements 
MouseInputListener, AWTEventListener,
 break;
 case KeyEvent.VK_DELETE: {
 final Item item = ( Item ) pTable.getSelectedItem();
-if (item != null && TabDataRenderer.isClosable( 
item.getTabData() )) {
+if (item != null) {
 TabData tab = item.getTabData();
 int tabIndex = controller.getTabModel().indexOf( tab );
 if( tabIndex >= 0 ) {
@@ -355,6 +354,10 @@ final class ButtonPopupSwitcher implements 
MouseInputListener, AWTEventListener,
 selRow = Math.min( pTable.getModel().getRowCount()-1, 
selRow );
 selCol = Math.min( 
pTable.getModel().getColumnCount()-1, selCol );
 switched = true;
+} else if ( item.isSeparator() ){
+if( pTable.closeSelectedDocumentList() ) {
+SwingUtilities.invokeLater(this::hideCurrentPopup);
+}
 }
 }
 break;
diff --git 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
index d853f14dea..006a3afc8f 100644
--- 
a/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
+++ 
b/platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
@@ -27,6 +27,8 @@ import java.awt.Insets;
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
 import javax.swing.BorderFactory;
 import javax.swing.DefaultButtonModel;
 import javax.swing.Icon;
@@ -77,10 +79,8 @@ class DocumentSwitcherTable extends SwitcherTable {
 }
 
 @Override
-public SwitcherTableItem getSelectedItem() {
+public Item getSelectedItem() {
 Item res = ( Item ) getValueAt(getSelectedRow(), getSelectedColumn());
-if( null != res && res.isSeparator )
-return null; //don't hide the popup when a project separator is 
selected
 return res;
 }
 
@@ -90,7 +90,7 @@ class DocumentSwitcherTable extends SwitcherTable {
 
 boolean selected = row == getSelectedRow() &&
 column == getSelectedColumn() && item != null;
-

[netbeans] branch master updated: Attempt to fix intermittent bug on Windows, where cut/paste with external applications would stop working until IDE was restarted. With this fix, the problem still oc

2022-10-15 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 910f34f045 Attempt to fix intermittent bug on Windows, where cut/paste 
with external applications would stop working until IDE was restarted. With 
this fix, the problem still occurs occasionally, but goes away the next time 
the user tries to cut/paste with an external application, without the need to 
restart the IDE.
910f34f045 is described below

commit 910f34f04528f6ba58fb7ac7be985e2486a1f657
Author: Eirik Bakke 
AuthorDate: Tue Oct 11 19:32:48 2022 +0200

Attempt to fix intermittent bug on Windows, where cut/paste with external 
applications would stop working until IDE was restarted. With this fix, the 
problem still occurs occasionally, but goes away the next time the user tries 
to cut/paste with an external application, without the need to restart the IDE.
---
 platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java 
b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java
index 4b2c3eefb7..aa9f8383d2 100644
--- a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java
+++ b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java
@@ -350,6 +350,8 @@ implements LookupListener, FlavorListener, AWTEventListener
 if (ev.getID() == WindowEvent.WINDOW_ACTIVATED) {
 if( Utilities.isWindows() ) {
 systemClipboard.addFlavorListener(this);
+// Catch up on any events missed while we were away.
+fireChange();
 }
 anyWindowIsActivated = true;
 if (System.currentTimeMillis() - lastWindowDeactivated < 100 &&


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Improve vertical text alignment in FlatLAF window system tabs.

2022-07-08 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8f79d085ec Improve vertical text alignment in FlatLAF window system 
tabs.
8f79d085ec is described below

commit 8f79d085ece3e25423e7e106336e60809e686a8c
Author: Eirik Bakke 
AuthorDate: Thu Jul 7 22:49:45 2022 -0400

Improve vertical text alignment in FlatLAF window system tabs.

This makes the tab labels align with the tab icon and the "X" button, with 
any
font and at any font size. The font-agnostic calculation is useful because
FlatLAF uses a different UI font on each OS. Accurate vertical alignment 
also
allows more compact tab styles if desired in the future.

See the Pull Request for before/after screenshots.

Details:
* API change: Allow AbstractTabCellRenderer subclasses to override text 
position
  calculation.
* In FlatLAF, improve the calculation of tab labels' Y position, to avoid 
the
  need for ad hoc adjustments and to work with a variety of font families 
and
  font sizes. Ensure that text in view tabs and editor tabs still line up.
* In FlatLAF, ensure a minimum tab height for smaller fonts, based on the
  expected icon size, regardless of inset settings. This will allow the same
  inset settings to work for e.g. Tahoma 11 and Segoe UI 12 (the old and new
  default fonts on Windows), and other fonts which may be used by default 
for
  FlatLAF on other operating systems.
* In FlatEditorTabDisplayerUI.getPreferredSize, use the correct graphics 
context
  for font metrics calculations.
* Also avoid unnecessary rounding error in the vertical centering of tab 
icons
  and buttons, by doing "(a-b)/2" instead of "a/2-b/2". This is done for all
  LAFs; the difference is at most one pixel compared to the old behavior.
---
 .../o.n.swing.laf.flatlaf/nbproject/project.xml|  2 +-
 .../laf/flatlaf/ui/FlatEditorTabCellRenderer.java  | 37 +
 .../laf/flatlaf/ui/FlatEditorTabDisplayerUI.java   | 15 +++
 .../swing/laf/flatlaf/ui/FlatTabControlIcon.java   |  3 +-
 .../laf/flatlaf/ui/FlatViewTabDisplayerUI.java | 20 +++---
 platform/o.n.swing.tabcontrol/apichanges.xml   | 17 
 platform/o.n.swing.tabcontrol/manifest.mf  |  2 +-
 .../tabcontrol/plaf/AbstractTabCellRenderer.java   | 46 ++
 .../plaf/AbstractViewTabDisplayerUI.java   |  4 +-
 .../plaf/BasicScrollingTabDisplayerUI.java |  4 +-
 10 files changed, 95 insertions(+), 55 deletions(-)

diff --git a/platform/o.n.swing.laf.flatlaf/nbproject/project.xml 
b/platform/o.n.swing.laf.flatlaf/nbproject/project.xml
index 08b6834a67..fc8a5ffa34 100644
--- a/platform/o.n.swing.laf.flatlaf/nbproject/project.xml
+++ b/platform/o.n.swing.laf.flatlaf/nbproject/project.xml
@@ -71,7 +71,7 @@
 
 
 
-1.63
+1.74
 
 
 
diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatEditorTabCellRenderer.java
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatEditorTabCellRenderer.java
index 3caaf98c82..fc0e0f8b67 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatEditorTabCellRenderer.java
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatEditorTabCellRenderer.java
@@ -22,13 +22,14 @@ import com.formdev.flatlaf.util.UIScale;
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
-import java.awt.FontMetrics;
+import java.awt.Font;
 import java.awt.GradientPaint;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Insets;
 import java.awt.Polygon;
 import java.awt.Rectangle;
+import java.awt.font.FontRenderContext;
 import javax.swing.Icon;
 import javax.swing.JComponent;
 import javax.swing.UIManager;
@@ -102,23 +103,23 @@ public class FlatEditorTabCellRenderer extends 
AbstractTabCellRenderer {
 }
 
 @Override
-protected int getCaptionYAdjustment() {
-// Workaround for a issue in 
AbstractTabCellRenderer.paintIconAndText(Graphics),
-// which uses font height (which includes font descent) to calculate 
Y-coordinate
-// when available height is equal to font height (availH <= txtH),
-// but HtmlRenderer.renderString() expects Y-coordinate at baseline.
-// So the text is painted vertically out of center.
-//
-// This seems to be no issue with other LAFs because they seem to use
-// TabPainter insets differently and the available height is larger 
than
-// the font height (availH > txtH), in which case 3 p

[netbeans] branch master updated: FlatLAF improvements and new configuration properties See the Pull Request for screenshots and links to related discussion/PRs.

2022-07-07 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1e920a3a71 FlatLAF improvements and new configuration properties See 
the Pull Request for screenshots and links to related discussion/PRs.
1e920a3a71 is described below

commit 1e920a3a713937430233e466c6afaa4813d06b05
Author: Eirik Bakke 
AuthorDate: Tue Jul 5 13:53:43 2022 -0400

FlatLAF improvements and new configuration properties
See the Pull Request for screenshots and links to related discussion/PRs.

Visual improvements, annotated in screenshot in Pull Request:
1) Align and connect borders between tabs and the container panel below,
   including on fractional HiDPI scalings (e.g. 150%). Some visual artifacts
   still exist, e.g. on 125% scaling, but they are less common, and not very
   visible.
2) Remove an unnecessary border around the editor area.
3) Make sure the "X" in editor tabs are closer to the label than to the
   separator line.
4) Add some top/bottom margin in the toolbar
5) On FlatLAF Dark, make the tab background color connect with the 
background
   of the Project/Files/Services and Navigator panes.
6) Slightly decrease the height of regular tab components.

Other visual improvements:
* On FlatLAF Dark and Light, make the tab hover effect more subtle. Avoid
  showing a hover effect on the already-selected tab. Use the blueish 
active tab
  area background as a base for this color, rather than plain gray.
* Fix positioning of "spinner" icon in sidebar tabs
  (see illustration in PR 2967, which did the same on the Windows LAF).
* Properly clip editor tab borders when tab is partially invisible due to
  tab scrolling.

New configuration settings for FlatLAF.properties
* EditorTab.selectedBackgroundBottomGradient
  (Not used in the current theme, but was tested.)
* Add ViewTab/EditorTab.unscaledBorders
  (Not used in the current FlatLAF theme, but is used in the Windows LAF.)
* EditorTab/ViewTab.selectedHoverBackground/selectedHoverForeground
  (Tweaks in these commits make use of selectedHoverBackground.)
* ViewTab/EditorTab.showSelectedTabBorder
  (Used to explicitly enable borders around the selected tab.)
---
 .../netbeans/swing/laf/flatlaf/DPISafeBorder.java  |   9 +-
 .../swing/laf/flatlaf/FlatDarkLaf.properties   |  11 ++-
 .../netbeans/swing/laf/flatlaf/FlatLFCustoms.java  |   4 +-
 .../netbeans/swing/laf/flatlaf/FlatLaf.properties  |  11 ++-
 .../swing/laf/flatlaf/FlatLightLaf.properties  |   7 +-
 .../org/netbeans/swing/laf/flatlaf/HiDPIUtils.java |  29 --
 .../laf/flatlaf/ui/FlatEditorTabCellRenderer.java  | 102 ++--
 .../laf/flatlaf/ui/FlatEditorTabDisplayerUI.java   |   3 +-
 .../laf/flatlaf/ui/FlatViewTabDisplayerUI.java | 103 ++---
 .../org/netbeans/swing/laf/flatlaf/ui/Utils.java   |  10 ++
 10 files changed, 212 insertions(+), 77 deletions(-)

diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/DPISafeBorder.java
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/DPISafeBorder.java
index 1cb8de6182..1b6c387451 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/DPISafeBorder.java
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/DPISafeBorder.java
@@ -57,7 +57,14 @@ final class DPISafeBorder implements Border {
 
 @Override
 public void paintBorder(Component c, Graphics g, int x, int y, int width, 
int height) {
-HiDPIUtils.paintAtScale1x(g, x, y, width, height, 
this::paintBorderAtScale1x);
+/* Detect borders which may need to visually connect with a prior 
adjacent component. This
+applies in particular to view/editor tabs connecting to their tab 
containers underneath.
+Round the starting position down towards the previous component to try 
to avoid a gap on
+fractional HiDPI scalings (e.g. 150%). */
+boolean roundXdown = insets.left == 0;
+boolean roundYdown = insets.top == 0;
+HiDPIUtils.paintAtScale1x(
+g, x, y, width, height, roundXdown, roundYdown, 
this::paintBorderAtScale1x);
 }
 
 private void paintBorderAtScale1x(Graphics2D g, int deviceWidth, int 
deviceHeight, double scale) {
diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
index 42d2af0991..374489a103 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
@@ -22,6 +22,10 @@ nb.pre

[netbeans] branch master updated: On FlatLAF on Windows, improve vertical centering of labels in buttons. The solution was to make the buttons one pixel taller, as was done in the standard Swing Windo

2022-06-30 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new f566859477 On FlatLAF on Windows, improve vertical centering of labels 
in buttons. The solution was to make the buttons one pixel taller, as was done 
in the standard Swing Windows LAF.
f566859477 is described below

commit f56685947798457737d8272b76b173577506b6d5
Author: Eirik Bakke 
AuthorDate: Mon Nov 15 23:51:29 2021 -0500

On FlatLAF on Windows, improve vertical centering of labels in buttons. The 
solution was to make the buttons one pixel taller, as was done in the standard 
Swing Windows LAF.
---
 .../netbeans/swing/laf/flatlaf/FlatLFCustoms.java  | 34 +-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
index 7a31f97062..ec90d39afc 100644
--- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
+++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLFCustoms.java
@@ -21,14 +21,23 @@ package org.netbeans.swing.laf.flatlaf;
 
 import com.formdev.flatlaf.util.UIScale;
 import java.awt.Color;
+import java.awt.Font;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javax.swing.BorderFactory;
 import javax.swing.InputMap;
 import javax.swing.KeyStroke;
 import javax.swing.UIDefaults;
 import javax.swing.UIDefaults.LazyValue;
 import javax.swing.UIManager;
+import javax.swing.border.CompoundBorder;
+import javax.swing.plaf.InsetsUIResource;
 import org.netbeans.swing.laf.flatlaf.ui.FlatTabControlIcon;
 import org.netbeans.swing.plaf.LFCustoms;
 import org.netbeans.swing.tabcontrol.plaf.TabControlButton;
+import org.openide.util.Utilities;
 
 /**
  * LFCustoms for FlatLaf based LAFs (light, dark, etc).
@@ -54,7 +63,7 @@ public class FlatLFCustoms extends LFCustoms {
 "ctrl PAGE_DOWN", null // NOI18N
 };
 
-return new Object[] {
+Object[] constants = new Object[] {
 // unified background
 "nb.options.categories.tabPanelBackground", unifiedBackground,
 "nb.quicksearch.background", quicksearchBackground,
@@ -120,6 +129,29 @@ public class FlatLFCustoms extends LFCustoms {
 "Table.ancestorInputMap.RightToLeft", new LazyModifyInputMap( 
"Table.ancestorInputMap.RightToLeft", removeCtrlPageUpDownKeyBindings ), // 
NOI18N
 "Tree.focusInputMap", new LazyModifyInputMap( 
"Tree.focusInputMap", removeCtrlPageUpDownKeyBindings ), // NOI18N
 };
+List result = new ArrayList<>();
+result.addAll(Arrays.asList(constants));
+if (Utilities.isWindows()) {
+/* Make sure button labels appear vertically centered on Windows. 
On the standard
+Windows LAF, 
WindowsButtonUI/WindowsRadioButtonUI/WindowsToggleButtonUI.getPreferredSize
+add one pixel to the button's height to ensure that it is 
odd-numbered. This makes the
+text centered with either Tahoma 11 (the default Swing Windows LAF 
font) or Segoe UI 12
+(the default font on modern Windows versions, and on FlatLAF on 
Windows). */
+for (String key : new String[] { "Button", "RadioButton", 
"ToggleButton" }) {
+UIDefaults defaults = UIManager.getDefaults();
+Font font = defaults.getFont(key + ".font");
+Insets bm = defaults.getInsets(key + ".margin");
+if (font != null && bm instanceof InsetsUIResource &&
+font.getFamily().equals("Segoe UI") && font.getSize() 
== 12 &&
+bm.top == bm.bottom) {
+result.add(key + ".margin");
+/* Create an InsetsUIResource rather than an Insets, as 
FlatLAF treats them
+differently. Not doing this caused buttons in the main 
toolbar to become very wide. */
+result.add(new InsetsUIResource(bm.top, bm.left, bm.bottom 
+ 1, bm.right));
+}
+}
+}
+return result.toArray();
 }
 
 static void updateUnifiedBackground() {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Smaller improvements to the Add Connection wizard.

2022-04-28 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new bab3a7357b Smaller improvements to the Add Connection wizard.
bab3a7357b is described below

commit bab3a7357b1f786ca517c6b5e4edf0b69e9d7712
Author: Eirik Bakke 
AuthorDate: Tue Jun 29 17:07:37 2021 -0400

Smaller improvements to the Add Connection wizard.

Details:
* Add support for Amazon Athena and Amazon Redshift.
* Ensure that the sample JDBC URL is properly shown when the user changes 
the URL type from the dropdown.
---
 .../db/explorer/dlg/NewConnectionPanel.java|  8 ++-
 .../org/netbeans/modules/db/util/Bundle.properties |  6 ++
 .../netbeans/modules/db/util/DriverListUtil.java   | 40 +++
 .../src/org/netbeans/modules/db/util/JdbcUrl.java  |  5 +-
 .../modules/db/util/DriverListUtilTest.java| 80 ++
 5 files changed, 136 insertions(+), 3 deletions(-)

diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java 
b/ide/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java
index eebcf1a464..15a383f355 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java
+++ b/ide/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java
@@ -590,7 +590,13 @@ public class NewConnectionPanel extends 
ConnectionDialog.FocusablePanel {
 setUpFields();
 }
 
-updateUrlFromFields();
+if (wd.getDatabaseUrl() == null && jdbcurl.getSampleUrl() != null) 
{
+// Show the appropriate sample URL if the user switches the 
JDBC URL type.
+urlField.setText(jdbcurl.getSampleUrl());
+updateFieldsFromUrl();
+} else {
+updateUrlFromFields();
+}
 fireChange();
 }
 }//GEN-LAST:event_templateComboBoxItemStateChanged
diff --git a/ide/db/src/org/netbeans/modules/db/util/Bundle.properties 
b/ide/db/src/org/netbeans/modules/db/util/Bundle.properties
index 98616ad25f..84bde29ab8 100644
--- a/ide/db/src/org/netbeans/modules/db/util/Bundle.properties
+++ b/ide/db/src/org/netbeans/modules/db/util/Bundle.properties
@@ -24,6 +24,10 @@ TYPE_ForSQLServer=Microsoft SQL Server
 TYPE_ForSybase=Sybase ASE
 TYPE_IDS=Informix Dynamic Server (IDS)
 TYPE_Cloudscape=Cloudscape Server
+TYPE_Standard=Standard
+TYPE_Endpoint=Endpoint
+TYPE_UserName=User Name
+TYPE_IAM=IAM
 
 ERR_InvalidURL=Invalid URL, should be of the form \n{0}
 
@@ -37,6 +41,8 @@ DRIVERNAME_OracleOCI=Oracle OCI
 DRIVERNAME_JTDS=jTDS
 DRIVERNAME_DB2JCC=IBM DB2 Universal Driver
 DRIVERNAME_MSSQL=Microsoft SQL Server
+DRIVERNAME_Athena=Amazon Athena
+DRIVERNAME_Redshift=Amazon Redshift
 
 # Map JDBC URL token identifiers to human-readable strings
 =Host
diff --git a/ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java 
b/ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java
index c6986d353a..2831cb5727 100644
--- a/ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java
+++ b/ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java
@@ -237,6 +237,46 @@ public class DriverListUtil {
 url.setSampleUser("root");
 url.setSamplePassword("");
 
+/* Use the class com.simba.athena.jdbc.Driver instead of
+com.simba.athena.jdbc42.Driver, per the documentation: "The connector 
supports the following
+fully-qualified class names (FQCNs) that are independent of the JDBC 
version:
+com.simba.athena.jdbc.Driver". */
+url = add(NbBundle.getMessage(DriverListUtil.class, 
"DRIVERNAME_Athena"),
+NbBundle.getMessage(DriverListUtil.class, "TYPE_Standard"),
+"com.simba.athena.jdbc.Driver",
+"jdbc:awsathena://[]", true); // NOI18N
+url.setSampleUser("");
+url.setSamplePassword("");
+
url.setSampleUrl("jdbc:awsathena://AwsRegion=us-west-1;S3OutputLocation=s3://working/dir");
+
+url = add(NbBundle.getMessage(DriverListUtil.class, 
"DRIVERNAME_Athena"),
+NbBundle.getMessage(DriverListUtil.class, "TYPE_Endpoint"),
+"com.simba.athena.jdbc.Driver",
+"jdbc:awsathena://[:][;]", true); // 
NOI18N
+url.setSampleUser("");
+url.setSamplePassword("");
+
url.setSampleUrl("jdbc:awsathena://athena.us-east-1.amazonaws.com:443;S3OutputLocation=s3://working/dir");
 // Make sure the default port gets set.
+
+/* Use the class com.amazon.redshift.jdbc.Driver instead of
+com.amazon.redshift.jdbc42.Driver, per the documentation: "The 
connector supports the

[netbeans] branch master updated: [NETBEANS-2360] Auto-detect HiDPI and anti-aliasing settings on Linux.

2022-04-19 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 921e5c3df8 [NETBEANS-2360] Auto-detect HiDPI and anti-aliasing 
settings on Linux.
921e5c3df8 is described below

commit 921e5c3df8e0137cb5f22c122b0435e289693007
Author: Eirik Bakke 
AuthorDate: Tue Aug 17 21:28:32 2021 -0400

[NETBEANS-2360] Auto-detect HiDPI and anti-aliasing settings on Linux.

This commit modifies the NetBeans IDE launcher scripts to automatically 
handle two display-related conditions on Linux:
(1) Automatically enable the -Dawt.useSystemAAFontSettings system parameter 
if necessary to enable anti-aliased text. Veteran NetBeans users have known 
about this setting for a long time, but after a lot of research, I believe I 
have found the specific condition in which it is necessary, namely on the K 
desktop environment.
(2) Automatically detect cases where the user has enabled 2x HiDPI scaling, 
and set the GDK_SCALE environment variable accordingly so that OpenJDK will 
handle this accordingly. This seems to work on both KDE and Gnome. HiDPI 
scaling works best on FlatLAF (which is now the default LAF for NetBeans on all 
platforms), but seemed to work tolerably on the default GTK LAF as well. See 
the in-code comments for more details. (There are two copies of the new code: 
one in the IDE launcher scrip [...]
---
 .../apisupport.harness/release/launchers/app.sh| 24 
 nb/ide.launcher/unix/netbeans  | 67 ++
 2 files changed, 91 insertions(+)

diff --git a/harness/apisupport.harness/release/launchers/app.sh 
b/harness/apisupport.harness/release/launchers/app.sh
index b547bbff4f..76bcc63d11 100644
--- a/harness/apisupport.harness/release/launchers/app.sh
+++ b/harness/apisupport.harness/release/launchers/app.sh
@@ -142,11 +142,35 @@ case "`uname`" in
then
sh=/bin/bash
fi
+
+   # See longer comments in nb/ide.launcher/unix/netbeans.
+   if [ "`command xrdb -query 2> /dev/null | grep Xft.dpi | cut -d ':' -f2 
| xargs`" = 192 ]
+   then
+   echo "Detected 2x HiDPI scaling in Xft.dpi setting; setting 
GDK_SCALE=2"
+   export GDK_SCALE=2
+   fi
+   if [ "`command xdpyinfo 2> /dev/null | grep 'resolution:.*dots per 
inch' | cut -d ':' -f2 | cut -d 'x' -f1 | sort -u | xargs`" = 192 ]
+   then
+   echo "Detected 192 DPI on all screens in xdpyinfo; setting 
GDK_SCALE=2"
+   export GDK_SCALE=2
+   fi
+
+   extra_automatic_options=""
+
+   # See longer comments in nb/ide.launcher/unix/netbeans.
+   if [ ! -z "$KDE_FULL_SESSION" ] ; then
+   echo "Detected KDE; adding awt.useSystemAAFontSettings=on"
+   extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+   fi
+
+   # Add extra_automatic_options before default_options, to allow system
+   # property definitions from the configuration file to take precedence.
eval exec $sh '"$nbexec"' \
 --jdkhome '"$jdkhome"' \
 --clusters '"$clusters"' \
 --userdir '"${userdir}"' \
 --cachedir '"${cachedir}"' \
+${extra_automatic_options} \
 ${default_options} \
 "$args"
exit 1
diff --git a/nb/ide.launcher/unix/netbeans b/nb/ide.launcher/unix/netbeans
index 42c9808e5e..b033a371a0 100644
--- a/nb/ide.launcher/unix/netbeans
+++ b/nb/ide.launcher/unix/netbeans
@@ -162,11 +162,78 @@ case "`uname`" in
 '"$@"'
 ;;
 *)
+# Support 2x HiDPI scaling on Linux systems that have configured this 
via Xft.dpi but not via
+# GDK_SCALE, notably Ubuntu as of 20.04.1. Xft.dpi technically relates 
to the size of fonts
+# only, but Ubuntu sets it when the "Scaling" setting is changed in 
the "Displays" settings
+# UI. OpenJDK supports the GDK_SCALE setting at the 
GraphicsConfiguration level, but not
+# Xft.dpi (as of 2020-11-22 and LTS 11.0.9). Individual LAFs may react 
to the latter, though
+# FlatLAF in particular works correctly even both are set at the same 
time.
+#
+# OpenJDK does not support fractional scalings in GDK_SCALE, so we 
only handle the 2x case
+# here. OpenJDK also does not query the separate GDK_DPI_SCALE 
variable.
+#
+# We do not attempt to support per-monitor DPI scalings here. OpenJDK 
might support this
+# through the ubuntu.user-interface/scale-factor setting, but as of 
Ubuntu 20.04.1, t

[netbeans] branch master updated: [NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17.

2022-02-20 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 31085b5  [NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17.
31085b5 is described below

commit 31085b508268cdec1c55b6de618c6b748f32ac18
Author: Eirik Bakke 
AuthorDate: Sat Feb 19 14:40:00 2022 -0500

[NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17.
---
 .../windows/view/ui/CloseButtonTabbedPane.java |  7 +-
 .../src/org/netbeans/swing/plaf/Startup.java   | 11 +++---
 .../src/org/openide/awt/CloseButtonFactory.java| 25 +++---
 .../src/org/netbeans/lib/profiler/ui/UIUtils.java  |  2 +-
 4 files changed, 28 insertions(+), 17 deletions(-)

diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java
index c38c9c1..31a7ac2 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java
@@ -339,6 +339,11 @@ final class CloseButtonTabbedPane extends JTabbedPane 
implements PropertyChangeL
 || (osName.equals( "Windows NT (unknown)" ) && "10.0".equals( 
System.getProperty("os.version") ));
 }
 
+private static boolean isWindows11() {
+String osName = System.getProperty ("os.name");
+return osName.indexOf("Windows 11") >= 0;
+}
+
 private boolean isWindowsVistaLaF() {
 String osName = System.getProperty ("os.name");
 return osName.indexOf("Vista") >= 0 
@@ -551,7 +556,7 @@ final class CloseButtonTabbedPane extends JTabbedPane 
implements PropertyChangeL
 @Override
 public void setText(String text) {
 super.setText(text);
-if (isWindowsLaF() && isWindows10()) {
+if (isWindowsLaF() && (isWindows10() || isWindows11())) {
 int r = text.endsWith(" ") || 
text.endsWith(" ") ? 0 : 3; // NOI18N
 setBorder(BorderFactory.createEmptyBorder(0, 0, 0, r));
 }
diff --git a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
index 069d2c8..3b49194 100644
--- a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
+++ b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
@@ -436,7 +436,7 @@ public final class Startup {
 buf.append("Nb."); //NOI18N
 buf.append(UIManager.getLookAndFeel().getID());
 if (UIUtils.isXPLF()) {
-if (isWindows8() || isWindows10()) {
+if (isWindows8() || isWindows10() || isWindows11()) {
 buf.append("Windows8LFCustoms"); //NOI18N
 } else if (isWindowsVista() || isWindows7()) {
 buf.append("VistaLFCustoms"); //NOI18N
@@ -461,7 +461,7 @@ public final class Startup {
 switch 
(Arrays.asList(knownLFs).indexOf(UIManager.getLookAndFeel().getID())) {
 case 1 :
 if (UIUtils.isXPLF()) {
-if( isWindows8() || isWindows10() ) {
+if( isWindows8() || isWindows10() || isWindows11() ) {
 result = new Windows8LFCustoms();
 } else if (isWindowsVista() || isWindows7()) {
 result = new VistaLFCustoms();
@@ -487,7 +487,7 @@ public final class Startup {
 default :
 // #79401 check if it's XP style LnF, for example jGoodies
 if (UIUtils.isXPLF()) {
-if (isWindows8() || isWindows10()) {
+if (isWindows8() || isWindows10() || isWindows11()) {
 result = new Windows8LFCustoms();
 } else if (isWindowsVista() || isWindows7()) {
 result = new VistaLFCustoms();
@@ -576,6 +576,11 @@ public final class Startup {
 || (osName.equals( "Windows NT (unknown)" ) && "10.0".equals( 
System.getProperty("os.version") ));
 }
 
+private static boolean isWindows11() {
+String osName = System.getProperty ("os.name");
+return osName.indexOf("Windows 11") >= 0;
+}
+
 private static boolean isMac() {
 String osName = System.getProperty ("os.name");
 boolean result = osName.startsWith ("Darwin") || "Mac 

[netbeans] branch master updated: [NETBEANS-5927] Have the Windows LAF default font follow actual platform settings.

2021-10-17 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 74f134c  [NETBEANS-5927] Have the Windows LAF default font follow 
actual platform settings.
74f134c is described below

commit 74f134c83739778a7dd180808e6bfc9227009957
Author: Eirik Bakke 
AuthorDate: Mon Aug 9 01:02:59 2021 +0200

[NETBEANS-5927] Have the Windows LAF default font follow actual platform 
settings.

This effectively switches the GUI font from Tahoma 11 to Segoe UI 12. Fetch 
the default font for Windows applications using the same technique as as used 
by FlatLAF on Windows.
---
 .../swing/plaf/windows8/Windows8LFCustoms.java | 119 -
 .../plaf/WinFlatEditorTabCellRenderer.java |   2 +-
 2 files changed, 70 insertions(+), 51 deletions(-)

diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
index 8afb4a0..118ae85 100644
--- 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
+++ 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
@@ -23,9 +23,9 @@ import java.awt.Color;
 import java.awt.Font;
 import java.awt.Image;
 import java.awt.Insets;
+import java.awt.Toolkit;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -34,6 +34,8 @@ import javax.swing.border.Border;
 import javax.swing.border.EmptyBorder;
 import javax.swing.border.MatteBorder;
 import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.text.StyleContext;
 import org.netbeans.swing.plaf.LFCustoms;
 import org.netbeans.swing.plaf.util.UIBootstrapValue;
 import org.netbeans.swing.plaf.util.UIUtils;
@@ -65,36 +67,62 @@ public final class Windows8LFCustoms extends LFCustoms {
 // There is also a SCROLLPANE_BORDER_COLOR constant in the superclass. 
Both seem to be in use.
 static final String SCROLLPANE_BORDER_COLOR2 = "scrollpane_border"; 
//NOI18N
 
+/**
+ * A list of {@link UIDefaults} font properties which may need adjustment 
of the font family
+ * and/or font size.
+ */
 private static final String[] DEFAULT_GUI_FONT_PROPERTIES = new String[] {
+/* These font properties are usually set to Tahoma 11 by Swing's 
Windows LAF. Since
+Windows Vista, the default Windows font has switched to Segoe UI 12. 
Swing kept Tahoma 11
+for backwards compatibility reasons only; see 
https://www.pushing-pixels.org/page/213?m and
+JDK-6669448.
+
+There's also a JDK Swing LAF bug which causes these font properties to 
be assigned the wrong
+size under certain HiDPI configurations. Currently, JDK's 
WindowsLookAndFeel derives font
+properties such as Label.font from the Windows API call 
GetStockObject(DEFAULT_GUI_FONT),
+which appears to be unreliable when HiDPI display configurations are 
changed without logging
+out of Windows and back in again (as may frequently happen, for 
instance, when an external
+monitor is connected or disconnected). See the "win.defaultGUI.font" 
property in
+WindowsLookAndFeel and
+java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp . 
The
+"win.messagebox.font" property is not affected by this problem, 
however, so we fetch the
+default font using that one instead. FlatLAF does the same, in
+com.formdev.flatlaf.FlatLaf.initialize(). Note that the font size in 
the
+"win.defaultGUI.font" property may still be affected by the "Make text 
bigger" option in the
+Windows 10 control panel, which exists independently of monitor-level 
HiDPI scaling
+settings. */
 "TitledBorder.font", "Slider.font", "PasswordField.font", 
"TableHeader.font", "TextPane.font",
 "ProgressBar.font", "Viewport.font", "TabbedPane.font", "List.font", 
"CheckBox.font",
 "Table.font", "ScrollPane.font", "ToggleButton.font", "Panel.font", 
"RadioButton.font",
 "FormattedTextField.font", "TextField.font", "Spinner.font", 
"Button.font", "EditorPane.font",
-"Label.font", "ComboBox.font", "Tree.font", "TextArea.font" }; //NOI18N
+"Label.font", "ComboBox.font", "Tree.font",
+/* This one is Monospaced 13 by default, but should be switched to the

[netbeans] branch master updated: [NETBEANS-4198] Fix antialiasing and HiDPI scaling in the Test Results progress bar.

2021-10-01 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 7bc55e9  [NETBEANS-4198] Fix antialiasing and HiDPI scaling in the 
Test Results progress bar.
7bc55e9 is described below

commit 7bc55e9e91bf4b389bce7cee966179eec47be1a0
Author: Eirik Bakke 
AuthorDate: Thu Sep 30 15:59:22 2021 -0400

[NETBEANS-4198] Fix antialiasing and HiDPI scaling in the Test Results 
progress bar.
---
 .../modules/gsf/testrunner/ui/ResultBar.java   | 154 +
 1 file changed, 33 insertions(+), 121 deletions(-)

diff --git 
a/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/ResultBar.java
 
b/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/ResultBar.java
index 61f9595..01c77ca 100644
--- 
a/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/ResultBar.java
+++ 
b/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/ResultBar.java
@@ -18,7 +18,7 @@
  */
 package org.netbeans.modules.gsf.testrunner.ui;
 
-import java.awt.AlphaComposite;
+import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Container;
 import java.awt.Dimension;
@@ -28,11 +28,12 @@ import java.awt.GradientPaint;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Insets;
+import java.awt.Shape;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.image.BufferedImage;
-import java.awt.image.ConvolveOp;
-import java.awt.image.Kernel;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.Timer;
@@ -159,20 +160,13 @@ public final class ResultBar extends JComponent 
implements ActionListener{
 repaint();
 }
 
-public
-@Override
-void paint(Graphics g) {
-// Antialiasing if necessary
-GraphicsUtils.configureDefaultRenderingHints(g);
-super.paint(g);
-}
-
 @Override
 protected void paintComponent(Graphics g) {
-
 if (!(g instanceof Graphics2D)) {
 return;
 }
+// Antialiasing if necessary
+GraphicsUtils.configureDefaultRenderingHints(g);
 
 int width = getWidth();
 int barRectWidth = width;
@@ -184,12 +178,12 @@ public final class ResultBar extends JComponent 
implements ActionListener{
 }
 
 int amountFull = (int) (barRectWidth * passedPercentage / 100.0f);
-   int amountSkip = (int) (barRectWidth * skippedPercentage / 100.0f);
-   int amountAbort = (int) (barRectWidth * abortedPercentage / 100.0f);
-   int amountFail = Math.abs(barRectWidth - amountFull - amountSkip - 
amountAbort);
-   if(amountFail <= 1) {
-   amountFail = 0;
-   }
+int amountSkip = (int) (barRectWidth * skippedPercentage / 100.0f);
+int amountAbort = (int) (barRectWidth * abortedPercentage / 100.0f);
+int amountFail = Math.abs(barRectWidth - amountFull - amountSkip - 
amountAbort);
+if(amountFail <= 1) {
+amountFail = 0;
+}
 
 Color notCoveredLight = NOT_COVERED_LIGHT;
 Color notCoveredDark = NOT_COVERED_DARK;
@@ -240,10 +234,9 @@ public final class ResultBar extends JComponent implements 
ActionListener{
 }
 }
 g2.setPaint(new GradientPaint(0, phase, light, 0, phase + height / 2, 
dark, true));
-g2.fillRect(1, 1, barRectWidth, height);
+g2.fillRect(0, 0, barRectWidth, height);
 
-g2.setFont(getFont());
-paintDropShadowText(g2, barRectWidth, barRectHeight);
+paintText(g2, barRectWidth, barRectHeight);
 }
 
 @Override
@@ -267,10 +260,6 @@ public final class ResultBar extends JComponent implements 
ActionListener{
 size.width += border.left + border.right;
 size.height += border.top + border.bottom;
 
-// The component was replaced with a new one or the JSplitPane's 
divider was used to adjust the size. 
-// This is needed so that text is painted using the correct buffered 
image size, see paintDropShadowText().
-textImage = null;
-
 return size;
 }
 
@@ -294,103 +283,26 @@ public final class ResultBar extends JComponent 
implements ActionListener{
 return h - fm.getDescent() - ((h - fm.getHeight()) / 2);
 }
 
-
///
-// The following code is related to painting drop-shadow text. It is
-// directly based on code in openide.actions/**/HeapView.java by Scott 
Violet.
-
///
-/**
- * Image containing text.
- */
-private BufferedImag

[netbeans] 01/02: [NETBEANS-5931 part 1/2] Fix missing antialiasing in non-editable property sheet values on Windows. Move code for configuration of rendering hints out of HtmlLabelUI and into a new c

2021-09-29 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit f46794972d01e249a40930af916acc37192d12c5
Author: Eirik Bakke 
AuthorDate: Tue Sep 28 18:08:22 2021 -0400

[NETBEANS-5931 part 1/2] Fix missing antialiasing in non-editable property 
sheet values on Windows. Move code for configuration of rendering hints out of 
HtmlLabelUI and into a new common GraphicsUtils class.
---
 platform/openide.awt/apichanges.xml|  16 
 .../src/org/openide/awt/GraphicsUtils.java | 100 +
 .../src/org/openide/awt/HtmlLabelUI.java   |  48 +-
 .../src/org/openide/awt/HtmlRenderer.java  |  18 +---
 platform/openide.explorer/nbproject/project.xml|   2 +-
 .../explorer/propertysheet/RendererFactory.java|   2 +
 6 files changed, 122 insertions(+), 64 deletions(-)

diff --git a/platform/openide.awt/apichanges.xml 
b/platform/openide.awt/apichanges.xml
index 2fa337b..66498e9 100644
--- a/platform/openide.awt/apichanges.xml
+++ b/platform/openide.awt/apichanges.xml
@@ -26,6 +26,22 @@
 AWT API
 
 
+
+
+Added 
GraphicsUtils.configureDefaultRenderingHints(Graphics).
+
+
+
+
+
+Add the GraphicsUtils.configureDefaultRenderingHints(Graphics) method 
(with a new
+GraphicsUtils class), to allow configuration of standard anti-aliasing 
settings from custom
+JComponent.paint(Graphics) implementations. These standard 
incantations were previously
+duplicated extensively throughout the NetBeans codebase.
+
+
+
+
 
 
 Added DropDownButtonFactory.getArrowIcon method.
diff --git a/platform/openide.awt/src/org/openide/awt/GraphicsUtils.java 
b/platform/openide.awt/src/org/openide/awt/GraphicsUtils.java
new file mode 100644
index 000..ba0c3c2
--- /dev/null
+++ b/platform/openide.awt/src/org/openide/awt/GraphicsUtils.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.openide.awt;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Toolkit;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.UIManager;
+import javax.swing.JComponent;
+
+public final class GraphicsUtils {
+private GraphicsUtils() {
+}
+
+private static final boolean antialias =
+// System property to automatically turn on antialiasing for html 
strings
+Boolean.getBoolean("nb.cellrenderer.antialiasing") // NOI18N
+ ||Boolean.getBoolean("swing.aatext") // NOI18N
+ ||(isGTK() && gtkShouldAntialias()) // NOI18N
+ || isAqua();
+private static Boolean gtkAA;
+private static Map hintsMap;
+
+private static boolean isAqua () {
+return "Aqua".equals(UIManager.getLookAndFeel().getID());
+}
+
+private static boolean isGTK () {
+return "GTK".equals(UIManager.getLookAndFeel().getID());
+}
+
+private static final boolean gtkShouldAntialias() {
+if (gtkAA == null) {
+Object o = 
Toolkit.getDefaultToolkit().getDesktopProperty("gnome.Xft/Antialias"); //NOI18N
+gtkAA = Integer.valueOf(1).equals(o);
+}
+
+return gtkAA.booleanValue();
+}
+
+/**
+ * Configure default IDE-wide rendering hints on the supplied {@link 
Graphics} object. This
+ * enables anti-aliasing of manually painted text and 2D graphics, using 
settings that are
+ * consistent throughout the IDE. This method is typically called at the 
beginning of custom
+ * {@link JComponent#paint(Graphics)} implementations. By convention, 
callers passing the
+ * {@code Graphics} object from {@code paint} do not need to bother 
restoring the old rendering
+ * hints after they are done using the {@code Graphics} object.
+ */
+public static void configureDefaultRenderingHints(Graphics graphics) {
+if (graphics == null) {
+throw new 

[netbeans] branch master updated (843223d -> 035dbf1)

2021-09-29 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 843223d  Merge pull request #3194 from asbachb/NETBEANS-5722
 new f467949  [NETBEANS-5931 part 1/2] Fix missing antialiasing in 
non-editable property sheet values on Windows. Move code for configuration of 
rendering hints out of HtmlLabelUI and into a new common GraphicsUtils class.
 new 035dbf1  [NETBEANS-5931 part 2/2] Use configureDefaultRenderingHints 
throughout the codebase.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ide/csl.api/nbproject/project.xml  |   2 +-
 .../completion/MethodParamsTipPaintComponent.java  |  18 +---
 ide/diff/nbproject/project.xml |   2 +-
 .../visualizer/editable/DiffSplitPaneDivider.java  |   9 +-
 ide/editor.completion/nbproject/project.xml|   2 +-
 .../modules/editor/completion/CompletionJList.java |  18 +---
 .../editor/completion/PatchedHtmlRenderer.java |  35 +---
 ide/editor/nbproject/project.xml   |   2 +-
 .../clipboardhistory/ListCompletionView.java   |  21 +
 ide/gsf.codecoverage/nbproject/project.xml |   2 +-
 .../modules/gsf/codecoverage/CoverageBar.java  |  20 +
 ide/gsf.testrunner.ui/nbproject/project.xml|   2 +-
 .../modules/gsf/testrunner/ui/ResultBar.java   |  21 +
 .../gsf/testrunner/ui/output/OutputView.java   |  31 +--
 ide/lib.terminalemulator/nbproject/project.xml |  11 ++-
 .../support/ColorComboBoxRenderer.java |  13 +--
 ide/spi.editor.hints/nbproject/project.xml |   2 +-
 .../editor/hints/borrowed/ListCompletionView.java  |  21 +
 ide/team.commons/nbproject/project.xml |   2 +-
 .../modules/bugtracking/commons/LinkButton.java|  18 +---
 ide/versioning.util/nbproject/project.xml  |   2 +-
 .../modules/versioning/history/LinkButton.java |  18 +---
 java/java.editor/nbproject/project.xml |   2 +-
 .../editor/java/MethodParamsTipPaintComponent.java |  19 +---
 nb/welcome/nbproject/project.xml   |   2 +-
 .../modules/welcome/content/LinkButton.java|   6 +-
 .../netbeans/modules/welcome/content/Utils.java|  16 
 platform/api.visual/nbproject/project.xml  |   8 ++
 .../netbeans/api/visual/widget/SceneComponent.java |   9 +-
 platform/core.output2/nbproject/project.xml|   2 +-
 .../org/netbeans/core/output2/ExtPlainView.java|  27 +-
 .../org/netbeans/core/output2/WrappedTextView.java |  25 +-
 .../windows/view/ui/toolbars/ToolbarContainer.java |  17 
 platform/o.n.core/nbproject/project.xml|   2 +-
 .../org/netbeans/beaninfo/editors/ColorEditor.java |  38 ++--
 .../org/netbeans/beaninfo/editors/FontEditor.java  |  29 +-
 .../src/org/netbeans/swing/plaf/util/UIUtils.java  |  37 +---
 .../o.n.swing.tabcontrol/nbproject/project.xml |   2 +-
 .../swing/tabcontrol/plaf/BasicTabDisplayerUI.java |   7 +-
 .../netbeans/swing/tabcontrol/plaf/ColorUtil.java  |  32 ++-
 .../swing/tabcontrol/plaf/VectorIconTester.java|  13 +--
 platform/openide.awt/apichanges.xml|  16 
 .../src/org/openide/awt/GraphicsUtils.java | 100 +
 .../src/org/openide/awt/HtmlLabelUI.java   |  48 +-
 .../src/org/openide/awt/HtmlRenderer.java  |  18 +---
 platform/openide.explorer/nbproject/project.xml|   2 +-
 .../explorer/propertysheet/RendererFactory.java|   2 +
 .../src/org/openide/util/VectorIcon.java   |   3 +
 48 files changed, 226 insertions(+), 528 deletions(-)
 create mode 100644 platform/openide.awt/src/org/openide/awt/GraphicsUtils.java

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: [NETBEANS-5931 part 2/2] Use configureDefaultRenderingHints throughout the codebase.

2021-09-29 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 035dbf185412542716c3e413c283a4bbfd9614d9
Author: Eirik Bakke 
AuthorDate: Tue Sep 28 18:11:18 2021 -0400

[NETBEANS-5931 part 2/2] Use configureDefaultRenderingHints throughout the 
codebase.

In this commit, I went through all occurrences of the following strings in 
the
NetBeans codebase, and used GraphicsUtils.configureDefaultRenderingHints in
place of previously existing, duplicated logic:

  awt.font.desktophints
  shouldAntialias
  gtkShouldAntialias
  swing.aatext

This should unify antialiasing behavior throughout the IDE. The new logic 
may
not be exactly the same in all cases, since there are many small variations 
in
how different parts of the IDE applies rendering hints. But arguably the
rendering hints should be the same everywhere.

The text editor infrastructure has its own hints-related code, which is not
touched here.
---
 ide/csl.api/nbproject/project.xml  |  2 +-
 .../completion/MethodParamsTipPaintComponent.java  | 18 ++
 ide/diff/nbproject/project.xml |  2 +-
 .../visualizer/editable/DiffSplitPaneDivider.java  |  9 ++---
 ide/editor.completion/nbproject/project.xml|  2 +-
 .../modules/editor/completion/CompletionJList.java | 18 ++
 .../editor/completion/PatchedHtmlRenderer.java | 35 ++--
 ide/editor/nbproject/project.xml   |  2 +-
 .../clipboardhistory/ListCompletionView.java   | 21 ++--
 ide/gsf.codecoverage/nbproject/project.xml |  2 +-
 .../modules/gsf/codecoverage/CoverageBar.java  | 20 ++--
 ide/gsf.testrunner.ui/nbproject/project.xml|  2 +-
 .../modules/gsf/testrunner/ui/ResultBar.java   | 21 ++--
 .../gsf/testrunner/ui/output/OutputView.java   | 31 ++
 ide/lib.terminalemulator/nbproject/project.xml | 11 ++-
 .../support/ColorComboBoxRenderer.java | 13 ++--
 ide/spi.editor.hints/nbproject/project.xml |  2 +-
 .../editor/hints/borrowed/ListCompletionView.java  | 21 ++--
 ide/team.commons/nbproject/project.xml |  2 +-
 .../modules/bugtracking/commons/LinkButton.java| 18 ++
 ide/versioning.util/nbproject/project.xml  |  2 +-
 .../modules/versioning/history/LinkButton.java | 18 ++
 java/java.editor/nbproject/project.xml |  2 +-
 .../editor/java/MethodParamsTipPaintComponent.java | 19 ++-
 nb/welcome/nbproject/project.xml   |  2 +-
 .../modules/welcome/content/LinkButton.java|  6 ++--
 .../netbeans/modules/welcome/content/Utils.java| 16 -
 platform/api.visual/nbproject/project.xml  |  8 +
 .../netbeans/api/visual/widget/SceneComponent.java |  9 ++---
 platform/core.output2/nbproject/project.xml|  2 +-
 .../org/netbeans/core/output2/ExtPlainView.java| 27 ++-
 .../org/netbeans/core/output2/WrappedTextView.java | 25 ++
 .../windows/view/ui/toolbars/ToolbarContainer.java | 17 --
 platform/o.n.core/nbproject/project.xml|  2 +-
 .../org/netbeans/beaninfo/editors/ColorEditor.java | 38 +-
 .../org/netbeans/beaninfo/editors/FontEditor.java  | 29 ++---
 .../src/org/netbeans/swing/plaf/util/UIUtils.java  | 37 +
 .../o.n.swing.tabcontrol/nbproject/project.xml |  2 +-
 .../swing/tabcontrol/plaf/BasicTabDisplayerUI.java |  7 ++--
 .../netbeans/swing/tabcontrol/plaf/ColorUtil.java  | 32 --
 .../swing/tabcontrol/plaf/VectorIconTester.java| 13 ++--
 .../src/org/openide/util/VectorIcon.java   |  3 ++
 42 files changed, 104 insertions(+), 464 deletions(-)

diff --git a/ide/csl.api/nbproject/project.xml 
b/ide/csl.api/nbproject/project.xml
index 910c99b..632dbef 100644
--- a/ide/csl.api/nbproject/project.xml
+++ b/ide/csl.api/nbproject/project.xml
@@ -373,7 +373,7 @@
 
 
 
-6.8.0.1
+7.82
 
 
 
diff --git 
a/ide/csl.api/src/org/netbeans/modules/csl/editor/completion/MethodParamsTipPaintComponent.java
 
b/ide/csl.api/src/org/netbeans/modules/csl/editor/completion/MethodParamsTipPaintComponent.java
index df469fc..0231eeb 100644
--- 
a/ide/csl.api/src/org/netbeans/modules/csl/editor/completion/MethodParamsTipPaintComponent.java
+++ 
b/ide/csl.api/src/org/netbeans/modules/csl/editor/completion/MethodParamsTipPaintComponent.java
@@ -21,9 +21,9 @@ package org.netbeans.modules.csl.editor.completion;
 
 import java.awt.*;
 import java.util.List;
-import java.util.Map;
 import javax.swing.*;
 import javax.swing.text.JTextComponent;
+import

[netbeans] branch master updated: [NETBEANS-3196] Fix lazy Node loading when switching from Children.LEAF to another Children instance.

2021-09-12 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 10ee83e  [NETBEANS-3196] Fix lazy Node loading when switching from 
Children.LEAF to another Children instance.
10ee83e is described below

commit 10ee83e26eda5327aaac4682f92bac6a9f80d23b
Author: Eirik Bakke 
AuthorDate: Fri Oct 4 04:06:28 2019 -0400

[NETBEANS-3196] Fix lazy Node loading when switching from Children.LEAF to 
another Children instance.

Added a new unit test which failed before the fix and passes after the fix.
---
 .../openide.nodes/src/org/openide/nodes/Node.java  |   2 +-
 .../src/org/openide/nodes/LazyNodeTest3196.java| 131 +
 2 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/platform/openide.nodes/src/org/openide/nodes/Node.java 
b/platform/openide.nodes/src/org/openide/nodes/Node.java
index 569d57f..c78889e 100644
--- a/platform/openide.nodes/src/org/openide/nodes/Node.java
+++ b/platform/openide.nodes/src/org/openide/nodes/Node.java
@@ -500,7 +500,7 @@ public abstract class Node extends FeatureDescriptor 
implements Lookup.Provider,
 hierarchy = ch;
 hierarchy.attachTo(Node.this);
 
-if (wasInited && hierarchy != Children.LEAF) {
+if (wasInited && !wasLeaf && hierarchy != Children.LEAF) {
 // init new children if old was inited
 hierarchy.getNodesCount();
 
diff --git 
a/platform/openide.nodes/test/unit/src/org/openide/nodes/LazyNodeTest3196.java 
b/platform/openide.nodes/test/unit/src/org/openide/nodes/LazyNodeTest3196.java
new file mode 100644
index 000..deff2ac
--- /dev/null
+++ 
b/platform/openide.nodes/test/unit/src/org/openide/nodes/LazyNodeTest3196.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.openide.nodes;
+
+import org.netbeans.junit.NbTestCase;
+
+/**
+ * Test for NETBEANS-3196, where calling {@code Children.LEAF.getNodesCount()} 
(e.g. via
+ * {@code Node.EMPTY.getChildren().getNodesCount()}) will prevent lazy loading 
from working in
+ * certain cases in the future.
+ */
+public class LazyNodeTest3196 extends NbTestCase {
+{
+// Not sure if this is needed, but I saw it in some other tests, so it 
can't hurt...
+
System.setProperty("org.openide.explorer.VisualizerNode.prefetchCount", "0");
+}
+
+public LazyNodeTest3196(String name) {
+super(name);
+}
+
+public void testGetLeafGetNodesCountLazy() throws Exception {
+assertEquals(0, Children.LEAF.getNodesCount());
+assertEquals(0, Children.LEAF.getNodesCount(true));
+assertEquals(0, Node.EMPTY.getChildren().getNodesCount());
+assertEquals(0, Node.EMPTY.getChildren().getNodesCount(true));
+MyRootNode rootNode = new MyRootNode();
+assertEquals(0, rootNode.getChildren().getNodesCount());
+assertEquals(0, rootNode.getChildren().getNodesCount(true));
+
+/* After calling getNodesCount() on any Children object, including 
Children.LEAF,
+isInitialized should return true. */
+assertEquals(true, Children.LEAF.isInitialized());
+assertEquals(true, rootNode.getChildren().isInitialized());
+/* Bug NETBEANS-3196 used to happen when setChildren() was a called on 
a Node for which
+the value was previously Children.LEAF. In this case, setChildren() 
would immediately
+initialize the new Children eagerly, rather than allowing lazy 
expansion. */
+rootNode.setChildrenExposed(new LazyChildrenImplementation());
+
+/* We haven't queried the new children at this point, so the Children 
instance should not
+be initialized. Prior to the fix for NETBEANS-3196, the test would 
fail at this point. */
+assertEquals(false, rootNode.getChildren().isInitialized());
+assertEquals(false, ((LazyChildrenImplementation) 
rootNode.getChildren()).getWasEverAdded());
+
+/* I don't think the optimi

[netbeans] branch master updated: [NETBEANS-5726] Fix incorrect checkbox state shown by 'Show Editor Toolbar' and other boolean preference actions.

2021-07-16 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 5f5ae6f  [NETBEANS-5726] Fix incorrect checkbox state shown by 'Show 
Editor Toolbar' and other boolean preference actions.
5f5ae6f is described below

commit 5f5ae6f574c59b6f3541e1a7b434064c00de131d
Author: Eirik Bakke 
AuthorDate: Fri May 28 12:21:29 2021 -0400

[NETBEANS-5726] Fix incorrect checkbox state shown by 'Show Editor Toolbar' 
and other boolean preference actions.
---
 .../modules/editor/actions/ToggleAction.java   | 59 +-
 1 file changed, 36 insertions(+), 23 deletions(-)

diff --git 
a/ide/editor.actions/src/org/netbeans/modules/editor/actions/ToggleAction.java 
b/ide/editor.actions/src/org/netbeans/modules/editor/actions/ToggleAction.java
index 3666dfe..1f5eb7e 100644
--- 
a/ide/editor.actions/src/org/netbeans/modules/editor/actions/ToggleAction.java
+++ 
b/ide/editor.actions/src/org/netbeans/modules/editor/actions/ToggleAction.java
@@ -20,6 +20,7 @@
 package org.netbeans.modules.editor.actions;
 
 import java.awt.event.ActionEvent;
+import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.text.JTextComponent;
@@ -34,35 +35,47 @@ import org.netbeans.api.editor.EditorActionNames;
  *
  * @author Miloslav Metelka
  */
-@EditorActionRegistrations({
-@EditorActionRegistration(
-name = EditorActionNames.toggleToolbar,
-menuPath = "View",
-menuPosition = 800,
-menuText = "#" + EditorActionNames.toggleToolbar + "_menu_text",
-preferencesKey = SimpleValueNames.TOOLBAR_VISIBLE_PROP
-),
-@EditorActionRegistration(
-name = EditorActionNames.toggleLineNumbers,
-menuPath = "View",
-menuPosition = 850,
-menuText = "#" + EditorActionNames.toggleLineNumbers + "_menu_text",
-preferencesKey = SimpleValueNames.LINE_NUMBER_VISIBLE
-),
-@EditorActionRegistration(
-name = EditorActionNames.toggleNonPrintableCharacters,
-menuPath = "View",
-menuPosition = 870,
-menuText = "#" + EditorActionNames.toggleNonPrintableCharacters + 
"_menu_text",
-preferencesKey = SimpleValueNames.NON_PRINTABLE_CHARACTERS_VISIBLE
-)
-})
 public final class ToggleAction extends AbstractEditorAction {
+/* Use eager initialization for these actions. Otherwise the selection 
("checked") state of menu
+items will not properly track the respective Preferences value 
(NETBEANS-5726). */
+@EditorActionRegistrations({
+@EditorActionRegistration(
+name = EditorActionNames.toggleToolbar,
+menuPath = "View",
+menuPosition = 800,
+menuText = "#" + EditorActionNames.toggleToolbar + "_menu_text",
+preferencesKey = SimpleValueNames.TOOLBAR_VISIBLE_PROP
+),
+@EditorActionRegistration(
+name = EditorActionNames.toggleLineNumbers,
+menuPath = "View",
+menuPosition = 850,
+menuText = "#" + EditorActionNames.toggleLineNumbers + 
"_menu_text",
+preferencesKey = SimpleValueNames.LINE_NUMBER_VISIBLE
+),
+@EditorActionRegistration(
+name = EditorActionNames.toggleNonPrintableCharacters,
+menuPath = "View",
+menuPosition = 870,
+menuText = "#" + EditorActionNames.toggleNonPrintableCharacters + 
"_menu_text",
+preferencesKey = SimpleValueNames.NON_PRINTABLE_CHARACTERS_VISIBLE
+)
+})
+public static ToggleAction create(Map attrs) {
+return new ToggleAction(attrs);
+}
 
 private static final Logger LOG = 
Logger.getLogger(ToggleAction.class.getName());
 
 private static final long serialVersionUID = 1L;
 
+public ToggleAction() {
+}
+
+private ToggleAction(Map attrs) {
+super(attrs);
+}
+
 @Override
 public void actionPerformed(ActionEvent evt, JTextComponent component) {
 // Leave empty - AlwaysEnabledAction toggles state in preferences by 
default

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (0dcfe2e -> 31c4569)

2021-07-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 0dcfe2e  LSP: Run all tests action fixed in Gradle projects. (#3050)
 add 31c4569  [NETBEANS-5698] Fix tabcontrol painting on MacOS retina 
displays (Aqua LAF)

No new revisions were added by this update.

Summary of changes:
 .../tabcontrol/plaf/AquaEditorTabCellRenderer.java | 48 --
 .../tabcontrol/plaf/AquaEditorTabDisplayerUI.java  | 41 +-
 .../tabcontrol/plaf/AquaViewTabDisplayerUI.java| 22 ++
 3 files changed, 78 insertions(+), 33 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: [NETBEANS-5723] Avoid a spurious error log message when dragging window system tabs on Windows.

2021-05-31 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0fb44eb  [NETBEANS-5723] Avoid a spurious error log message when 
dragging window system tabs on Windows.
0fb44eb is described below

commit 0fb44eb02182e92bbb654c67781358c301fada94
Author: Eirik Bakke 
AuthorDate: Thu May 27 12:07:45 2021 -0400

[NETBEANS-5723] Avoid a spurious error log message when dragging window 
system tabs on Windows.
---
 .../core/nativeaccess/NativeWindowSystemImpl.java  | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git 
a/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
 
b/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
index 8eb91ae..096743a 100644
--- 
a/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
+++ 
b/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
@@ -78,18 +78,22 @@ public class NativeWindowSystemImpl extends 
NativeWindowSystem {
 if 
(gd.isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency.TRANSLUCENT)
 ) {
 try {
 w.setOpacity(alpha);
+return;
 } catch( Exception e ) {
 //ignore, we'll try JNA
 }
 }
 }
-//try the JNA way
-try {
-WindowUtils.setWindowAlpha(w, alpha);
-} catch( ThreadDeath td ) {
-throw td;
-} catch( Throwable e ) {
-LOG.log(Level.INFO, null, e);
+// Test isWindowAlphaSupported first to avoid an unnecessary log 
message.
+if (WindowUtils.isWindowAlphaSupported()) {
+//try the JNA way
+try {
+WindowUtils.setWindowAlpha(w, alpha);
+} catch( ThreadDeath td ) {
+throw td;
+} catch( Throwable e ) {
+LOG.log(Level.INFO, null, e);
+}
 }
 }
 

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: [NETBEANS-5655] Fix build error caused by improper character set handling for arch.xml files.

2021-05-23 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 1cdb5bd  [NETBEANS-5655] Fix build error caused by improper character 
set handling for arch.xml files.
1cdb5bd is described below

commit 1cdb5bdc364f476a1b7bf3e124e0c7eddec28e8d
Author: Eirik Bakke 
AuthorDate: Sat May 22 09:47:05 2021 -0400

[NETBEANS-5655] Fix build error caused by improper character set handling 
for arch.xml files.

After discussion in the PR, it was decided to leave the MS Word style 
'smart quotes' that triggered the bug in java/java.source.base/arch.xml, to 
'the file act as a canary for the issue'.
---
 nbbuild/javadoctools/build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nbbuild/javadoctools/build.xml b/nbbuild/javadoctools/build.xml
index e8fd960..fe678a7 100644
--- a/nbbuild/javadoctools/build.xml
+++ b/nbbuild/javadoctools/build.xml
@@ -125,7 +125,7 @@
 
 </alldata>
 
-
+
 
 
 

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Various small UI improvements to the database module's "New Connection" wizard.

2021-05-22 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 2cea3bfd02d64ee4817dd9cf15e2a110fe58ce03
Author: Eirik Bakke 
AuthorDate: Tue Feb 4 00:46:55 2020 -0500

Various small UI improvements to the database module's "New Connection" 
wizard.

Details:
* Improve two error messages in "New Connection" wizard.
* Avoid a spurious 'Specified class is not a driver' warning in certain 
situations.
* When detecting the Microsoft SQL Server JDBC driver, avoid showing an 
ancient version number.
* Add a default port number for Microsoft SQL Server.
* Decrease the timeout of the connection validation step.
---
 .../org/netbeans/modules/db/explorer/Bundle.properties  |  4 +++-
 .../modules/db/explorer/dlg/AddDriverDialog.java| 12 
 .../modules/db/explorer/dlg/ConnectionPanel.java|  2 +-
 .../modules/db/explorer/dlg/NewConnectionPanel.java |  8 +++-
 .../src/org/netbeans/modules/db/util/Bundle.properties  |  2 +-
 .../org/netbeans/modules/db/util/DriverListUtil.java|  5 -
 ide/db/src/org/netbeans/modules/db/util/JdbcUrl.java| 17 +
 .../netbeans/modules/db/util/DriverListUtilTest.java|  7 +++
 8 files changed, 40 insertions(+), 17 deletions(-)

diff --git a/ide/db/src/org/netbeans/modules/db/explorer/Bundle.properties 
b/ide/db/src/org/netbeans/modules/db/explorer/Bundle.properties
index b984e90..3cf2553 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/Bundle.properties
+++ b/ide/db/src/org/netbeans/modules/db/explorer/Bundle.properties
@@ -21,7 +21,9 @@ SchemaIsNotSet=Default schema
 
 EXC_InsufficientConnInfo=insufficient information to create a connection
 # {0} is database URL, {1} is the database driver name, {2} is additional info 
-EXC_CannotEstablishConnection=Cannot establish a connection to {0} using {1} 
({2})
+# The "New Connection Wizard" only has space for the first part of the 
message, so put the message
+# from the driver (parameter {2}), which usually explains the error, first.
+EXC_CannotEstablishConnection=Connection failed: {2} ({0} using {1})
 
 # {0} is a user provided value
 EXC_CannotOperateWith=Cannot operate with {0}
diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java 
b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java
index 6f7f644..dfd8d32 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java
+++ b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java
@@ -160,6 +160,7 @@ public final class AddDriverDialog extends 
javax.swing.JPanel {
 String fileName = null;
 dlm.clear();
 drvs.clear();
+jarClassLoader = null;
 URL[] urls = drv == null ? new URL[0] : drv.getURLs();
 for (int i = 0; i < urls.length; i++) {
 URL url = urls[i];
@@ -379,6 +380,7 @@ public final class AddDriverDialog extends 
javax.swing.JPanel {
 if (lsm.isSelectedIndex(i)) {
 dlm.remove(i);
 drvs.remove(i);
+jarClassLoader = null;
 count--;
 continue;
 }
@@ -431,6 +433,7 @@ public final class AddDriverDialog extends 
javax.swing.JPanel {
 dlm.addElement(file.toString());
 try {
 drvs.add(file.toURI().toURL());
+jarClassLoader = null;
 } catch (MalformedURLException exc) {
 LOGGER.log(Level.WARNING,
 "Unable to add driver jar file " +
@@ -603,10 +606,11 @@ public final class AddDriverDialog extends 
javax.swing.JPanel {
 }
 
 private URLClassLoader getJarClassLoader() {
-// This classloader is used to load classes
-// from the jar files for the driver.  We can then use
-// introspection to see if a class in one of these jar files
-// implements java.sql.Driver
+/* This classloader is used to load classes from the jar files for the 
driver.  We can then
+introspection to see if a class in one of these jar files implements 
java.sql.Driver. (We
+clear the jarClassLoader whenever drvs is modified, to avoid the 
AddDriverNotJavaSqlDriver
+message popping up if a different driver is picked from the dropdown 
after an unrelated JAR
+file is added.) */
 jarClassLoader =
 new URLClassLoader(drvs.toArray(new URL[drvs.size()]),
 this.getClass().getClassLoader());
diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionPanel.java 
b/ide/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionPanel.java
index 020141d..0710e07 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionPa

[netbeans] 01/02: In the Database module, refactor the 'Add Connection' wizard to avoid depending on hardcoded wizard panel indexes.

2021-05-22 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 5a34cc3b6c84411258263e532a7b516548834e6c
Author: Eirik Bakke 
AuthorDate: Mon Feb 3 13:57:51 2020 -0500

In the Database module, refactor the 'Add Connection' wizard to avoid 
depending on hardcoded wizard panel indexes.
---
 .../db/explorer/dlg/AddConnectionWizard.java   | 51 --
 .../explorer/dlg/ChoosingConnectionNamePanel.java  |  7 ++-
 .../db/explorer/dlg/ChoosingDriverPanel.java   |  6 ++-
 .../db/explorer/dlg/ChoosingSchemaPanel.java   |  9 +++-
 .../modules/db/explorer/dlg/ConnectionPanel.java   |  9 ++--
 5 files changed, 52 insertions(+), 30 deletions(-)

diff --git 
a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddConnectionWizard.java 
b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddConnectionWizard.java
index b71769c..e6c4f0d 100644
--- a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddConnectionWizard.java
+++ b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddConnectionWizard.java
@@ -21,6 +21,8 @@ package org.netbeans.modules.db.explorer.dlg;
 import java.awt.Dialog;
 import java.net.URL;
 import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
@@ -60,12 +62,11 @@ public class AddConnectionWizard extends 
ConnectionDialogMediator implements Wiz
 private final String pwd;
 private final String databaseUrl;
 private final String user;
+private final WizardDescriptor wd;
 private DatabaseConnection connection;
 private List schemas = null;
 private String currentSchema;
 private JDBCDriver jdbcDriver;
-private boolean increase = false;
-private WizardDescriptor wd;
 
 private AddConnectionWizard(JDBCDriver driver, String databaseUrl, String 
user, String password) {
 this.databaseUrl = databaseUrl;
@@ -123,30 +124,41 @@ public class AddConnectionWizard extends 
ConnectionDialogMediator implements Wiz
  */
 private WizardDescriptor.Panel[] getPanels() {
 if (panels == null) {
+boolean skipDriverSelection = false;
 if (jdbcDriver != null) {
 URL[] jars = jdbcDriver.getURLs();
 if (jars != null && jars.length > 0) {
 FileObject jarFO = URLMapper.findFileObject(jars[0]);
 if (jarFO != null && jarFO.isValid()) {
 
this.allPrivilegedFileNames.add(jarFO.getNameExt());
-this.increase = true;
+skipDriverSelection = true;
 }
 }
 }
-driverPanel = new ChoosingDriverPanel(jdbcDriver);
-panels = new Panel[] {
-driverPanel,
-new ConnectionPanel(),
-new ChoosingSchemaPanel(),
-new ChoosingConnectionNamePanel()
-};
-steps = new String[panels.length];
-steps = new String[] {
-NbBundle.getMessage(AddConnectionWizard.class, 
"ChoosingDriverUI.Name"), // NOI18N
-NbBundle.getMessage(AddConnectionWizard.class, 
"ConnectionPanel.Name"), // NOI18N
-NbBundle.getMessage(AddConnectionWizard.class, 
"ChoosingSchemaPanel.Name"), // NOI18N
-NbBundle.getMessage(AddConnectionWizard.class, 
"ChooseConnectionNamePanel.Name"), // NOI18N
-};
+List toPanels = new ArrayList<>();
+List toSteps = new ArrayList<>();
+int stepIndex = 0;
+
+if (!skipDriverSelection) {
+toPanels.add(new ChoosingDriverPanel(jdbcDriver, stepIndex));
+toSteps.add(NbBundle.getMessage(AddConnectionWizard.class, 
"ChoosingDriverUI.Name")); // NOI18N
+stepIndex++;
+}
+
+toPanels.add(new ConnectionPanel(stepIndex));
+toSteps.add(NbBundle.getMessage(AddConnectionWizard.class, 
"ConnectionPanel.Name")); // NOI18N
+stepIndex++;
+
+toPanels.add(new ChoosingSchemaPanel(stepIndex));
+toSteps.add(NbBundle.getMessage(AddConnectionWizard.class, 
"ChoosingSchemaPanel.Name")); // NOI18N
+stepIndex++;
+
+toPanels.add(new ChoosingConnectionNamePanel(stepIndex));
+toSteps.add(NbBundle.getMessage(AddConnectionWizard.class, 
"ChooseConnectionNamePanel.Name")); // NOI18N
+stepIndex++;
+
+panels = toPanels.toArray(new Panel[stepIndex]);
+steps = toSteps.toArray(new String[stepIndex]);
 }
 return panels;
 }
@@ -155,11 +167,6 @@ public class AddConnectionWizard exte

[netbeans] branch master updated (4e6ce19 -> 2cea3bf)

2021-05-22 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 4e6ce19  [NETBEANS-5693] Assure that debugger session finishes when 
native image application exits.
 new 5a34cc3  In the Database module, refactor the 'Add Connection' wizard 
to avoid depending on hardcoded wizard panel indexes.
 new 2cea3bf  Various small UI improvements to the database module's "New 
Connection" wizard.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../netbeans/modules/db/explorer/Bundle.properties |  4 +-
 .../db/explorer/dlg/AddConnectionWizard.java   | 51 --
 .../modules/db/explorer/dlg/AddDriverDialog.java   | 12 +++--
 .../explorer/dlg/ChoosingConnectionNamePanel.java  |  7 ++-
 .../db/explorer/dlg/ChoosingDriverPanel.java   |  6 ++-
 .../db/explorer/dlg/ChoosingSchemaPanel.java   |  9 +++-
 .../modules/db/explorer/dlg/ConnectionPanel.java   | 11 +++--
 .../db/explorer/dlg/NewConnectionPanel.java|  8 +++-
 .../org/netbeans/modules/db/util/Bundle.properties |  2 +-
 .../netbeans/modules/db/util/DriverListUtil.java   |  5 ++-
 .../src/org/netbeans/modules/db/util/JdbcUrl.java  | 17 ++--
 .../modules/db/util/DriverListUtilTest.java|  7 ++-
 12 files changed, 92 insertions(+), 47 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (3db00e6 -> 7cfbb58)

2021-05-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 3db00e6  Merge pull request #2904 from 
jlahoda/fix-missing-run-in-cpplite
 add 7cfbb58  [NETBEANS-5658] Add remaining icons in editor toolbar, and a 
few other icons. Copy the icons to all locations which used the same PNG file 
as well.

No new revisions were added by this update.

Summary of changes:
 .../modules/web/monitor/client/icons/delete.svg| 49 +---
 .../modules/bugtracking/ui/resources/find_next.svg | 69 +
 .../bugtracking/ui/resources/find_previous.svg | 69 +
 .../editor/bookmarks/resources/toggle_bookmark.svg | 85 ++---
 .../editor/macros/start_macro_recording.svg| 41 --
 .../macros/storage/ui/start_macro_recording.svg| 41 --
 .../modules/editor/search/resources/find_next.svg  | 69 +
 .../editor/search/resources/find_previous.svg  | 69 +
 .../editor/search/resources/find_selection.svg | 77 +++
 .../editor/search/resources/toggle_highlight.svg   | 79 
 .../netbeans/modules/editor/resources/comment.svg  | 79 
 .../editor/resources/last_edit_location_16.svg | 75 +++
 .../modules/editor/resources/navigate_back_16.svg  | 76 +++
 .../editor/resources/navigate_forward_16.svg   | 76 +++
 .../modules/editor/resources/rect_select_16x16.svg | 87 ++
 .../modules/editor/resources/shift_line_left.svg   | 72 ++
 .../modules/editor/resources/shift_line_right.svg  | 72 ++
 .../editor/resources/start_macro_recording.svg | 41 --
 .../modules/editor/resources/uncomment.svg | 67 +
 .../lib/terminalemulator/support/find_next.svg | 69 +
 .../lib/terminalemulator/support/find_previous.svg | 69 +
 .../project/ui/resources/broken-reference.svg  |  0
 .../netbeans/modules/server/ui/resources/cloud.svg | 72 ++
 .../java/project/ui/resources/broken-reference.svg |  0
 .../org/netbeans/actions/examples/icons/delete.svg | 49 +---
 .../modules/war-admin/web/img/default-icon.svg |  0
 .../modules/war-client/web/img/default-icon.svg|  0
 .../org/netbeans/core/windows/resources/delete.svg | 49 +---
 .../src/org/openide/resources/actions/delete.svg   | 49 +---
 .../web/webkit/tooling/networkmonitor/delete.svg   | 49 +---
 30 files changed, 1587 insertions(+), 112 deletions(-)
 copy 
ide/editor.macros/src/org/netbeans/modules/editor/macros/start_macro_recording.svg
 => 
enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/icons/delete.svg
 (50%)
 create mode 100644 
ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/resources/find_next.svg
 create mode 100644 
ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/resources/find_previous.svg
 create mode 100644 
ide/editor.search/src/org/netbeans/modules/editor/search/resources/find_next.svg
 create mode 100644 
ide/editor.search/src/org/netbeans/modules/editor/search/resources/find_previous.svg
 create mode 100644 
ide/editor.search/src/org/netbeans/modules/editor/search/resources/find_selection.svg
 create mode 100644 
ide/editor.search/src/org/netbeans/modules/editor/search/resources/toggle_highlight.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/comment.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/last_edit_location_16.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/navigate_back_16.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/navigate_forward_16.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/rect_select_16x16.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/shift_line_left.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/shift_line_right.svg
 create mode 100644 
ide/editor/src/org/netbeans/modules/editor/resources/uncomment.svg
 create mode 100644 
ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/support/find_next.svg
 create mode 100644 
ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/support/find_previous.svg
 copy 
websvccommon/websvc.saas.ui/src/org/netbeans/modules/websvc/saas/ui/resources/warning.svg
 => 
ide/projectui/src/org/netbeans/modules/project/ui/resources/broken-reference.svg
 (100%)
 create mode 100644 
ide/server/src/org/netbeans/modules/server/ui/resources/cloud.svg
 copy 
websvccommon/websvc.saas.ui/src/org/netbeans/modules/websvc/saas/ui/resources/warning.svg
 => 
java/java.project.ui/src/org/netbeans/modules/java/project/ui/resources/broken-reference.svg
 (100%)
 copy 
ide/edit

[netbeans] branch master updated: [NETBEANS-4857] Prevent property change events during tree sync

2020-10-12 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0b03065  [NETBEANS-4857] Prevent property change events during tree 
sync
0b03065 is described below

commit 0b030658851117088ba280db9458f3799e7817bf
Author: Michael Küttner 
AuthorDate: Mon Oct 12 22:53:13 2020 +0200

[NETBEANS-4857] Prevent property change events during tree sync

An ExplorerManager can be shared by multiple OutlineViews to synchronize 
displayed nodes and selection. This works fine for single node selection 
(ListSelectionModel.SINGLE_SELECTION).

But in case of multiple selection 
(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) the ExplorerManager creates 
way too many PropertyChangeEvents.

Use setValueAdjusting to coalesce these events.
---
 .../src/org/openide/explorer/view/OutlineView.java |   7 +
 .../view/OutlineViewSynchronizationTest.java   | 246 +
 2 files changed, 253 insertions(+)

diff --git 
a/platform/openide.explorer/src/org/openide/explorer/view/OutlineView.java 
b/platform/openide.explorer/src/org/openide/explorer/view/OutlineView.java
index 3cf63a5..eb71102 100644
--- a/platform/openide.explorer/src/org/openide/explorer/view/OutlineView.java
+++ b/platform/openide.explorer/src/org/openide/explorer/view/OutlineView.java
@@ -859,6 +859,10 @@ public class OutlineView extends JScrollPane {
 invalidate();
 validate();
 Node[] arr = manager.getSelectedNodes ();
+
+// [NETBEANS-4857]: prevent property change events during 
synchronization  
+outline.getSelectionModel().setValueIsAdjusting(true);
+
 outline.getSelectionModel().clearSelection();
 int size = outline.getRowCount();
 int firstSelection = -1;
@@ -876,6 +880,9 @@ public class OutlineView extends JScrollPane {
 }
 }
 }
+// [NETBEANS-4857]: re-activate property change events
+outline.getSelectionModel().setValueIsAdjusting(false);
+
 //
System.err.println("\nOutlineView.synchronizeSelectedNodes("+java.util.Arrays.toString(arr)+"):
 "+
 //   "columnModel = "+outline.getColumnModel()+", 
column selection model = "+outline.getColumnModel().getSelectionModel()+
 //   ", column lead selection index = 
"+outline.getColumnModel().getSelectionModel().getLeadSelectionIndex()+"\n");
diff --git 
a/platform/openide.explorer/test/unit/src/org/openide/explorer/view/OutlineViewSynchronizationTest.java
 
b/platform/openide.explorer/test/unit/src/org/openide/explorer/view/OutlineViewSynchronizationTest.java
new file mode 100644
index 000..fc25047
--- /dev/null
+++ 
b/platform/openide.explorer/test/unit/src/org/openide/explorer/view/OutlineViewSynchronizationTest.java
@@ -0,0 +1,246 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.openide.explorer.view;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JPanel;
+import javax.swing.ListSelectionModel;
+import org.netbeans.junit.NbTestCase;
+import org.netbeans.swing.outline.Outline;
+import org.openide.explorer.ExplorerManager;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.ChildFactory;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.lookup.AbstractLookup;
+import org.openide.util.lookup.InstanceContent;
+
+/**
+ * Tests fix of Jira issue [NETBEANS-4857]. There should be no additional
+ * property change events during outline view tree synchronization.
+ *
+ * @author Michael Kuettner
+ */
+public final class OutlineViewSynchronizationTest extends NbTestCase {
+
+public OutlineViewSynchronizationTest(Str

[netbeans] branch master updated: Hide the new SVG Loader module from the 'Plugins' list in NB platform applications.

2020-03-17 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 3e4fe38  Hide the new SVG Loader module from the 'Plugins' list in NB 
platform applications.
3e4fe38 is described below

commit 3e4fe382e66f547c50438856081d163a831e73fb
Author: Eirik Bakke 
AuthorDate: Tue Mar 17 17:57:52 2020 -0400

Hide the new SVG Loader module from the 'Plugins' list in NB platform 
applications.
---
 platform/openide.util.ui.svg/manifest.mf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/platform/openide.util.ui.svg/manifest.mf 
b/platform/openide.util.ui.svg/manifest.mf
index abe0f7d..00a8113 100644
--- a/platform/openide.util.ui.svg/manifest.mf
+++ b/platform/openide.util.ui.svg/manifest.mf
@@ -1,4 +1,5 @@
 Manifest-Version: 1.0
+AutoUpdate-Show-In-Client: false
 OpenIDE-Module: org.openide.util.ui.svg
 OpenIDE-Module-Localizing-Bundle: org/openide/util/svg/Bundle.properties
 OpenIDE-Module-Specification-Version: 1.1


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Improve a few more Windows LAF borders on HiDPI displays.

2020-02-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new fa81a8a  Improve a few more Windows LAF borders on HiDPI displays.
fa81a8a is described below

commit fa81a8a87861df1922c63f029d6db7d942b9bf22
Author: Eirik Bakke 
AuthorDate: Tue Feb 25 13:51:04 2020 -0500

Improve a few more Windows LAF borders on HiDPI displays.

This applies the LAF adjustments from NETBEANS-3592 to a few more cases; 
JPopupMenu, JMenu, and the grey background area of NetBeans that is shown when 
no files are opened for editing.
---
 .../src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
index 7b48937..4256fe6 100644
--- 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
+++ 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
@@ -180,7 +180,7 @@ public final class Windows8LFCustoms extends LFCustoms {
 not use the borders from UIManager. */
 for (String key : new String[] {
 "TextField.border", "PasswordField.border", 
"FormattedTextField.border", //NOI18N
-"ScrollPane.border" }) //NOI18N
+"ScrollPane.border", "PopupMenu.border", "Menu.border" }) 
//NOI18N
 {
 Object value = UIManager.getDefaults().get(key);
 if (value instanceof Border) {
@@ -227,7 +227,7 @@ public final class Windows8LFCustoms extends LFCustoms {
 DESKTOP_BACKGROUND, new Color(226, 223, 214), //NOI18N
 SCROLLPANE_BORDER_COLOR, new Color(127, 157, 185),
 DESKTOP_BORDER, new EmptyBorder(6, 5, 4, 6),
-SCROLLPANE_BORDER, UIManager.get("ScrollPane.border"),
+SCROLLPANE_BORDER, new DPIUnscaledBorder((Border) 
UIManager.get("ScrollPane.border")),
 EXPLORER_STATUS_BORDER, new StatusLineBorder(StatusLineBorder.TOP),
 EXPLORER_FOLDER_ICON , explorerIcon,
 EXPLORER_FOLDER_OPENED_ICON, explorerIcon,


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: [NETBEANS-3807] - cleanup ArrayList rawtype warnings (#1982)

2020-02-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 11a439b  [NETBEANS-3807] - cleanup ArrayList rawtype warnings (#1982)
11a439b is described below

commit 11a439bb22f4700adce29514a63f6b8dad904031
Author: Brad Walker 
AuthorDate: Wed Feb 26 10:05:14 2020 -0700

[NETBEANS-3807] - cleanup ArrayList rawtype warnings (#1982)

This change cleans up the following warning:

  [repeat] 
/home/bwalker/src/netbeans/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/ModelVisitor.java:1454:
 warning: [rawt
ypes] found raw type: ArrayList
  [repeat] private List declaredVars = new ArrayList();
  [repeat]  ^
  [repeat]   missing type arguments for generic class ArrayList
  [repeat]   where E is a type-variable:
  [repeat] E extends Object declared in class ArrayList
---
 ...nationalizationResourceBundleBrandingPanel.java |  2 +-
 .../tooling/admin/RunnerRestFetchLogData.java  |  2 +-
 .../websvc/rest/support/SourceGroupSupport.java|  2 +-
 .../src/org/netbeans/editor/ext/ExtFormatter.java  |  2 +-
 .../editor/ext/FormatTokenPositionSupport.java | 33 +++---
 .../editor/fold/ui/CaretFoldExpanderImpl.java  |  4 +--
 .../debugger/ui/views/ViewModelListener.java   | 16 +--
 ide/target.iterator/nbproject/project.properties   |  2 +-
 .../modules/target/iterator/api/BrowseFolders.java |  3 +-
 .../modules/xml/catalog/CatalogMounterModel.java   |  2 +-
 .../debugger/breakpoints/PersistenceManager.java   |  3 +-
 .../modules/dbschema/DBMemoryCollection.java   |  4 +--
 .../netbeans/modules/dbschema/TableElement.java|  9 +++---
 .../dbschema/jdbcimpl/DBElementsCollection.java|  4 +--
 .../dbschema/jdbcimpl/SchemaElementImpl.java   |  2 +-
 .../java/freeform/JavaProjectGenerator.java|  3 --
 .../refactoring/InspectAndRefactorPanel.java   |  2 +-
 .../modules/jshell/project/JShellOptions2.java |  2 +-
 .../codegen/java/support/SourceGroupSupport.java   |  2 +-
 .../editor/actions/ControllerGenerator.java|  2 +-
 .../javafx2/editor/completion/beans/FxBean.java|  3 +-
 .../core/multitabs/impl/TabLayoutManager.java  |  2 +-
 .../org/netbeans/core/multiview/MultiViewPeer.java |  6 ++--
 .../core/startup/layers/SessionManager.java| 10 ---
 .../profiler/heapwalk/model/HeapWalkerNode.java|  2 +-
 .../modules/javascript2/model/ModelVisitor.java| 24 
 26 files changed, 75 insertions(+), 73 deletions(-)

diff --git 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
index 315b3fe..91db0f4 100644
--- 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
+++ 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
@@ -537,7 +537,7 @@ public class 
InternationalizationResourceBundleBrandingPanel extends AbstractBra
 }
 
 private void refreshList() {
-List keys = new ArrayList();
+List keys = new ArrayList<>();
 Node[] origChildren = original.getChildren().getNodes();
 for (Node node : origChildren) {
 keys.add(node);
diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
index 97205ff..1847b25 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
@@ -221,7 +221,7 @@ public class RunnerRestFetchLogData extends RunnerRest {
 protected boolean processResponse() {
 // Make ArrayList copy of stored lines. ArrayList allows better access
 // to log values.
-List logLines = new ArrayList(lines.size());
+List logLines = new ArrayList<>(lines.size());
 for (String line : lines) {
 logLines.add(line);
 }
diff --git 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
 
b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
index 9d6e589..b0ae689 100644
--- 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport

[netbeans] branch master updated: [NETBEANS-3646] - Update google guava from 15.0 to 27.0 (#1828)

2020-02-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 5e72bd0  [NETBEANS-3646] - Update google guava from 15.0 to 27.0 
(#1828)
5e72bd0 is described below

commit 5e72bd0f65e264c40b4595635f8023a8c7c4e452
Author: Jose Luis 
AuthorDate: Wed Feb 26 10:54:07 2020 -0600

[NETBEANS-3646] - Update google guava from 15.0 to 27.0 (#1828)

Update google guava from 15.0 to 27.0.
---
 ide/c.google.guava/external/binaries-list   | 2 +-
 .../external/{guava-15.0-license.txt => guava-27.0-jre-license.txt} | 6 +++---
 ide/c.google.guava/nbproject/project.properties | 5 -
 ide/c.google.guava/nbproject/project.xml| 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ide/c.google.guava/external/binaries-list 
b/ide/c.google.guava/external/binaries-list
index 511cede..550cad3 100644
--- a/ide/c.google.guava/external/binaries-list
+++ b/ide/c.google.guava/external/binaries-list
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-ED727A8D9F247E2050281CB083F1C77B09DCB5CD com.google.guava:guava:15.0
+C6AD87D2575AF8AC8EC38E28E75AEFA882CC3A1F com.google.guava:guava:27.0-jre
diff --git a/ide/c.google.guava/external/guava-15.0-license.txt 
b/ide/c.google.guava/external/guava-27.0-jre-license.txt
similarity index 97%
rename from ide/c.google.guava/external/guava-15.0-license.txt
rename to ide/c.google.guava/external/guava-27.0-jre-license.txt
index 350b20f..9aeed4d 100644
--- a/ide/c.google.guava/external/guava-15.0-license.txt
+++ b/ide/c.google.guava/external/guava-27.0-jre-license.txt
@@ -1,8 +1,8 @@
 Name: Guava
-Version: 15.0
+Version: 27.0
 License: Apache-2.0
-Origin: https://code.google.com/p/guava-libraries/
-Description: collections, caching, primitives support, concurrency libraries, 
common annotations, string processing, I/O, and so forth
+Origin: https://github.com/google/guava
+Description: Guava is a set of core libraries that includes new collection 
types (such as multimap and multiset), immutable collections, a graph library, 
and utilities for concurrency, I/O, hashing, primitives, strings, and more.
 
 
  Apache License
diff --git a/ide/c.google.guava/nbproject/project.properties 
b/ide/c.google.guava/nbproject/project.properties
index 8c4893f..f3db1c1 100644
--- a/ide/c.google.guava/nbproject/project.properties
+++ b/ide/c.google.guava/nbproject/project.properties
@@ -14,6 +14,9 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-release.external/guava-15.0.jar=modules/com-google-guava.jar
+javac.compilerargs=-Xlint -Xlint:-serial
+javac.source=1.8
+spec.version.base=27.0
+release.external/guava-27.0-jre.jar=modules/com-google-guava.jar
 is.autoload=true
 nbm.module.author=Tomas Stupka
\ No newline at end of file
diff --git a/ide/c.google.guava/nbproject/project.xml 
b/ide/c.google.guava/nbproject/project.xml
index 3de127a..5ff2a37 100644
--- a/ide/c.google.guava/nbproject/project.xml
+++ b/ide/c.google.guava/nbproject/project.xml
@@ -28,7 +28,7 @@



com-google-guava.jar
-   external/guava-15.0.jar
+   external/guava-27.0-jre.jar
 
 
 


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Revert "[NETBEANS-3807] - cleanup ArrayList rawtype warnings.."

2020-02-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 02cb421  Revert "[NETBEANS-3807] - cleanup ArrayList rawtype 
warnings.."
02cb421 is described below

commit 02cb421077d9ccaa47ac4a5e3d1cda13e7d66c66
Author: Eirik Bakke 
AuthorDate: Fri Feb 21 20:37:43 2020 -0500

Revert "[NETBEANS-3807] - cleanup ArrayList rawtype warnings.."

(Reverting on ebarboni's request, since release work is underway.)

This reverts commit 682bd5713321f04739000f7cc3de402c82a915be.
---
 ...nationalizationResourceBundleBrandingPanel.java |  2 +-
 .../tooling/admin/RunnerRestFetchLogData.java  |  2 +-
 .../websvc/rest/support/SourceGroupSupport.java|  2 +-
 .../src/org/netbeans/editor/ext/ExtFormatter.java  |  2 +-
 .../editor/ext/FormatTokenPositionSupport.java | 33 +++---
 .../editor/fold/ui/CaretFoldExpanderImpl.java  |  4 +--
 .../debugger/ui/views/ViewModelListener.java   | 16 +--
 ide/target.iterator/nbproject/project.properties   |  2 +-
 .../modules/target/iterator/api/BrowseFolders.java |  3 +-
 .../modules/xml/catalog/CatalogMounterModel.java   |  2 +-
 .../debugger/breakpoints/PersistenceManager.java   |  3 +-
 .../modules/dbschema/DBMemoryCollection.java   |  4 +--
 .../netbeans/modules/dbschema/TableElement.java|  9 +++---
 .../dbschema/jdbcimpl/DBElementsCollection.java|  4 +--
 .../dbschema/jdbcimpl/SchemaElementImpl.java   |  2 +-
 .../java/freeform/JavaProjectGenerator.java|  3 ++
 .../refactoring/InspectAndRefactorPanel.java   |  2 +-
 .../modules/jshell/project/JShellOptions2.java |  2 +-
 .../codegen/java/support/SourceGroupSupport.java   |  2 +-
 .../editor/actions/ControllerGenerator.java|  2 +-
 .../javafx2/editor/completion/beans/FxBean.java|  3 +-
 .../core/multitabs/impl/TabLayoutManager.java  |  2 +-
 .../org/netbeans/core/multiview/MultiViewPeer.java |  6 ++--
 .../core/startup/layers/SessionManager.java| 10 +++
 .../profiler/heapwalk/model/HeapWalkerNode.java|  2 +-
 .../modules/javascript2/model/ModelVisitor.java| 24 
 26 files changed, 73 insertions(+), 75 deletions(-)

diff --git 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
index 91db0f4..315b3fe 100644
--- 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
+++ 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
@@ -537,7 +537,7 @@ public class 
InternationalizationResourceBundleBrandingPanel extends AbstractBra
 }
 
 private void refreshList() {
-List keys = new ArrayList<>();
+List keys = new ArrayList();
 Node[] origChildren = original.getChildren().getNodes();
 for (Node node : origChildren) {
 keys.add(node);
diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
index 1847b25..97205ff 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
@@ -221,7 +221,7 @@ public class RunnerRestFetchLogData extends RunnerRest {
 protected boolean processResponse() {
 // Make ArrayList copy of stored lines. ArrayList allows better access
 // to log values.
-List logLines = new ArrayList<>(lines.size());
+List logLines = new ArrayList(lines.size());
 for (String line : lines) {
 logLines.add(line);
 }
diff --git 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
 
b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
index b0ae689..9d6e589 100644
--- 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
+++ 
b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
@@ -192,7 +192,7 @@ public class SourceGroupSupport {
 private static List getTestTargets(SourceGroup sourceGroup, 
Map foldersToSourceGroupsMap) {
 final URL[] rootURLs = 
UnitTestForSourceQuery.findUnitTests(sourceGroup.getRootFolder());
 if (rootURLs.length == 0

[netbeans] branch master updated: [NETBEANS-3807] - cleanup ArrayList rawtype warnings..

2020-02-21 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 682bd57  [NETBEANS-3807] - cleanup ArrayList rawtype warnings..
682bd57 is described below

commit 682bd5713321f04739000f7cc3de402c82a915be
Author: Brad Walker 
AuthorDate: Thu Feb 6 17:44:38 2020 -0700

[NETBEANS-3807] - cleanup ArrayList rawtype warnings..

This change cleans up the following warning..

   [repeat] 
/home/bwalker/src/netbeans/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/ModelVisitor.java:1454:
 warning: [rawtypes] found raw type: ArrayList
   [repeat] private List declaredVars = new 
ArrayList();
   [repeat]  ^
   [repeat]   missing type arguments for generic class ArrayList
   [repeat]   where E is a type-variable:
   [repeat] E extends Object declared in class ArrayList
---
 ...nationalizationResourceBundleBrandingPanel.java |  2 +-
 .../tooling/admin/RunnerRestFetchLogData.java  |  2 +-
 .../websvc/rest/support/SourceGroupSupport.java|  2 +-
 .../src/org/netbeans/editor/ext/ExtFormatter.java  |  2 +-
 .../editor/ext/FormatTokenPositionSupport.java | 33 +++---
 .../editor/fold/ui/CaretFoldExpanderImpl.java  |  4 +--
 .../debugger/ui/views/ViewModelListener.java   | 16 +--
 ide/target.iterator/nbproject/project.properties   |  2 +-
 .../modules/target/iterator/api/BrowseFolders.java |  3 +-
 .../modules/xml/catalog/CatalogMounterModel.java   |  2 +-
 .../debugger/breakpoints/PersistenceManager.java   |  3 +-
 .../modules/dbschema/DBMemoryCollection.java   |  4 +--
 .../netbeans/modules/dbschema/TableElement.java|  9 +++---
 .../dbschema/jdbcimpl/DBElementsCollection.java|  4 +--
 .../dbschema/jdbcimpl/SchemaElementImpl.java   |  2 +-
 .../java/freeform/JavaProjectGenerator.java|  3 --
 .../refactoring/InspectAndRefactorPanel.java   |  2 +-
 .../modules/jshell/project/JShellOptions2.java |  2 +-
 .../codegen/java/support/SourceGroupSupport.java   |  2 +-
 .../editor/actions/ControllerGenerator.java|  2 +-
 .../javafx2/editor/completion/beans/FxBean.java|  3 +-
 .../core/multitabs/impl/TabLayoutManager.java  |  2 +-
 .../org/netbeans/core/multiview/MultiViewPeer.java |  6 ++--
 .../core/startup/layers/SessionManager.java| 10 ---
 .../profiler/heapwalk/model/HeapWalkerNode.java|  2 +-
 .../modules/javascript2/model/ModelVisitor.java| 24 
 26 files changed, 75 insertions(+), 73 deletions(-)

diff --git 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
index 315b3fe..91db0f4 100644
--- 
a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
+++ 
b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/branding/InternationalizationResourceBundleBrandingPanel.java
@@ -537,7 +537,7 @@ public class 
InternationalizationResourceBundleBrandingPanel extends AbstractBra
 }
 
 private void refreshList() {
-List keys = new ArrayList();
+List keys = new ArrayList<>();
 Node[] origChildren = original.getChildren().getNodes();
 for (Node node : origChildren) {
 keys.add(node);
diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
index 97205ff..1847b25 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerRestFetchLogData.java
@@ -221,7 +221,7 @@ public class RunnerRestFetchLogData extends RunnerRest {
 protected boolean processResponse() {
 // Make ArrayList copy of stored lines. ArrayList allows better access
 // to log values.
-List logLines = new ArrayList(lines.size());
+List logLines = new ArrayList<>(lines.size());
 for (String line : lines) {
 logLines.add(line);
 }
diff --git 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
 
b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
index 9d6e589..b0ae689 100644
--- 
a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java
+++ 

[netbeans] branch master updated (7a525ec -> 36e10d1)

2020-02-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 7a525ec  Merge pull request #1930 from 
DevCharly/flatlaf-dark-tab-project-foreground
 add 36e10d1  [NETBEANS-3671] Fix two ImageUtilities issues (#1922)

No new revisions were added by this update.

Summary of changes:
 .../src/org/openide/util/CachedHiDPIIcon.java  | 16 +--
 .../src/org/openide/util/FilteredIcon.java | 14 ++
 .../src/org/openide/util/ImageUtilities.java   | 25 ++-
 .../src/org/openide/util/ImageUtilitiesTest.java   | 52 ++
 4 files changed, 102 insertions(+), 5 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (9899e6c -> 820a688)

2020-01-16 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 9899e6c  [NETBEANS-3115] Resolve third-party source against open 
Gradle projects.
 add 820a688  [NETBEANS-3695] - not proper to use a static variable through 
a reference (#1872)

No new revisions were added by this update.

Summary of changes:
 .../modules/glassfish/javaee/RunTimeDDCatalog.java |  4 ++--
 .../modules/payara/jakartaee/RunTimeDDCatalog.java |  4 ++--
 .../analysis/ui/ConfigurationsComboModel.java  |  2 +-
 .../nativeexecution/api/util/Authentication.java   |  2 +-
 .../netbeans/modules/image/ImagePrintSupport.java  |  2 +-
 .../debugger/ui/views/debugging/TapPanel.java  |  2 +-
 .../modules/bugtracking/commons/LinkButton.java|  8 
 .../modules/terminal/nb/TermOptionsPanel.java  |  2 +-
 .../modules/xml/api/model/GrammarQueryManager.java |  4 ++--
 .../lib/XSLT10PseudoDTDGrammarQueryProvider.java   |  2 +-
 .../ant/grammar/AntGrammarQueryProvider.java   |  2 +-
 .../refactoring/ConfigurationsComboModel.java  |  2 +-
 .../src/org/openide/actions/HeapView.java  |  4 ++--
 .../src/org/openide/actions/PasteAction.java   |  2 +-
 .../openide/explorer/propertysheet/BaseTable.java  |  6 +++---
 .../explorer/propertysheet/ComboInplaceEditor.java |  8 
 .../openide/explorer/propertysheet/IconPanel.java  |  2 +-
 .../explorer/propertysheet/PropertyPanel.java  |  2 +-
 .../explorer/propertysheet/RadioInplaceEditor.java |  9 
 .../explorer/propertysheet/RendererFactory.java|  2 +-
 .../profiler/options/ui/ProfilerOptionsPanel.java  | 24 +++---
 .../cordova/platforms/android/AndroidDevice.java   |  2 +-
 .../modules/javascript2/lexer/JsonLexer.java   |  2 +-
 .../requirejs/html/RequireJsHtmlExtension.java |  2 +-
 24 files changed, 51 insertions(+), 50 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (eb5595b -> f27be83)

2020-01-11 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from eb5595b  Merge pull request #1823 from blackleg/java_tests
 add f27be83  [NETBEANS-3581] Improvements to 
DropDownButton/DropDownToggleButton (#1778)

No new revisions were added by this update.

Summary of changes:
 .../src/org/openide/awt/DropDownButton.java| 43 +++--
 .../src/org/openide/awt/DropDownToggleButton.java  | 54 +-
 2 files changed, 60 insertions(+), 37 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (7813792 -> 79ad0e9)

2020-01-03 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 7813792  [NETBEANS-2954] Fix broken tab dragging on HiDPI displays 
(Windows) (#1804)
 add 79ad0e9  [NETBEANS-3592] Workarounds for JDK Windows LAF bugs on HiDPI 
screens (#1777)

No new revisions were added by this update.

Summary of changes:
 .../src/org/netbeans/swing/plaf/AllLFCustoms.java  |   1 +
 .../swing/plaf/windows8/DPISafeBorder.java | 135 ---
 .../swing/plaf/windows8/DPIUnscaledBorder.java | 105 +
 .../swing/plaf/windows8/Windows8LFCustoms.java | 148 ++--
 .../plaf/windows8/WindowsDPIWorkaroundIcon.java| 254 +
 5 files changed, 494 insertions(+), 149 deletions(-)
 delete mode 100644 
platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/DPISafeBorder.java
 create mode 100644 
platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/DPIUnscaledBorder.java
 create mode 100644 
platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/WindowsDPIWorkaroundIcon.java


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: [NETBEANS-2954] Fix broken tab dragging on HiDPI displays (Windows) (#1804)

2020-01-03 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 7813792  [NETBEANS-2954] Fix broken tab dragging on HiDPI displays 
(Windows) (#1804)
7813792 is described below

commit 78137924fbe8d8a51ccf4bc98ed746675ea3b4c7
Author: Eirik Bakke 
AuthorDate: Fri Jan 3 11:40:26 2020 +0100

[NETBEANS-2954] Fix broken tab dragging on HiDPI displays (Windows) (#1804)

[NETBEANS-2954] Fix broken tab dragging in window system on HiDPI displays 
on Windows
---
 .../view/dnd/DragAndDropFeedbackVisualizer.java|  6 ++--
 .../windows/view/dnd/TopComponentDragSupport.java  |  6 ++--
 .../core/windows/view/dnd/WindowDnDManager.java| 41 --
 .../core/windows/view/ui/toolbars/DnDSupport.java  | 17 +
 4 files changed, 56 insertions(+), 14 deletions(-)

diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
index 9343b24..3a550b0 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
@@ -128,8 +128,10 @@ public class DragAndDropFeedbackVisualizer {
 }
 
 public void update(DragSourceDragEvent e) {
-if( null != dragWindow )
-dragWindow.setLocation( e.getLocation().x-dragOffset.x, 
e.getLocation().y-dragOffset.y );
+if( null != dragWindow ) {
+Point location = WindowDnDManager.getLocationWorkaround(e);
+dragWindow.setLocation( location.x-dragOffset.x, 
location.y-dragOffset.y );
+}
 }
 
 public void dispose( boolean dropSuccessful ) {
diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
index 27e7572..58d2c24 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
@@ -568,11 +568,12 @@ implements AWTEventListener, DragSourceListener, 
DragSourceMotionListener {
 final Set floatingFrames = 
windowDnDManager.getFloatingFrames();
 // Finally schedule the "drop" task later to be able to
 // detect if ESC was pressed.
+final Point location = WindowDnDManager.getLocationWorkaround(evt);
 RequestProcessor.getDefault().post(new Runnable() {
 @Override
 public void run() {
 SwingUtilities.invokeLater(createDropIntoFreeAreaTask(
-evt, evt.getLocation(), floatingFrames));
+evt, location, floatingFrames));
 }},
 350 // XXX #21918, Neccessary to skip after possible ESC key 
event.
 );
@@ -589,8 +590,7 @@ implements AWTEventListener, DragSourceListener, 
DragSourceMotionListener {
 return true;
 }
 
-// Gets location.
-Point location = evt.getLocation();
+Point location = WindowDnDManager.getLocationWorkaround(evt);
 if(location == null) {
 return true;
 }
diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/WindowDnDManager.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/WindowDnDManager.java
index a5206c8..7980960 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/dnd/WindowDnDManager.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/dnd/WindowDnDManager.java
@@ -35,6 +35,7 @@ import org.netbeans.core.windows.*;
 import org.netbeans.core.windows.view.*;
 import org.netbeans.core.windows.view.ui.*;
 import org.openide.util.Lookup;
+import org.openide.util.Utilities;
 import org.openide.util.WeakSet;
 import org.openide.windows.TopComponent;
 
@@ -111,8 +112,44 @@ implements DropTargetGlassPane.Observer, 
DropTargetGlassPane.Informer {
  AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK
 );
 }
-
 
+/**
+ * Get the location of a {@link DragSourceEvent}, incorporating a 
workaround for a JDK bug on
+ * HiDPI screens on Windows. See NETBEANS-2954. This method should be 
called only while the
+ * mouse pointer is still likely to be in the same position as it was when 
the event was
+ * originally created.
+ */
+public static Point getLocationWorkaround(DragSourceEvent evt) {
+Point ret = evt.getLocation();
+if (Utilities.isWindows() && ret != null) {
+/* Workaround

[netbeans] branch master updated: Fixed an incorreclty filled-in apichanges.xml in the previously merged PR.

2019-12-31 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c4e9608  Fixed an incorreclty filled-in apichanges.xml in the 
previously merged PR.
c4e9608 is described below

commit c4e9608217489366edbba3f414771b4038562a4f
Author: Eirik Bakke 
AuthorDate: Tue Dec 31 18:47:38 2019 +0100

Fixed an incorreclty filled-in apichanges.xml in the previously merged PR.
---
 platform/openide.awt/apichanges.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/openide.awt/apichanges.xml 
b/platform/openide.awt/apichanges.xml
index 78e8f0b..2fa337b 100644
--- a/platform/openide.awt/apichanges.xml
+++ b/platform/openide.awt/apichanges.xml
@@ -28,7 +28,7 @@
 
 
 
-Added factory class for drop-down buttons
+Added DropDownButtonFactory.getArrowIcon method.
 
 
 


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (b8fb34d -> 4b1d25f)

2019-12-13 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from b8fb34d  Merge branch 'master' of https://github.com/apache/netbeans
 add fecc9c7  Improve a logging statement in WarmUpSupport, where a NPE was 
once observed.
 add 4b1d25f  Removed 'NetBeans is currently undergoing Incubation' notice 
from About box, and fixed a stray space in updater splash screen.

No new revisions were added by this update.

Summary of changes:
 .../libsrc/org/netbeans/updater/Bundle.properties |  2 +-
 .../src/org/netbeans/core/startup/WarmUpSupport.java  | 11 +--
 platform/o.n.core/src/org/netbeans/core/ui/Bundle.properties  |  3 +--
 3 files changed, 11 insertions(+), 5 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (bd154f8 -> 23ccd9d)

2019-11-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from bd154f8  [NETBEANS-3432] Removed the auto activation code from Dark 
LaF Support
 new 51a01eb  [NETBEANS-2604] Support SVG icon loading from ImageUtilities
 new 23ccd9d  Simplify/improve the HiDPI splash screen support code.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nbbuild/cluster.properties |   6 +-
 .../licenses/Apache-2.0-XML-Commons-APIs   |  61 +-
 .../netbeans/core/startup/ScaledBitmapIcon.java| 127 ---
 .../libs.batik.read}/build.xml |   8 +-
 .../external/batik-1.12-license.txt|  10 +-
 .../libs.batik.read/external/batik-1.12-notice.txt |  18 ++
 platform/libs.batik.read/external/binaries-list|  34 +++
 .../external/xml-apis-ext-1.3.04-license.txt   |  65 +-
 .../external/xml-apis-ext-1.3.04-notice.txt|  10 +
 .../external/xmlgraphics-commons-2.4-license.txt   |   9 +-
 .../external/xmlgraphics-commons-2.4-notice.txt|   5 +
 platform/libs.batik.read/manifest.mf   |   5 +
 .../libs.batik.read/nbproject/project.properties   |  56 +
 platform/libs.batik.read/nbproject/project.xml | 203 ++
 .../org/netbeans/libs/batik/read/Bundle.properties |   8 +-
 {ide => platform}/o.apache.commons.io/build.xml|   2 +-
 .../o.apache.commons.io/external/binaries-list |   0
 .../external/commons-io-1.4-license.txt|   0
 .../external/commons-io-1.4-notice.txt |   0
 {ide => platform}/o.apache.commons.io/manifest.mf  |   0
 .../nbproject/project.properties   |   0
 .../o.apache.commons.io/nbproject/project.xml  |   0
 .../o.apache.commons.logging/build.xml |   2 +-
 .../external/binaries-list |   0
 .../external/commons-logging-1.1.1-license.txt |   0
 .../external/commons-logging-1.1.1-notice.txt  |   0
 .../o.apache.commons.logging/manifest.mf   |   0
 .../nbproject/project.properties   |   0
 .../o.apache.commons.logging/nbproject/project.xml |   0
 .../src/org/openide/resources/actions/redo.svg |  82 +++
 .../src/org/openide/resources/actions/undo.svg |  82 +++
 .../openide.util.ui.svg}/build.xml |   4 +-
 platform/openide.util.ui.svg/manifest.mf   |   4 +
 .../nbproject/project.properties   |   5 +-
 .../nbproject/project.xml  |  51 ++---
 .../src/org/openide/util/svg/Bundle.properties |   7 +-
 .../src/org/openide/util/svg/SVGIcon.java  | 209 ++
 .../src/org/openide/util/svg/SVGLoaderImpl.java|  33 +++
 platform/openide.util.ui/apichanges.xml|  27 +++
 platform/openide.util.ui/arch.xml  |   7 +-
 platform/openide.util.ui/nbproject/project.xml |   1 +
 .../src/org/openide/util/CachedHiDPIIcon.java  |  81 +--
 .../src/org/openide/util/FilteredIcon.java |  11 +-
 .../src/org/openide/util/ImageUtilities.java   | 236 ++---
 .../src/org/openide/util/spi/SVGLoader.java|  40 
 .../openide/util/ImageUtilitiesGetLoaderTest.java  |   4 +-
 .../modules/javascript/nodejs/ui/resources/npm.svg |   2 +-
 47 files changed, 1257 insertions(+), 258 deletions(-)
 copy ide/o.apache.commons.io/external/commons-io-1.4-license.txt => 
nbbuild/licenses/Apache-2.0-XML-Commons-APIs (78%)
 copy {ide/o.apache.commons.io => platform/libs.batik.read}/build.xml (70%)
 copy ide/o.apache.commons.logging/external/commons-logging-1.1.1-license.txt 
=> platform/libs.batik.read/external/batik-1.12-license.txt (95%)
 create mode 100644 platform/libs.batik.read/external/batik-1.12-notice.txt
 create mode 100644 platform/libs.batik.read/external/binaries-list
 copy ide/o.apache.commons.io/external/commons-io-1.4-license.txt => 
platform/libs.batik.read/external/xml-apis-ext-1.3.04-license.txt (77%)
 create mode 100644 
platform/libs.batik.read/external/xml-apis-ext-1.3.04-notice.txt
 copy ide/o.apache.commons.logging/external/commons-logging-1.1.1-license.txt 
=> platform/libs.batik.read/external/xmlgraphics-commons-2.4-license.txt (98%)
 create mode 100644 
platform/libs.batik.read/external/xmlgraphics-commons-2.4-notice.txt
 create mode 100644 platform/libs.batik.read/manifest.mf
 create mode 100644 platform/libs.batik.read/nbproject/project.properties
 create mode 100644 platform/libs.batik.read/nbproject/project.xml
 copy ide/o.apache.commons.logging/nbproject/project.properties => 
platform/libs.batik.read/src/org/netbeans/libs/batik/read/Bun

[netbeans] 01/02: [NETBEANS-2604] Support SVG icon loading from ImageUtilities

2019-11-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 51a01eb9cbfc6f342a1827d47f0b37e1b2f070a3
Author: Eirik Bakke 
AuthorDate: Sat Jun 1 00:20:11 2019 -0400

[NETBEANS-2604] Support SVG icon loading from ImageUtilities

As a part of the effort to make NetBeans look better on HiDPI displays, the
ImageUtilities class has now been completely updated to support scalable
implementations of the java.awt.Icon interface, and to support loading of 
icons
and images from SVG files. If an SVG file resource exists with the same base
name as an existing bitmap icon, and the SVG loader implementation modules 
is
installed, the SVG file will be loaded instead (e.g. "icon.svg" will be 
loaded
instead of "icon.png"). SVG file resources can also be loaded explicitly.

Details:
* Have ImageUtilities support SVG image loading via an optional pluggable
  service provider, and add an implementation based on the Batik SVG 
library.
  The latter is enabled by default in the "platform" cluster.
* Add SVG versions of the Undo/Redo action icons (visible in the Edit menu 
and
  in the NetBeans toolbar in "Small Toolbar Icons" mode). This will serve to
  test SVG icon loading and painting.
* Moved the o.apache.commons.io and o.apache.commons.logging modules from 
the
  "ide" cluster and into the "platform" cluster, as Batik depends on these
  libraries.
* Refactor, clean up, and generalize ImageUtilities.getLoader; it is used to
  fetch and cache both the ClassLoader and the SVGLoader implementation. The
  SVG loader implementation module will only be loaded once an actual SVG 
file
  is found and needs to be loaded.
---
 nbbuild/cluster.properties |   6 +-
 .../licenses/Apache-2.0-XML-Commons-APIs   |  61 +-
 .../libs.batik.read}/build.xml |   8 +-
 .../external/batik-1.12-license.txt|  10 +-
 .../libs.batik.read/external/batik-1.12-notice.txt |  18 ++
 platform/libs.batik.read/external/binaries-list|  34 +++
 .../external/xml-apis-ext-1.3.04-license.txt   |  65 +-
 .../external/xml-apis-ext-1.3.04-notice.txt|  10 +
 .../external/xmlgraphics-commons-2.4-license.txt   |   9 +-
 .../external/xmlgraphics-commons-2.4-notice.txt|   5 +
 platform/libs.batik.read/manifest.mf   |   5 +
 .../libs.batik.read/nbproject/project.properties   |  56 +
 platform/libs.batik.read/nbproject/project.xml | 203 ++
 .../org/netbeans/libs/batik/read/Bundle.properties |   8 +-
 {ide => platform}/o.apache.commons.io/build.xml|   2 +-
 .../o.apache.commons.io/external/binaries-list |   0
 .../external/commons-io-1.4-license.txt|   0
 .../external/commons-io-1.4-notice.txt |   0
 {ide => platform}/o.apache.commons.io/manifest.mf  |   0
 .../nbproject/project.properties   |   0
 .../o.apache.commons.io/nbproject/project.xml  |   0
 .../o.apache.commons.logging/build.xml |   2 +-
 .../external/binaries-list |   0
 .../external/commons-logging-1.1.1-license.txt |   0
 .../external/commons-logging-1.1.1-notice.txt  |   0
 .../o.apache.commons.logging/manifest.mf   |   0
 .../nbproject/project.properties   |   0
 .../o.apache.commons.logging/nbproject/project.xml |   0
 .../src/org/openide/resources/actions/redo.svg |  82 +++
 .../src/org/openide/resources/actions/undo.svg |  82 +++
 .../openide.util.ui.svg}/build.xml |   4 +-
 platform/openide.util.ui.svg/manifest.mf   |   4 +
 .../nbproject/project.properties   |   5 +-
 .../nbproject/project.xml  |  51 ++---
 .../src/org/openide/util/svg/Bundle.properties |   7 +-
 .../src/org/openide/util/svg/SVGIcon.java  | 209 ++
 .../src/org/openide/util/svg/SVGLoaderImpl.java|  33 +++
 platform/openide.util.ui/apichanges.xml|  27 +++
 platform/openide.util.ui/arch.xml  |   7 +-
 platform/openide.util.ui/nbproject/project.xml |   1 +
 .../src/org/openide/util/CachedHiDPIIcon.java  |  81 +--
 .../src/org/openide/util/FilteredIcon.java |  11 +-
 .../src/org/openide/util/ImageUtilities.java   | 236 ++---
 .../src/org/openide/util/spi/SVGLoader.java|  40 
 .../openide/util/ImageUtilitiesGetLoaderTest.java  |   4 +-
 .../modules/javascript/nodejs/ui/resources/npm.svg |   2 +-
 46 files changed, 1215 insertions(+), 173 deletions(-)

diff --git a/nbbuild/cluster.properties b/nbbuild/cluster.properties
index 588849e..783e5ba 100644
--- a/nbbuild/cluster.properties
+++ b/nbbuild/cluster.properties
@

[netbeans] 02/02: Simplify/improve the HiDPI splash screen support code.

2019-11-26 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 23ccd9d64f7e4a30316444b56eeea330c161f916
Author: Eirik Bakke 
AuthorDate: Thu Jul 25 04:45:33 2019 -0400

Simplify/improve the HiDPI splash screen support code.

Details:
* Use the shared caching logic for scaled HiDPI image variants now 
available by
  subclassing from org.openide.util.CachedHiDPIIcon.
* Properly wait for the image to load before scaling (via ImageIcon's
  MediaTracker).
* Rename ScaledBitmapIcon.width/height to sourceWidth/sourceHeight.
* Document some known image scaling issues on Java.
---
 .../netbeans/core/startup/ScaledBitmapIcon.java| 127 +++--
 1 file changed, 42 insertions(+), 85 deletions(-)

diff --git 
a/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java 
b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
index dec4ee0..2f222f4 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
@@ -19,110 +19,67 @@
 package org.netbeans.core.startup;
 
 import java.awt.Component;
-import java.awt.Graphics;
 import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
 import java.awt.Image;
 import java.awt.RenderingHints;
-import java.awt.Transparency;
 import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
+import java.awt.image.ColorModel;
 import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import org.openide.util.CachedHiDPIIcon;
+import org.openide.util.Parameters;
 
-/* Package-private for now. At some later point it might be useful to expose 
the DPI-based caching
-functionality in this class as a more general utility. */
 /**
  * An Icon implementation that scales a source image to the specified 
dimensions. Can be used to
  * produce sharp images on HiDPI displays, without relying on 
MultiResolutionImage, which exists
  * only since JDK 9. This also sidesteps 
https://bugs.openjdk.java.net/browse/JDK-8212226 on
- * Windows. For HiDPI displays, the source image's dimensions should be at 
least double those of the
- * icon's logical dimensions. A double-resolution source image will 
automatically be scaled down
- * to 1x, 1.5x, or other HiDPI scaling factors as needed.
+ * Windows. It's recommended to use a source image with dimensions that are 
exactly twice those of
+ * the icon's logical dimensions. A double-resolution source image will 
automatically be scaled
+ * down to 1x, 1.5x, or other HiDPI scaling factors as needed.
  */
-final class ScaledBitmapIcon implements Icon {
-private final Map cache = new ConcurrentHashMap<>();
+final class ScaledBitmapIcon extends CachedHiDPIIcon {
 private final Image sourceImage;
-private final int width;
-private final int height;
+private final int sourceWidth;
+private final int sourceHeight;
 
 public ScaledBitmapIcon(Image sourceImage, int width, int height) {
-if (sourceImage == null)
-throw new NullPointerException();
-if (width <= 0)
-throw new IllegalArgumentException();
-if (height <= 0)
-throw new IllegalArgumentException();
+super(width, height);
+Parameters.notNull("sourceImage", sourceImage);
 this.sourceImage = sourceImage;
-this.width = width;
-this.height = height;
-}
-
-private Image getScaledImage(GraphicsConfiguration gc, double dpiScaling) {
-Image ret = cache.get(dpiScaling);
-if (ret != null) {
-return ret;
-}
-final BufferedImage img = gc.createCompatibleImage(
-(int) Math.ceil(getIconWidth() * dpiScaling),
-(int) Math.ceil(getIconHeight() * dpiScaling), 
Transparency.TRANSLUCENT);
-final double sourceWidth = sourceImage.getWidth(null);
-final double sourceHeight = sourceImage.getHeight(null);
-if (sourceWidth >= 1 && sourceHeight >= 1) {
-  final Graphics2D imgG = (Graphics2D) img.getGraphics();
-  try {
-  imgG.setTransform(AffineTransform.getScaleInstance(
-  dpiScaling * getIconWidth() / sourceWidth,
-  dpiScaling * getIconHeight() / sourceHeight));
-  imgG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
RenderingHints.VALUE_ANTIALIAS_ON);
-  imgG.setRenderingHint(RenderingHints.KEY_INTERPOLATION, 
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
-  imgG.setRenderingHint(RenderingHints.KEY_RENDERING, 
RenderingHints.VALUE_RENDER_QUALITY);
-  imgG.drawImage(sourceImage, 0, 0, null);
-  } finally {
-   

[netbeans] branch master updated (340934e -> 7d7d0f7)

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 340934e  [NETBEANS-2506] Added OpenJFX Samples module to JavaFX 
cluster, including two Maven samples (#1241)
 new b211ac8  Factored out the parameter parsing logic for the splash 
screen's status line, in preparation for adding a separate optional version 
text box.
 new 437a29d  Added the ability to have a version string automatically 
added to the splash screen.
 new 7efecbc  Add splash screen with dynamic version information added at 
runtime.
 new 2b18f36  Support proper HiDPI rendering of splash screen and About box 
images. (The splash screen image was already added in high resolution in a 
previous commit.)
 new 7d7d0f7  Some formatting fixes related to the commits in this PR.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../updater/resources/updatersplash_nb.gif | Bin 5499 -> 7449 bytes
 .../org/netbeans/core/startup/Bundle_nb.properties |  29 ++-
 .../org/netbeans/core/startup/about_dark_nb.png| Bin 23598 -> 15243 bytes
 .../src/org/netbeans/core/startup/about_nb.png | Bin 23598 -> 15243 bytes
 .../org/netbeans/core/startup/splash_dark_nb.gif   | Bin 44561 -> 15243 bytes
 .../src/org/netbeans/core/startup/splash_nb.gif| Bin 44561 -> 15243 bytes
 platform/core.startup/apichanges.xml   |  18 ++
 .../netbeans/core/startup/ScaledBitmapIcon.java| 128 ++
 .../src/org/netbeans/core/startup/Splash.java  | 270 ++---
 .../netbeans/core/ui/ProductInformationPanel.java  |   6 +-
 10 files changed, 359 insertions(+), 92 deletions(-)
 create mode 100644 
platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/05: Factored out the parameter parsing logic for the splash screen's status line, in preparation for adding a separate optional version text box.

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit b211ac86e9fb75f1587b8115a910a39bdf866e46
Author: Eirik Bakke 
AuthorDate: Sat May 11 02:01:54 2019 +0200

Factored out the parameter parsing logic for the splash screen's status 
line, in preparation for adding a separate optional version text box.

No behavior should change as a result of this commit (refactoring only).
---
 .../src/org/netbeans/core/startup/Splash.java  | 157 +
 1 file changed, 98 insertions(+), 59 deletions(-)

diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java 
b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
index a48e6a0..7bb15ea 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
@@ -271,17 +271,91 @@ public final class Splash implements Stamps.Updater {
 }
 }
 
+private static final class TextBox {
+final Rectangle bounds;
+final Color color;
+final int textSize;
+final Font font;
+final FontMetrics fm;
+// Will be set by SwingUtilities.layoutCompoundLabel.
+final Rectangle effectiveBounds = new Rectangle();
+
+private TextBox(
+Rectangle bounds, Color color, int textSize, Font font, 
FontMetrics fontMetrics)
+{
+this.bounds = bounds;
+this.color = color;
+this.textSize = textSize;
+this.font = font;
+this.fm = fontMetrics;
+}
+
+/**
+ * Compute the text layout and, if graphics is not null, paint the 
text string.
+ */
+public void layout(String text, Graphics graphics) {
+if (fm == null) {
+  // XXX(-ttran) this happened on Japanese Windows NT, don't
+  // fully understand why
+  return;
+}
+SwingUtilities.layoutCompoundLabel(fm, text, null,
+BOTTOM, LEFT, BOTTOM, LEFT,
+bounds, new Rectangle(), effectiveBounds, 0);
+if (graphics != null) {
+  graphics.setColor(color);
+  graphics.setFont(font);
+  graphics.drawString(text, effectiveBounds.x, effectiveBounds.y + 
fm.getAscent());
+}
+}
+
+public static TextBox parse(Graphics graphics, JComponent comp, 
ResourceBundle bundle,
+String prefix, boolean optional)
+{
+if (optional && !bundle.containsKey(prefix + "Bounds"))
+  return null;
+StringTokenizer st = new StringTokenizer(
+bundle.getString(prefix + "Bounds"), " ,"); // NOI18N
+Rectangle bounds = new Rectangle(Integer.parseInt(st.nextToken()),
+Integer.parseInt(st.nextToken()),
+Integer.parseInt(st.nextToken()),
+Integer.parseInt(st.nextToken()));
+Color color = Color.BLACK;
+try {
+Integer rgb = Integer.decode(bundle.getString(prefix + 
"Color")); // NOI18N
+color = new Color(rgb.intValue());
+} catch (NumberFormatException nfe) {
+//IZ 37515 - NbBundle.DEBUG causes startup to fail; use 
default value
+Util.err.warning("Number format exception " + //NOI18N
+"loading splash screen parameters."); //NOI18N
+Logger.getLogger("global").log(Level.WARNING, null, nfe);
+}
+int size = 12;
+try {
+String sizeStr = bundle.getString(prefix + "FontSize");
+size = Integer.parseInt(sizeStr);
+} catch (MissingResourceException e) {
+//ignore - use default size
+} catch (NumberFormatException nfe) {
+//ignore - use default size
+}
+Font font = new Font(bundle.getString(prefix + "FontType"), 
Font.PLAIN, size); // NOI18N
+FontMetrics fontMetrics;
+if (comp != null) {
+fontMetrics = comp.getFontMetrics(font);
+} else {
+fontMetrics = graphics.getFontMetrics(font);
+}
+return new TextBox(bounds, color, size, font, fontMetrics);
+}
+}
+
 private static class SplashPainter {
-Rectangle view;
-Color color_text;
+TextBox statusBox;
 Color color_bar;
 Color color_edge;
 Color color_corner;
-   
-/** font size for splash texts */
-private int size = 12;
 private Rectangle dirty = new Rectangle();
-private Rectangle rect = new Recta

[netbeans] 05/05: Some formatting fixes related to the commits in this PR.

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 7d7d0f7db0e898176683fdfb1167bd3b47e9f916
Author: Eirik Bakke 
AuthorDate: Mon May 27 11:40:28 2019 -0400

Some formatting fixes related to the commits in this PR.
---
 .../netbeans/core/startup/ScaledBitmapIcon.java|  4 +-
 .../src/org/netbeans/core/startup/Splash.java  | 44 +++---
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git 
a/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java 
b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
index d902d2e..dec4ee0 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
@@ -62,7 +62,7 @@ final class ScaledBitmapIcon implements Icon {
 private Image getScaledImage(GraphicsConfiguration gc, double dpiScaling) {
 Image ret = cache.get(dpiScaling);
 if (ret != null) {
-  return ret;
+return ret;
 }
 final BufferedImage img = gc.createCompatibleImage(
 (int) Math.ceil(getIconWidth() * dpiScaling),
@@ -104,9 +104,9 @@ final class ScaledBitmapIcon implements Icon {
 } else {
 dpiScaling = 1.0;
 }
+// Scale the image down to its logical dimensions, then draw it at the 
device pixel boundary.
 Image scaledImage = getScaledImage(g.getDeviceConfiguration(), 
dpiScaling);
 if (dpiScaling != 1.0) {
-// Scale the image down to its logical dimensions, then draw it at 
the device pixel boundary.
 AffineTransform tx2 = g.getTransform();
 g.setTransform(new AffineTransform(1, 0, 0, 1,
 (int) tx2.getTranslateX(),
diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java 
b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
index feeb088..9c9e00a 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
@@ -330,17 +330,17 @@ public final class Splash implements Stamps.Updater {
  */
 public void layout(String text, Graphics graphics) {
 if (fm == null) {
-  // XXX(-ttran) this happened on Japanese Windows NT, don't
-  // fully understand why
-  return;
+// XXX(-ttran) this happened on Japanese Windows NT, don't
+// fully understand why
+return;
 }
 SwingUtilities.layoutCompoundLabel(fm, text, null,
 BOTTOM, horizontalAlignment, BOTTOM, horizontalAlignment,
 bounds, new Rectangle(), effectiveBounds, 0);
 if (graphics != null) {
-  graphics.setColor(color);
-  graphics.setFont(font);
-  graphics.drawString(text, effectiveBounds.x, effectiveBounds.y + 
fm.getAscent());
+graphics.setColor(color);
+graphics.setFont(font);
+graphics.drawString(text, effectiveBounds.x, effectiveBounds.y 
+ fm.getAscent());
 }
 }
 
@@ -348,7 +348,7 @@ public final class Splash implements Stamps.Updater {
 String prefix, boolean optional)
 {
 if (optional && !bundle.containsKey(prefix + "Bounds"))
-  return null;
+return null;
 StringTokenizer st = new StringTokenizer(
 bundle.getString(prefix + "Bounds"), " ,"); // NOI18N
 Rectangle bounds = new Rectangle(Integer.parseInt(st.nextToken()),
@@ -376,21 +376,21 @@ public final class Splash implements Stamps.Updater {
 }
 int horizontalAlignment = LEFT;
 try {
-  switch (bundle.getString(prefix + 
"HorizontalAlignment").toLowerCase(Locale.US)) {
-case "left":
-horizontalAlignment = SwingConstants.LEFT;
-break;
-case "center":
-horizontalAlignment = SwingConstants.CENTER;
-break;
-case "right":
-horizontalAlignment = SwingConstants.RIGHT;
-break;
-default:
-// Ignore; use default
-Util.err.warning(
-"Invalid horizontal alignment for splash screen text 
box"); //NOI18N
-  }
+switch (bundle.getString(prefix + 
"HorizontalAlignment").toLowerCase(Locale.US)) {
+  case "left":
+  horizontalAlignment = SwingConstants.LEFT;
+   

[netbeans] 02/05: Added the ability to have a version string automatically added to the splash screen.

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 437a29d603774e93c4beb3c0eb8dd5caea5e9c49
Author: Eirik Bakke 
AuthorDate: Sat May 11 05:19:04 2019 +0200

Added the ability to have a version string automatically added to the 
splash screen.

Also added a horizontal alignment setting for the splash screen text box 
settings.
---
 platform/core.startup/apichanges.xml   | 18 +++
 .../src/org/netbeans/core/startup/Splash.java  | 37 --
 2 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/platform/core.startup/apichanges.xml 
b/platform/core.startup/apichanges.xml
index 376dde4..ab4d6ed 100644
--- a/platform/core.startup/apichanges.xml
+++ b/platform/core.startup/apichanges.xml
@@ -32,6 +32,24 @@
 
 
   
+  
+  
+  An optional version string can be added to the splash screen.
+  
+  
+  
+  
+  
+  
+  
+  Branding bundles may now include the SplashVersionTextBounds,
+  SplashVersionTextFontSize, SplashVersionTextFontType,
+  SplashVersionTextColor, and 
SplashVersionTextHorizontalAlignment
+  properties in order to display the application's product 
version
+  and build number in the startup splash screen.
+  
+  
+  
   
   
   
diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java 
b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
index 7bb15ea..8a2e59f 100644
--- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java
+++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java
@@ -27,6 +27,7 @@ import java.awt.image.BufferedImage;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.StringTokenizer;
@@ -277,17 +278,20 @@ public final class Splash implements Stamps.Updater {
 final int textSize;
 final Font font;
 final FontMetrics fm;
+final int horizontalAlignment;
 // Will be set by SwingUtilities.layoutCompoundLabel.
 final Rectangle effectiveBounds = new Rectangle();
 
 private TextBox(
-Rectangle bounds, Color color, int textSize, Font font, 
FontMetrics fontMetrics)
+Rectangle bounds, Color color, int textSize, Font font, 
FontMetrics fontMetrics,
+int horizontalAlignment)
 {
 this.bounds = bounds;
 this.color = color;
 this.textSize = textSize;
 this.font = font;
 this.fm = fontMetrics;
+this.horizontalAlignment = horizontalAlignment;
 }
 
 /**
@@ -300,7 +304,7 @@ public final class Splash implements Stamps.Updater {
   return;
 }
 SwingUtilities.layoutCompoundLabel(fm, text, null,
-BOTTOM, LEFT, BOTTOM, LEFT,
+BOTTOM, horizontalAlignment, BOTTOM, horizontalAlignment,
 bounds, new Rectangle(), effectiveBounds, 0);
 if (graphics != null) {
   graphics.setColor(color);
@@ -339,6 +343,26 @@ public final class Splash implements Stamps.Updater {
 } catch (NumberFormatException nfe) {
 //ignore - use default size
 }
+int horizontalAlignment = LEFT;
+try {
+  switch (bundle.getString(prefix + 
"HorizontalAlignment").toLowerCase(Locale.US)) {
+case "left":
+horizontalAlignment = SwingConstants.LEFT;
+break;
+case "center":
+horizontalAlignment = SwingConstants.CENTER;
+break;
+case "right":
+horizontalAlignment = SwingConstants.RIGHT;
+break;
+default:
+// Ignore; use default
+Util.err.warning(
+"Invalid horizontal alignment for splash screen text 
box"); //NOI18N
+  }
+} catch (MissingResourceException e) {
+  // Ignore; use default
+}
 Font font = new Font(bundle.getString(prefix + "FontType"), 
Font.PLAIN, size); // NOI18N
 FontMetrics fontMetrics;
 if (comp != null) {
@@ -346,12 +370,14 @@ public final class Splash implements Stamps.Updater {
 } else {
 fontMetrics = graphics.getFontMetrics(font);
 }
-return new TextBox(bounds, color, size, font, fontMe

[netbeans] 04/05: Support proper HiDPI rendering of splash screen and About box images. (The splash screen image was already added in high resolution in a previous commit.)

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 2b18f36ee90a3d2ecc8f0307bc839e3bc1772f55
Author: Eirik Bakke 
AuthorDate: Sat May 11 23:56:59 2019 +0200

Support proper HiDPI rendering of splash screen and About box images. (The 
splash screen image was already added in high resolution in a previous commit.)
---
 .../netbeans/core/startup/ScaledBitmapIcon.java| 128 +
 .../src/org/netbeans/core/startup/Splash.java  |  84 ++
 .../netbeans/core/ui/ProductInformationPanel.java  |   6 +-
 3 files changed, 192 insertions(+), 26 deletions(-)

diff --git 
a/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java 
b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
new file mode 100644
index 000..d902d2e
--- /dev/null
+++ b/platform/core.startup/src/org/netbeans/core/startup/ScaledBitmapIcon.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.core.startup;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.Transparency;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.swing.Icon;
+
+/* Package-private for now. At some later point it might be useful to expose 
the DPI-based caching
+functionality in this class as a more general utility. */
+/**
+ * An Icon implementation that scales a source image to the specified 
dimensions. Can be used to
+ * produce sharp images on HiDPI displays, without relying on 
MultiResolutionImage, which exists
+ * only since JDK 9. This also sidesteps 
https://bugs.openjdk.java.net/browse/JDK-8212226 on
+ * Windows. For HiDPI displays, the source image's dimensions should be at 
least double those of the
+ * icon's logical dimensions. A double-resolution source image will 
automatically be scaled down
+ * to 1x, 1.5x, or other HiDPI scaling factors as needed.
+ */
+final class ScaledBitmapIcon implements Icon {
+private final Map cache = new ConcurrentHashMap<>();
+private final Image sourceImage;
+private final int width;
+private final int height;
+
+public ScaledBitmapIcon(Image sourceImage, int width, int height) {
+if (sourceImage == null)
+throw new NullPointerException();
+if (width <= 0)
+throw new IllegalArgumentException();
+if (height <= 0)
+throw new IllegalArgumentException();
+this.sourceImage = sourceImage;
+this.width = width;
+this.height = height;
+}
+
+private Image getScaledImage(GraphicsConfiguration gc, double dpiScaling) {
+Image ret = cache.get(dpiScaling);
+if (ret != null) {
+  return ret;
+}
+final BufferedImage img = gc.createCompatibleImage(
+(int) Math.ceil(getIconWidth() * dpiScaling),
+(int) Math.ceil(getIconHeight() * dpiScaling), 
Transparency.TRANSLUCENT);
+final double sourceWidth = sourceImage.getWidth(null);
+final double sourceHeight = sourceImage.getHeight(null);
+if (sourceWidth >= 1 && sourceHeight >= 1) {
+  final Graphics2D imgG = (Graphics2D) img.getGraphics();
+  try {
+  imgG.setTransform(AffineTransform.getScaleInstance(
+  dpiScaling * getIconWidth() / sourceWidth,
+  dpiScaling * getIconHeight() / sourceHeight));
+  imgG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
RenderingHints.VALUE_ANTIALIAS_ON);
+  imgG.setRenderingHint(RenderingHints.KEY_INTERPOLATION, 
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+  imgG.setRenderingHint(RenderingHints.KEY_RENDERING, 
RenderingHints.VALUE_RENDER_QUALITY);
+  imgG.drawImage(sourceImage, 0, 0, null);
+  } finally {
+  imgG.

[netbeans] 03/05: Add splash screen with dynamic version information added at runtime.

2019-06-14 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 7efecbc630073acc4e86e08f1c59fb8f375f300a
Author: Eirik Bakke 
AuthorDate: Sat May 11 07:15:34 2019 +0200

Add splash screen with dynamic version information added at runtime.
---
 .../updater/resources/updatersplash_nb.gif | Bin 5499 -> 7449 bytes
 .../org/netbeans/core/startup/Bundle_nb.properties |  29 +++--
 .../org/netbeans/core/startup/about_dark_nb.png| Bin 23598 -> 15243 bytes
 .../src/org/netbeans/core/startup/about_nb.png | Bin 23598 -> 15243 bytes
 .../org/netbeans/core/startup/splash_dark_nb.gif   | Bin 44561 -> 15243 bytes
 .../src/org/netbeans/core/startup/splash_nb.gif| Bin 44561 -> 15243 bytes
 6 files changed, 21 insertions(+), 8 deletions(-)

diff --git 
a/nb/ide.branding/autoupdate.services/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif
 
b/nb/ide.branding/autoupdate.services/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif
index e0aca01..1c882f4 100755
Binary files 
a/nb/ide.branding/autoupdate.services/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif
 and 
b/nb/ide.branding/autoupdate.services/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif
 differ
diff --git 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/Bundle_nb.properties
 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/Bundle_nb.properties
index acab338..f1f3334 100644
--- 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/Bundle_nb.properties
+++ 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/Bundle_nb.properties
@@ -17,7 +17,7 @@
 
 #Splash
 #NOI18N
-SPLASH_WIDTH=473
+SPLASH_WIDTH=480
 #NOI18N
 SPLASH_HEIGHT=300
 
@@ -26,21 +26,21 @@ SplashShowProgressBar=true
 
 # x, y, w, h
 #NOI18N
-SplashRunningTextBounds=56, 278, 390, 12
+SplashRunningTextBounds=16, 278, 448, 12
 #NOI18N
-SplashProgressBarBounds=55, 277, 413, 3
+SplashProgressBarBounds=16, 275, 448, 2
 #16986: Special font size used only for splash screen
 #NOI18N
-SplashRunningTextFontSize=6
+SplashRunningTextFontSize=10
 # RGB
 #NOI18N
-SplashRunningTextColor=0x3b3954
+SplashRunningTextColor=0xFF
 #NOI18N
-SplashProgressBarColor=0xe70045
+SplashProgressBarColor=0xFF
 #NOI18N
-SplashProgressBarEdgeColor=0xC5646F
+SplashProgressBarEdgeColor=0xFF
 #NOI18N
-SplashProgressBarCornerColor=0xB4A2B5
+SplashProgressBarCornerColor=0xFF
 # x, y, w, h
 #NOI18N
 AboutTextBounds=78, 60, 362, 20
@@ -48,6 +48,19 @@ AboutTextBounds=78, 60, 362, 20
 #NOI18N
 AboutTextColor=0x00
 
++###
+# [NETBEANS-2455] Add a version string to the splash screen:
+#NOI18N
+SplashVersionTextBounds=16, 257, 448, 16
+#NOI18N
+SplashVersionTextFontSize=13
+#NOI18N
+SplashVersionTextFontType=Dialog
+#NOI18N
+SplashVersionTextColor=0xFF
+SplashVersionTextHorizontalAlignment=right
+###
+
 LBL_splash_window_title=Starting Apache NetBeans IDE
 currentVersion=Apache NetBeans IDE Dev (Build {0})
 
diff --git 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_dark_nb.png 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_dark_nb.png
index d39f649..5de1487 100644
Binary files 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_dark_nb.png 
and 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_dark_nb.png 
differ
diff --git 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_nb.png 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_nb.png
index d39f649..5de1487 100644
Binary files 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_nb.png and 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/about_nb.png differ
diff --git 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_dark_nb.gif 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_dark_nb.gif
index 74abc0b..5de1487 100644
Binary files 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_dark_nb.gif 
and 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_dark_nb.gif 
differ
diff --git 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_nb.gif 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_nb.gif
index 74abc0b..5de1487 100644
Binary files 
a/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_nb.gif and 
b/nb/ide.branding/core.startup/src/org/netbeans/core/startup/splash_nb.gif 
differ


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: [NETBEANS-2646] Improve tabcontrol border appearance under fractional HiDPI scaling

2019-06-13 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new af00a5b  [NETBEANS-2646] Improve tabcontrol border appearance under 
fractional HiDPI scaling
af00a5b is described below

commit af00a5b578d484cda12e06258fd2830d882e0fee
Author: Eirik Bakke 
AuthorDate: Thu Jun 6 11:36:22 2019 -0400

[NETBEANS-2646] Improve tabcontrol border appearance under fractional HiDPI 
scaling
---
 .../swing/plaf/windows8/DPISafeBorder.java | 135 +
 .../swing/plaf/windows8/Windows8LFCustoms.java |   5 +-
 2 files changed, 137 insertions(+), 3 deletions(-)

diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/DPISafeBorder.java
 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/DPISafeBorder.java
new file mode 100644
index 000..010c93b
--- /dev/null
+++ 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/DPISafeBorder.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.swing.plaf.windows8;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.geom.AffineTransform;
+import javax.swing.border.Border;
+import javax.swing.border.MatteBorder;
+
+/**
+ * A border similar to {@link MatteBorder}, but which avoids visual artifacts 
from rounding errors
+ * under non-integral HiDPI scaling factors (e.g. 150%).
+ *
+ * @author Eirik Bakke (eba...@ultorg.com)
+ */
+final class DPISafeBorder implements Border {
+private final Insets insets;
+private final Color color;
+
+/**
+ * Create a new instance with the same semantics as that produced by
+ * {@link MatteBorder#MatteBorder(int, int, int, int, java.awt.Color)}.
+ *
+ * @param color may not be null
+ */
+public static Border matte(int top, int left, int bottom, int right, Color 
color) {
+return new DPISafeBorder(new Insets(top, left, bottom, right), color);
+}
+
+private DPISafeBorder(Insets insets, Color color) {
+if (insets == null)
+throw new NullPointerException();
+if (color == null)
+throw new NullPointerException();
+this.insets = new Insets(insets.top, insets.left, insets.bottom, 
insets.right);
+this.color = color;
+}
+
+@Override
+public void paintBorder(Component c, Graphics g0, int x, int y, int width, 
int height) {
+final Graphics2D g = (Graphics2D) g0;
+final Color oldColor = g.getColor();
+final AffineTransform oldTransform = g.getTransform();
+g.translate(x, y);
+final AffineTransform tx = g.getTransform();
+final int txType = tx.getType();
+final double scale;
+/* On fractional DPI scaling factors, such as 150%, a logical pixel 
position, e.g. (5,0),
+may end up being translated to a non-integral device pixel position, 
e.g. (7.5, 0). The same
+goes for border thicknesses, which are specified in logical pixels. In 
this method, we do
+all calculations and painting in device pixels, to avoid rounding 
errors causing visible
+artifacts. On screens without HiDPI scaling, logical pixel values and 
device pixel values
+are identical, and always integral (whole number) values. */
+final int deviceWidth;
+final int deviceHeight;
+if (txType == AffineTransform.TYPE_UNIFORM_SCALE ||
+txType == (AffineTransform.TYPE_UNIFORM_SCALE | 
AffineTransform.TYPE_TRANSLATION))
+{
+  // HiDPI scaling is active.
+  scale = tx.getScaleX();
+  /* Round the starting (top-left) position up and the end 
(bottom-right) position down,
+  to ensure we are painting the border in an area that will not be 
painted over by an
+  adjacent component. */
+  int deviceX = (int) Math.ceil(tx.getTranslateX());
+  int deviceY = (int) Math.ceil(tx.getTranslateY())

[netbeans] branch master updated (4a8d8bf -> ecb4599)

2019-06-07 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 4a8d8bf  Merge pull request #1271 from 
sdedic/bugfix/2577-filtering_modules
 new 43e3197  Make ImageUtilities.loadImageIcon cache its result.
 new ecb4599  Fix missing revalidate after exiting Full Screen & Show Only 
Editor.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../netbeans/core/windows/EditorOnlyDisplayer.java |  3 +++
 .../src/org/openide/util/ImageUtilities.java   | 15 +++
 .../src/org/openide/util/ImageUtilitiesTest.java   | 22 +-
 3 files changed, 31 insertions(+), 9 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 02/02: Fix missing revalidate after exiting Full Screen & Show Only Editor.

2019-06-07 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit ecb45997fed0b2e95b4103c6c1e4e102dbe2fbda
Author: Eirik Bakke 
AuthorDate: Mon Jan 21 10:53:06 2019 -0500

Fix missing revalidate after exiting Full Screen & Show Only Editor.

This fixes a small bug that I observed in my NetBeans Platform application 
when
running on Windows 10 with the NetBeans status bar disabled; it relates to 
my
earlier patch for NETBEANS-731 "Hide (and auto-show) menu bar in full screen
mode". This patch has been working in my IDE without issue for 6 months.
---
 .../src/org/netbeans/core/windows/EditorOnlyDisplayer.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java 
b/platform/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java
index 8c85262..884fd83 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java
@@ -143,6 +143,9 @@ public class EditorOnlyDisplayer {
 JFrame frame = ( JFrame ) 
WindowManagerImpl.getInstance().getMainWindow();
 frame.setContentPane( originalContentPane );
 originalContentPane = null;
+frame.invalidate();
+frame.revalidate();
+frame.repaint();
 setShowEditorToolbar( originalShowEditorToolbar );
 if( restoreFocus )
 restoreFocus();


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/02: Make ImageUtilities.loadImageIcon cache its result.

2019-06-07 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 43e319710e9263390601ce35f7cc2c4d1abdb76b
Author: Eirik Bakke 
AuthorDate: Fri Jun 7 10:53:04 2019 -0400

Make ImageUtilities.loadImageIcon cache its result.

This fixes the test failures I just introduced in ActionsTest. It also 
ensures
that everything that was cached in ImageUtilities before still remains 
cached
after the recent changes.

Also use System.identityHashCode(image) rather than image.hashCode in
ImageUtilities' internal cache key classes, to be consistent with using
referential equality in equals() implementations.
---
 .../src/org/openide/util/ImageUtilities.java   | 15 +++
 .../src/org/openide/util/ImageUtilitiesTest.java   | 22 +-
 2 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index 5171bd9..4af5cc8 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -216,7 +216,7 @@ public final class ImageUtilities {
 if( image == null ) {
 return null;
 }
-return IconImageIcon.create(image);
+return image.asImageIcon();
 }
 
 private static boolean isDarkLaF() {
@@ -844,7 +844,7 @@ public final class ImageUtilities {
 @Override
 public int hashCode() {
 int hash = ((x << 3) ^ y) << 4;
-hash = hash ^ baseImage.hashCode() ^ overlayImage.hashCode();
+hash = hash ^ System.identityHashCode(baseImage) ^ 
System.identityHashCode(overlayImage);
 
 return hash;
 }
@@ -878,8 +878,7 @@ public final class ImageUtilities {
 
 @Override
 public int hashCode() {
-int hash = image.hashCode() ^ str.hashCode();
-return hash;
+return System.identityHashCode(image) ^ str.hashCode();
 }
 
 @Override
@@ -943,6 +942,8 @@ public final class ImageUtilities {
 // May be null.
 final Icon delegateIcon;
 final URL url;
+// May be null.
+ImageIcon imageIconVersion;
 
 public static ToolTipImage createNew(String toolTipText, Image image, 
URL url) {
 ImageUtilities.ensureLoaded(image);
@@ -980,6 +981,12 @@ public final class ImageUtilities {
 this.url = url;
 }
 
+public synchronized ImageIcon asImageIcon() {
+  if (imageIconVersion == null)
+imageIconVersion = IconImageIcon.create(this);
+  return imageIconVersion;
+}
+
 public ToolTipImage(Icon delegateIcon, String toolTipText, int 
imageType) {
 // BufferedImage must have width/height > 0.
 super(Math.max(1, delegateIcon.getIconWidth()),
diff --git 
a/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
 
b/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
index de8f537..be2eb29 100644
--- 
a/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
+++ 
b/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
@@ -242,6 +242,18 @@ public class ImageUtilitiesTest extends TestCase {
 assertEquals("Tool tip text should be empty, but it is " + str, 
expected, str);
 }
 
+public void testLoadImageCached() {
+Image image1 = 
ImageUtilities.loadImage("org/openide/util/testimage.png", false);
+Image image2 = 
ImageUtilities.loadImage("org/openide/util/testimage.png", false);
+assertSame("Expected same instance", image1, image2);
+}
+
+public void testLoadImageIconCached() {
+ImageIcon icon1 = 
ImageUtilities.loadImageIcon("org/openide/util/testimage.png", false);
+ImageIcon icon2 = 
ImageUtilities.loadImageIcon("org/openide/util/testimage.png", false);
+assertSame("Expected same instance", icon1, icon2);
+}
+
 public void testConversions() {
 /* Note: these are rather implementation-oriented tests. 
Implementation changes in
 ImageUtilities (addition or removal of caches etc.) might require this 
test to be
@@ -275,18 +287,18 @@ public class ImageUtilitiesTest extends TestCase {
 
 /* An Icon/Image loaded via loadImage can be freely passed through 
icon2Image/image2Icon
 without a new instance being created. */
-assertEquals("Should be same instance",
+assertSame("Should be same instance",
 image,
 icon2Image(imageIcon));
 
-assertEquals

[netbeans] 10/10: Add more tests for ImageUtilities, and fix some broken ones.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 5f7820042fcc229a9ad8bd9c84398bc96cdbfe10
Author: Eirik Bakke 
AuthorDate: Thu Jun 6 16:18:49 2019 -0400

Add more tests for ImageUtilities, and fix some broken ones.
---
 .../src/org/openide/util/ImageUtilities.java   |  28 ++-
 .../src/org/openide/util/ImageUtilitiesTest.java   | 234 +++--
 2 files changed, 243 insertions(+), 19 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index b133ad9..5171bd9 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -20,6 +20,7 @@
 package org.openide.util;
 
 import java.awt.Component;
+import java.awt.EventQueue;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.GraphicsConfiguration;
@@ -54,6 +55,7 @@ import javax.imageio.stream.ImageInputStream;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 
 /** 
@@ -113,12 +115,18 @@ public final class ImageUtilities {
 private static volatile Component dummyIconComponent;
 
 static {
-Mutex.EVENT.writeAccess(new Runnable() {
-@Override
-public void run() {
-dummyIconComponent = new JLabel();
-}
-});
+/* Could have used Mutex.EVENT.writeAccess here, but it doesn't seem 
to be available during
+testing. */
+if (EventQueue.isDispatchThread()) {
+dummyIconComponent = new JLabel();
+} else {
+SwingUtilities.invokeLater(new Runnable() {
+@Override
+public void run() {
+dummyIconComponent = new JLabel();
+}
+});
+}
 }
 
 private ImageUtilities() {
@@ -973,7 +981,9 @@ public final class ImageUtilities {
 }
 
 public ToolTipImage(Icon delegateIcon, String toolTipText, int 
imageType) {
-super(delegateIcon.getIconWidth(), delegateIcon.getIconHeight(), 
imageType);
+// BufferedImage must have width/height > 0.
+super(Math.max(1, delegateIcon.getIconWidth()),
+Math.max(1, delegateIcon.getIconHeight()), imageType);
 this.delegateIcon = delegateIcon;
 this.toolTipText = toolTipText;
 this.url = null;
@@ -1044,6 +1054,10 @@ public final class ImageUtilities {
 @Override
 public Object getProperty(String name, ImageObserver observer) {
 if ("url".equals(name)) { // NOI18N
+/* In some cases it might strictly be more appropriate to 
return
+Image.UndefinedProperty rather than null (see Javadoc spec for 
this method), but
+retain the existing behavior and use null instead here. That 
way there won't be a
+ClassCastException if someone tries to cast to URL. */
 if (url != null) {
 return url;
 } else if (!(delegateIcon instanceof ImageIcon)) {
diff --git 
a/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
 
b/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
index 087a49d..de8f537 100644
--- 
a/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
+++ 
b/platform/openide.util.ui/test/unit/src/org/openide/util/ImageUtilitiesTest.java
@@ -19,13 +19,22 @@
 package org.openide.util;
 
 import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.Image;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
+import java.util.function.Function;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
+import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import junit.framework.*;
+import static org.openide.util.ImageUtilities.icon2Image;
+import static org.openide.util.ImageUtilities.image2Icon;
 
 /**
  *
@@ -234,23 +243,224 @@ public class ImageUtilitiesTest extends TestCase {
 }
 
 public void testConversions() {
-Image image = 
ImageUtilities.loadImage("org/openide/util/testimage.png", false);
-Icon icon = 
ImageUtilities.loadImageIcon("org/openide/util/testimage.png", false);
+/* Note: these are rather implementation-oriented tests. 
Implementation changes in
+ImageUtilities (addition or removal of caches etc.) might require this 
test to be
+updated, even when the API is unchanged. */
 

[netbeans] 08/10: Fix a few comment typos.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 73a3f68275cfb4483be9bc2b0ca6ffda6922855d
Author: Eirik Bakke 
AuthorDate: Fri May 31 10:19:36 2019 -0400

Fix a few comment typos.
---
 platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java | 4 ++--
 platform/openide.util.ui/src/org/openide/util/FilteredIcon.java| 2 +-
 platform/openide.util.ui/src/org/openide/util/VectorIcon.java  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java 
b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
index ecce663..107469c 100644
--- a/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
+++ b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
@@ -34,7 +34,7 @@ import javax.swing.ImageIcon;
 /**
  * Abstract base class for {@link javax.swing.Icon} implementations that need 
to cache scaled bitmap
  * representations for HiDPI displays. Bitmaps for multiple HiDPI scaling 
factors can be cached at
- * the same time, e.g. for multi-monitor setups.
+ * the same time, e.g. for multi-monitor setups. Thread-safe.
  */
 abstract class CachedHiDPIIcon extends ImageIcon {
 /**
@@ -143,7 +143,7 @@ abstract class CachedHiDPIIcon extends ImageIcon {
  *Future implementations might also elect to simply pass a dummy 
Component instance
  *here.
  * @param graphicsConfiguration the configuration of the surface on which 
the image will be
- * painted
+ *painted
  * @param deviceWidth the required width of the image, with scaling 
already applied
  * @param deviceHeight the required height of the image, with scaling 
already applied
  * @param scale the HiDPI scaling factor detected in {@code 
graphicsConfiguration}
diff --git a/platform/openide.util.ui/src/org/openide/util/FilteredIcon.java 
b/platform/openide.util.ui/src/org/openide/util/FilteredIcon.java
index 94499eb..0496c3b 100644
--- a/platform/openide.util.ui/src/org/openide/util/FilteredIcon.java
+++ b/platform/openide.util.ui/src/org/openide/util/FilteredIcon.java
@@ -38,7 +38,7 @@ import javax.swing.ImageIcon;
  * of {@link VectorIcon}, or {@link ImageIcon} instances delegating to a
  * {@code java.awt.image.MultiResolutionImage} (available since Java 9 and 
above).
  *
- * Note that state passed through the {code Component} parameter of the
+ * Note that state passed through the {@code Component} parameter of the
  * {@link Icon#paintIcon(Component,Graphics,int,int)} method will only be 
current as of the time the
  * icon is initially entered into the cache.
  */
diff --git a/platform/openide.util.ui/src/org/openide/util/VectorIcon.java 
b/platform/openide.util.ui/src/org/openide/util/VectorIcon.java
index e961753..07a9f5b 100644
--- a/platform/openide.util.ui/src/org/openide/util/VectorIcon.java
+++ b/platform/openide.util.ui/src/org/openide/util/VectorIcon.java
@@ -178,7 +178,7 @@ public abstract class VectorIcon implements Icon, 
Serializable {
  * Paint the icon at the given width and height. The dimensions given are 
the device pixels onto
  * which the icon must be drawn after it has been scaled up from its 
originally constant logical
  * dimensions and aligned onto the device pixel grid. Painting onto the 
supplied
- * {@code Graphics2D} instance using whole number coordinates (for 
horizontal and veritcal
+ * {@code Graphics2D} instance using whole number coordinates (for 
horizontal and vertical
  * lines) will encourage sharp and well-aligned icons.
  *
  * The icon should be painted with its upper left-hand corner at 
position (0, 0). Icons need


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 01/10: Replace 'new ImageIcon' with image2Icon for commonly visible icons.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit b8312bdd4ac5b8fbaf0866f1cfb3ec6f28e34a19
Author: Eirik Bakke 
AuthorDate: Wed May 29 15:20:59 2019 -0400

Replace 'new ImageIcon' with image2Icon for commonly visible icons.

The ImageUtilities class now supports HiDPI icons via custom 
implementations of
the Icon interface. For this to work, client code must let ImageUtilities 
manage
the creation of new Icon instances, using "ImageUtilities.image2Icon(image)"
instead of "new ImageIcon(image)". This is already common throughout the
NetBeans codebase, but there are still quite a few direct uses of ImageIcon.

This commit replaces a few of the direct uses of ImageIcon, for most of the
icons that are commonly seen during a Java editing session in the IDE.
---
 java/java.source/src/org/netbeans/modules/java/ui/Icons.java | 4 ++--
 .../core.windows/src/org/netbeans/core/windows/view/EditorView.java  | 2 +-
 .../src/org/netbeans/core/windows/view/ui/TabbedHandler.java | 5 +++--
 .../org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java | 4 ++--
 .../netbeans/core/windows/view/ui/tabcontrol/AbstractTabbedImpl.java | 3 ++-
 .../src/org/netbeans/core/windows/view/ui/toolbars/DnDSupport.java   | 2 +-
 .../src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java   | 4 ++--
 .../src/org/openide/explorer/view/NodeRenderDataProvider.java| 4 ++--
 8 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/java/java.source/src/org/netbeans/modules/java/ui/Icons.java 
b/java/java.source/src/org/netbeans/modules/java/ui/Icons.java
index 1f6a2fd..6dc9b67 100644
--- a/java/java.source/src/org/netbeans/modules/java/ui/Icons.java
+++ b/java/java.source/src/org/netbeans/modules/java/ui/Icons.java
@@ -50,7 +50,7 @@ public final class Icons {
 return null;
 }
 else {
-return new ImageIcon (img);
+return ImageUtilities.image2Icon (img);
 }
 }
 
@@ -101,7 +101,7 @@ public final class Icons {
default:
img = null;
 }
-   return img == null ? null : new ImageIcon (img);
+   return img == null ? null : ImageUtilities.image2Icon (img);
 
 }
 
diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/EditorView.java 
b/platform/core.windows/src/org/netbeans/core/windows/view/EditorView.java
index 6da4ff8..b6afebb 100644
--- a/platform/core.windows/src/org/netbeans/core/windows/view/EditorView.java
+++ b/platform/core.windows/src/org/netbeans/core/windows/view/EditorView.java
@@ -202,7 +202,7 @@ public class EditorView extends ViewElement {
 if(imageSource != null) {
 Image image = ImageUtilities.loadImage(imageSource);
 if(image != null) {
-JLabel label = new JLabel(new ImageIcon(image));
+JLabel label = new 
JLabel(ImageUtilities.image2Icon(image));
 label.setMinimumSize(new Dimension(0, 0)); // XXX To be 
able shrink the area.
 add(label, BorderLayout.CENTER);
 } else {
diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
index e58c04a..bc1b284 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
@@ -48,6 +48,7 @@ import org.netbeans.core.windows.Switches;
 import org.netbeans.core.windows.view.ui.slides.SlideBar;
 import org.netbeans.core.windows.view.ui.slides.SlideBarActionEvent;
 import org.netbeans.core.windows.view.ui.slides.SlideOperationFactory;
+import org.openide.util.ImageUtilities;
 import org.openide.util.Lookup;
 
 
@@ -163,7 +164,7 @@ public final class TabbedHandler implements ChangeListener, 
ActionListener {
 }
 tabbed.addTopComponent(
 title,
-icon == null ? null : new ImageIcon(icon),
+icon == null ? null : ImageUtilities.image2Icon(icon),
 tc, tc.getToolTipText());
 } finally {
 ignoreChange = false;
@@ -205,7 +206,7 @@ public final class TabbedHandler implements ChangeListener, 
ActionListener {
 
 Image icon = tc.getIcon();
 if( null != icon ) {
-tabbed.setIconAt(index, new ImageIcon(tc.getIcon()));
+tabbed.setIconAt(index, ImageUtilities.image2Icon(tc.getIcon()));
 } else {
 Logger.getLogger(TabbedHandler.class.getName()).log(Level.INFO, 
"TopComponent has no icon: " + tc);
 tabbed.setIconAt(index, null);
diff --git 
a/platform/core.windows/src/

[netbeans] 07/10: Support HiDPI icons from ImageUtilities.mergeImages.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit c6bf0a5e11b642efd8331b298dfa69e895bfbe6d
Author: Eirik Bakke 
AuthorDate: Thu May 30 18:56:48 2019 -0400

Support HiDPI icons from ImageUtilities.mergeImages.

The old Image-based implementation of mergeImages remains  together with 
the new
Icon-based implementation. This ensures backwards-compatibility when icons 
are
drawn using Graphics.drawImage instead of Icon.paintIcon. (The new
implementation was confirmed to be invoked and working by adding some
now-removed temporary drawing code.)

This completes the changes needed to make all of ImageUtilities' APIs work 
with
scalable Icon implementations. An SVGIcon class will be added in a future
commit.
---
 .../src/org/openide/util/ImageUtilities.java   | 44 +-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index e39a306..e7f8121 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -22,9 +22,11 @@ package org.openide.util;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
 import java.awt.HeadlessException;
 import java.awt.Image;
 import java.awt.MediaTracker;
+import java.awt.Rectangle;
 import java.awt.RenderingHints;
 import java.awt.Toolkit;
 import java.awt.Transparency;
@@ -721,10 +723,13 @@ public final class ImageUtilities {
 Object firstUrl = image1.getProperty("url", null);
 
 ColorModel model = colorModel(bitmask? Transparency.BITMASK: 
Transparency.TRANSLUCENT);
-ToolTipImage buffImage = new ToolTipImage(str.toString(), null,
+// Provide a delegate Icon for scalable rendering.
+Icon delegateIcon = new MergedIcon(image2Icon(image1), 
image2Icon(image2), x, y);
+ToolTipImage buffImage = new ToolTipImage(str.toString(), delegateIcon,
 model, model.createCompatibleWritableRaster(w, h), 
model.isAlphaPremultiplied(), null, firstUrl instanceof URL ? (URL)firstUrl : 
null
 );
 
+// Also provide an Image-based rendering for backwards-compatibility.
 java.awt.Graphics g = buffImage.createGraphics();
 g.drawImage(image1, 0, 0, null);
 g.drawImage(image2, x, y, null);
@@ -733,6 +738,43 @@ public final class ImageUtilities {
 return buffImage;
 }
 
+/**
+ * Alternative image merging implementation using the {@link Icon} API. 
This preserves
+ * scalability of the delegate {@code Icon}s on HiDPI displays.
+ */
+private static final class MergedIcon extends CachedHiDPIIcon {
+private final Icon icon1;
+private final Icon icon2;
+private final int x, y;
+
+public MergedIcon(Icon icon1, Icon icon2, int x, int y) {
+super(Math.max(icon1.getIconWidth(), x + icon2.getIconWidth()),
+  Math.max(icon1.getIconHeight(), y + icon2.getIconHeight()));
+this.icon1 = icon1;
+this.icon2 = icon2;
+this.x = x;
+this.y = y;
+}
+
+@Override
+protected Image createImage(Component c, GraphicsConfiguration 
graphicsConfiguration,
+int deviceWidth, int deviceHeight, double scale)
+{
+BufferedImage ret = graphicsConfiguration.createCompatibleImage(
+deviceWidth, deviceHeight, Transparency.TRANSLUCENT);
+Graphics2D g = ret.createGraphics();
+try {
+g.clip(new Rectangle(0, 0, deviceWidth, deviceHeight));
+g.scale(scale, scale);
+icon1.paintIcon(c, g, 0, 0);
+icon2.paintIcon(c, g, x, y);
+} finally {
+g.dispose();
+}
+return ret;
+}
+}
+
 /** Creates BufferedImage with Transparency.TRANSLUCENT */
 static final java.awt.image.BufferedImage createBufferedImage(int width, 
int height) {
 if (Utilities.isMac()) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 09/10: Don't have CachedHiDPIIcon extend from ImageIcon.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 5f828b3eb302124ba438c235053f7863417e8d30
Author: Eirik Bakke 
AuthorDate: Sun Jun 2 14:31:59 2019 -0400

Don't have CachedHiDPIIcon extend from ImageIcon.

This was left over from a previous experiment. Also fix a case where
ImageUtilities.icon2Image could return null even when the icon is not null.

(Include this fix in this PR rather than in the SVG support PR, to
ensure I don't commit bugs if this one is merged before the other.)
---
 platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java | 3 +--
 platform/openide.util.ui/src/org/openide/util/ImageUtilities.java  | 7 ---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java 
b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
index 107469c..b0bcffe 100644
--- a/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
+++ b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
@@ -29,14 +29,13 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Objects;
 import javax.swing.Icon;
-import javax.swing.ImageIcon;
 
 /**
  * Abstract base class for {@link javax.swing.Icon} implementations that need 
to cache scaled bitmap
  * representations for HiDPI displays. Bitmaps for multiple HiDPI scaling 
factors can be cached at
  * the same time, e.g. for multi-monitor setups. Thread-safe.
  */
-abstract class CachedHiDPIIcon extends ImageIcon {
+abstract class CachedHiDPIIcon implements Icon {
 /**
  * The maximum size of the cache, as a multiple of the size of the icon at 
100% scaling. For
  * example, storing three images at 100%, 150%, and 200% scaling, 
respectively, yields a total
diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index e7f8121..b133ad9 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -303,10 +303,11 @@ public final class ImageUtilities {
 } else if (icon instanceof IconImageIcon) {
 return icon2Image(((IconImageIcon) icon).getDelegateIcon());
 } else if (icon instanceof ImageIcon) {
-return ((ImageIcon) icon).getImage();
-} else {
-return icon2ToolTipImage(icon);
+Image ret = ((ImageIcon) icon).getImage();
+if (ret != null)
+return ret;
 }
+return icon2ToolTipImage(icon);
 }
 
 private static ToolTipImage icon2ToolTipImage(Icon icon) {


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 03/10: [NETBEANS-1586] Make ImageUtilities.createDisabledIcon work with HiDPI icons

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit d305cd16e9a4ab88a71ced7e7b8622d26542b2f1
Author: Eirik Bakke 
AuthorDate: Wed May 29 16:13:30 2019 -0400

[NETBEANS-1586] Make ImageUtilities.createDisabledIcon work with HiDPI icons

Introduced a FilteredIcon class which extends from a new CachedHiDPIIcon 
class.
The CachedHiDPIIcon class will be used again in the future; it was 
originally
designed for an SVG-based Icon implementation, which will be contributed
separately in the future. It is generic enough to work with any kind of 
custom
Icon implementation that needs caching.

Also make color filtering of icons for dark themes work with HiDPI icons, 
using
the same FilteredIcon class.

Also improved a null handling case in ImageUtilities.loadImage. Passing a 
null
resource used to be valid before (yielding a null return value), but caused 
a
NPE on dark LAFs. Since it worked in the common non-dark case, it should
arguably work in the dark case as well. This might fix NETBEANS-2401, or it
might just lead to an NPE elsewhere in that case.
---
 .../src/org/openide/util/CachedHiDPIIcon.java  | 211 +
 .../src/org/openide/util/FilteredIcon.java |  79 
 .../src/org/openide/util/ImageUtilities.java   |  62 ++
 3 files changed, 308 insertions(+), 44 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java 
b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
new file mode 100644
index 000..ecce663
--- /dev/null
+++ b/platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.openide.util;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+/**
+ * Abstract base class for {@link javax.swing.Icon} implementations that need 
to cache scaled bitmap
+ * representations for HiDPI displays. Bitmaps for multiple HiDPI scaling 
factors can be cached at
+ * the same time, e.g. for multi-monitor setups.
+ */
+abstract class CachedHiDPIIcon extends ImageIcon {
+/**
+ * The maximum size of the cache, as a multiple of the size of the icon at 
100% scaling. For
+ * example, storing three images at 100%, 150%, and 200% scaling, 
respectively, yields a total
+ * cache size of 1.0^2 + 1.5^2 + 2^2 = 7.2.
+ */
+private static final double MAX_CACHE_SIZE = 10.0;
+private final int width;
+private final int height;
+/**
+ * Cache map with least-recently-used iteration order.
+ */
+private final Map cache =
+new LinkedHashMap(16, 0.75f, true);
+/**
+ * Total size of the images currently in the cache, in the same units as
+ * {@link #MAX_CACHE_SIZE}.
+ */
+private double cacheSize = 0.0;
+
+/**
+ * Constructor to be used by subclasses.
+ */
+protected CachedHiDPIIcon(int width, int height) {
+if (width < 0) {
+throw new IllegalArgumentException();
+}
+if (height < 0) {
+throw new IllegalArgumentException();
+}
+this.width = width;
+this.height = height;
+}
+
+private synchronized Image getScaledImageCached(Component c, 
CachedImageKey key) {
+Image ret = cache.get(key);
+if (ret != null) {
+return ret;
+}
+final double scale = key.getScale();
+final int deviceWidth = (int) Math.ceil(getIconWidth() * scale);
+final int deviceHeight = (int) Math.ceil(getIconHeight() * scale);
+final Image img =
+createImage(c, key.getGraphicsConfiguration(), deviceWidth, 
deviceHeight, scale);
+final double imgSize = 

[netbeans] 06/10: Improve rendering quality of scaled bitmap icons on HiDPI displays.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 894376f42517da2dd028852fcb3bb0d1e4b10609
Author: Eirik Bakke 
AuthorDate: Thu May 30 13:52:57 2019 -0400

Improve rendering quality of scaled bitmap icons on HiDPI displays.

Having centralized icon painting into ImageUtilities.ToolTipImage.paintIcon 
in
the previous commits, we can now add a few painting tweaks to improve the
appearance of low-resolution bitmap icons that must be scaled up for HiDPI
displays. See the before/after screenshots that are attached to JIRA ticket
NETBEANS-2614.
---
 .../src/org/openide/util/ImageUtilities.java   | 50 +++---
 1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index 8783424..e39a306 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -21,11 +21,14 @@ package org.openide.util;
 
 import java.awt.Component;
 import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.HeadlessException;
 import java.awt.Image;
 import java.awt.MediaTracker;
+import java.awt.RenderingHints;
 import java.awt.Toolkit;
 import java.awt.Transparency;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
 import java.awt.image.ImageObserver;
@@ -160,7 +163,8 @@ public final class ImageUtilities {
 return loadImageInternal(resource, localized);
 }
 
-// Private version with more specific return type.
+/* Private version of the method showing the more specific return type. We 
always return a
+ToolTipImage, to take advantage of its rendering tweaks for HiDPI screens. 
*/
 private static ToolTipImage loadImageInternal(String resource, boolean 
localized) {
 // Avoid a NPE that could previously occur in the isDarkLaF case only. 
See NETBEANS-2401.
 if (resource == null) {
@@ -177,9 +181,6 @@ public final class ImageUtilities {
 // only non _dark images need filtering
 RGBImageFilter imageFilter = getImageIconFilter();
 if (null != image && null != imageFilter) {
-/* Make sure that every Image loaded by this class is a 
ToolTipImage, whether or not
-a filter is applied. That way we're less likely to introduce 
bugs that only occur on
-certain LAFs. */
 image = icon2ToolTipImage(FilteredIcon.create(imageFilter, 
image));
 }
 }
@@ -276,6 +277,8 @@ public final class ImageUtilities {
  * @return icon corresponding icon
  */
 public static final Icon image2Icon(Image image) {
+/* Make sure to always return a ToolTipImage, to take advantage of its 
rendering tweaks for
+HiDPI screens. */
 return (image instanceof ToolTipImage)
 ? (ToolTipImage) image : assignToolTipToImageInternal(image, 
"");
 }
@@ -954,7 +957,44 @@ public final class ImageUtilities {
 if (delegateIcon != null) {
 delegateIcon.paintIcon(c, g, x, y);
 } else {
-g.drawImage(this, x, y, null);
+/* There is no scalable delegate icon available. On HiDPI 
displays, this means that
+original low-resolution icons will need to be scaled up to a 
higher resolution. Do a
+few tricks here to improve the quality of the scaling. See 
NETBEANS-2614 and the
+before/after screenshots that are attached to said JIRA 
ticket. */
+Graphics2D g2 = (Graphics2D) g.create();
+try {
+final AffineTransform tx = g2.getTransform();
+final int txType = tx.getType();
+final double scale;
+if (txType == AffineTransform.TYPE_UNIFORM_SCALE ||
+txType == (AffineTransform.TYPE_UNIFORM_SCALE | 
AffineTransform.TYPE_TRANSLATION))
+{
+  scale = tx.getScaleX();
+} else {
+  scale = 1.0;
+}
+if (scale != 1.0) {
+/* The default interpolation mode is nearest neighbor. 
Use bicubic
+interpolation instead, which looks better, especially 
with non-integral
+HiDPI scaling factors (e.g. 150%). Even for an 
integral 2x scaling factor
+(used by all Retina displays on MacOS), the blurred 
appearance of bicubic
+scaling ends up looking better on HiDPI displays than 
the blocky appearance
+

[netbeans] 02/10: Use Icon.paintIcon instead of Graphics.drawImage (one example).

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit d7d467c342a7ab4d0759f67c276d4d75ef8fb275
Author: Eirik Bakke 
AuthorDate: Wed May 29 15:36:42 2019 -0400

Use Icon.paintIcon instead of Graphics.drawImage (one example).

Most of the icons that are seen in the IDE during a standard Java editing
session are already painted via a call to Icon.paintIcon. One exception is 
the
separator icon that is used in the breadcrumb component under the code 
editor,
which is painted via Graphics.drawImage. Migrate this one to Icon.paintIcon 
to
make the icon look better on HiDPI displays (taking advantage of the HiDPI
scaling hints that were recently implemented in ImageUtilities).

This also serves as an example of how to fix other similar cases in the 
future.
---
 .../modules/editor/breadcrumbs/BreadCrumbComponent.java   | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/ide/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/BreadCrumbComponent.java
 
b/ide/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/BreadCrumbComponent.java
index 3a5ad9d..3d60c65 100644
--- 
a/ide/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/BreadCrumbComponent.java
+++ 
b/ide/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/BreadCrumbComponent.java
@@ -64,7 +64,8 @@ import org.openide.util.WeakListeners;
  */
 public class BreadCrumbComponent extends JComponent 
implements PropertyChangeListener {
 
-private final Image SEPARATOR = 
ImageUtilities.loadImage("org/netbeans/modules/editor/breadcrumbs/resources/separator.png");
+private final Icon SEPARATOR =
+
ImageUtilities.image2Icon(ImageUtilities.loadImage("org/netbeans/modules/editor/breadcrumbs/resources/separator.png"));
 
 public BreadCrumbComponent() {
 setPreferredSize(new Dimension(0, COMPONENT_HEIGHT));
@@ -119,7 +120,7 @@ public class BreadCrumbComponent 
extends JComponent i
 int height = getHeight();
 
 if (nodes.length == 0) {
-g.drawImage(SEPARATOR, START_INSET, (height - 
SEPARATOR.getHeight(null)) / 2, null);
+SEPARATOR.paintIcon(this, g, START_INSET, (height - 
SEPARATOR.getIconHeight()) / 2);
 return ;
 }
 
@@ -135,10 +136,10 @@ public class BreadCrumbComponent extends JComponent i
 g.translate(-x, -labelY);
 
 x += sizes[i];
-
-g.drawImage(SEPARATOR, x + LEFT_SEPARATOR_INSET, (height - 
SEPARATOR.getHeight(null)) / 2, null);
 
-x += LEFT_SEPARATOR_INSET + SEPARATOR.getWidth(null) + 
RIGHT_SEPARATOR_INSET;
+SEPARATOR.paintIcon(this, g, x + LEFT_SEPARATOR_INSET, (height - 
SEPARATOR.getIconHeight()) / 2);
+
+x += LEFT_SEPARATOR_INSET + SEPARATOR.getIconWidth() + 
RIGHT_SEPARATOR_INSET;
 }
 }
 
@@ -169,7 +170,7 @@ public class BreadCrumbComponent 
extends JComponent i
 i++;
 }
 
-setPreferredSize(new Dimension((int) (xTotal + (nodes.length - 1) * 
(LEFT_SEPARATOR_INSET + SEPARATOR.getWidth(null) + RIGHT_SEPARATOR_INSET) + 
START_INSET), USABLE_HEIGHT/*(int) (height + 2 * INSET_HEIGHT)*/));
+setPreferredSize(new Dimension((int) (xTotal + (nodes.length - 1) * 
(LEFT_SEPARATOR_INSET + SEPARATOR.getIconWidth() + RIGHT_SEPARATOR_INSET) + 
START_INSET), USABLE_HEIGHT/*(int) (height + 2 * INSET_HEIGHT)*/));
 }
 
 @Override
@@ -206,7 +207,7 @@ public class BreadCrumbComponent 
extends JComponent i
 }
 
 startX = elemX;
-elemX += SEPARATOR.getWidth(null);
+elemX += SEPARATOR.getIconWidth();
 
 if (clickX <= elemX) {
 //found:


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated (6417f2f -> 5f78200)

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 6417f2f  Merge pull request #1281 from jglick/NbEventSpy-NETBEANS-2639
 new b8312bd  Replace 'new ImageIcon' with image2Icon for commonly visible 
icons.
 new d7d467c  Use Icon.paintIcon instead of Graphics.drawImage (one 
example).
 new d305cd1  [NETBEANS-1586] Make ImageUtilities.createDisabledIcon work 
with HiDPI icons
 new 44822cd  Adjust data types in ImageUtilities to make it easier to see 
where ToolTipImage is being passed around.
 new 0f61cd9  Make ImageUtilities handle scalable Icon implementations.
 new 894376f  Improve rendering quality of scaled bitmap icons on HiDPI 
displays.
 new c6bf0a5  Support HiDPI icons from ImageUtilities.mergeImages.
 new 73a3f68  Fix a few comment typos.
 new 5f828b3  Don't have CachedHiDPIIcon extend from ImageIcon.
 new 5f78200  Add more tests for ImageUtilities, and fix some broken ones.

The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../editor/breadcrumbs/BreadCrumbComponent.java|  15 +-
 .../src/org/netbeans/modules/java/ui/Icons.java|   4 +-
 .../jshell/editor/CommandCompletionProvider.java   |   2 +-
 .../org/netbeans/core/windows/view/EditorView.java |   2 +-
 .../core/windows/view/ui/TabbedHandler.java|   5 +-
 .../windows/view/ui/slides/TabbedSlideAdapter.java |   4 +-
 .../view/ui/tabcontrol/AbstractTabbedImpl.java |   3 +-
 .../core/windows/view/ui/toolbars/DnDSupport.java  |   2 +-
 .../core/windows/view/ui/toolbars/ToolbarRow.java  |   4 +-
 .../explorer/view/NodeRenderDataProvider.java  |   4 +-
 .../src/org/openide/util/CachedHiDPIIcon.java  | 210 +
 .../src/org/openide/util/FilteredIcon.java |  79 +
 .../src/org/openide/util/ImageUtilities.java   | 342 +++--
 .../src/org/openide/util/VectorIcon.java   |   2 +-
 .../src/org/openide/util/ImageUtilitiesTest.java   | 234 +-
 15 files changed, 786 insertions(+), 126 deletions(-)
 create mode 100644 
platform/openide.util.ui/src/org/openide/util/CachedHiDPIIcon.java
 create mode 100644 
platform/openide.util.ui/src/org/openide/util/FilteredIcon.java


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] 04/10: Adjust data types in ImageUtilities to make it easier to see where ToolTipImage is being passed around.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 44822cdcb0e2c6d174f0eeb260395d4696b2ab69
Author: Eirik Bakke 
AuthorDate: Wed May 29 17:22:16 2019 -0400

Adjust data types in ImageUtilities to make it easier to see where 
ToolTipImage is being passed around.

No public APIs are affected.
---
 .../src/org/openide/util/ImageUtilities.java   | 31 +-
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index 4a46b6a..7a3c73a 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -224,7 +224,7 @@ public final class ImageUtilities {
 }
 
 CompositeImageKey k = new CompositeImageKey(image1, image2, x, y);
-Image cached;
+ToolTipImage cached;
 
 synchronized (compositeCache) {
 ActiveRef r = compositeCache.get(k);
@@ -282,10 +282,15 @@ public final class ImageUtilities {
  * @return Image with attached tool tip 
  */
 public static final Image assignToolTipToImage(Image image, String text) {
+return assignToolTipToImageInternal(image, text);
+}
+
+// Private version with more specific return type.
+private static ToolTipImage assignToolTipToImageInternal(Image image, 
String text) {
 Parameters.notNull("image", image);
 Parameters.notNull("text", text);
 ToolTipImageKey key = new ToolTipImageKey(image, text);
-Image cached;
+ToolTipImage cached;
 synchronized (imageToolTipCache) {
 ActiveRef r = imageToolTipCache.get(key);
 if (r != null) {
@@ -411,14 +416,14 @@ public final class ImageUtilities {
 }
 }
 
-static Image getIcon(String resource, boolean localized) {
+static ToolTipImage getIcon(String resource, boolean localized) {
 if (localized) {
 if (resource == null) {
 return null;
 }
 synchronized (localizedCache) {
 ActiveRef ref = localizedCache.get(resource);
-Image img = null;
+ToolTipImage img = null;
 
 // no icon for this name (already tested)
 if (ref == NO_ICON) {
@@ -460,7 +465,7 @@ public final class ImageUtilities {
 
 while (it.hasNext()) {
 String suffix = it.next();
-Image i;
+ToolTipImage i;
 
 if (suffix.length() == 0) {
 i = getIcon(resource, loader, false);
@@ -487,12 +492,12 @@ public final class ImageUtilities {
 * @param localizedQuery whether the name contains some localization suffix
 *  and is not optimized/interned
 */
-private static Image getIcon(String name, ClassLoader loader, boolean 
localizedQuery) {
+private static ToolTipImage getIcon(String name, ClassLoader loader, 
boolean localizedQuery) {
 if (name == null) {
 return null;
 }
 ActiveRef ref = cache.get(name);
-Image img = null;
+ToolTipImage img = null;
 
 // no icon for this name (already tested)
 if (ref == NO_ICON) {
@@ -596,9 +601,9 @@ public final class ImageUtilities {
 ERR.log(Level.FINE, "loading icon {0} = {1}", new Object[] 
{n, result});
 }
 name = new String(name).intern(); // NOPMD
-result = ToolTipImage.createNew("", result, url);
-cache.put(name, new ActiveRef(result, cache, name));
-return result;
+ToolTipImage toolTipImage = ToolTipImage.createNew("", result, 
url);
+cache.put(name, new ActiveRef(toolTipImage, cache, 
name));
+return toolTipImage;
 } else { // no icon found
 if (!localizedQuery) {
 cache.put(name, NO_ICON);
@@ -651,7 +656,7 @@ public final class ImageUtilities {
 }
 }
 
-private static final Image doMergeImages(Image image1, Image image2, int 
x, int y) {
+private static final ToolTipImage doMergeImages(Image image1, Image 
image2, int x, int y) {
 ensureLoaded(image1);
 ensureLoaded(image2);
 
@@ -788,11 +793,11 @@ public final class ImageUtilities {
 }
 
 /** Cleaning reference. */
-private static final class ActiveRef extends SoftReference 
implements Runnable {
+private static final class ActiveRef extends 
SoftReference implements Runnable {
 private final Map> holder;
 private final T key;
 
-public Act

[netbeans] 05/10: Make ImageUtilities handle scalable Icon implementations.

2019-06-06 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit 0f61cd9928841a065a4ec18b0bb808e154a9632b
Author: Eirik Bakke 
AuthorDate: Thu May 30 00:20:20 2019 -0400

Make ImageUtilities handle scalable Icon implementations.

This commit prepares ImageUtilities to work with scalable Icon 
implementations,
such as a future SVGIcon class. Conversions such 
image2icon(icon2Image(icon))
are now lossless with respect to scalable Icon implementations. This allows
HiDPI support to be implemented via custom Icon classes while keeping 
existing
Image-based APIs (such as org.openide.nodes.Node.getIcon) unchanged.

The internal ImageUtilities.ToolTipImage class, which also implements the 
Icon
interface, is now used in most cases for ImageUtilities methods that return 
an
Image. Modifying ToolTipImage's paint() method to paint an extra debugging
stroke yields a quick confirmation that most of the icons visible in the IDE
now successfully have their painting delegated through this method. This 
will
come in handy in a subsequent commit, when we try to do some centralized 
scaling
improvements for HiDPI displays.

It is no longer safe to assume that ImageUtilities.image2Icon returns an
ImageIcon. Grepped the entire codebase for such casts (searched for cast to
ImageIcon within 3 lines of 'image2Icon'), and found only one, which was 
fixed.

Manually tested, including for the case where
ImageUtilities.getImageIconFilter() returns a non-null filter. Fixed a 
deadlock
bug that was unearthed in the latter case.
---
 .../jshell/editor/CommandCompletionProvider.java   |   2 +-
 .../src/org/openide/util/ImageUtilities.java   | 166 +++--
 2 files changed, 125 insertions(+), 43 deletions(-)

diff --git 
a/java/jshell.support/src/org/netbeans/modules/jshell/editor/CommandCompletionProvider.java
 
b/java/jshell.support/src/org/netbeans/modules/jshell/editor/CommandCompletionProvider.java
index fbb8fd9..697970d 100644
--- 
a/java/jshell.support/src/org/netbeans/modules/jshell/editor/CommandCompletionProvider.java
+++ 
b/java/jshell.support/src/org/netbeans/modules/jshell/editor/CommandCompletionProvider.java
@@ -337,7 +337,7 @@ public class CommandCompletionProvider implements 
CompletionProvider{
 n = f.getLookup().lookup(Node.class);
 }
 if (n != null) {
-return 
(ImageIcon)ImageUtilities.image2Icon(n.getIcon(BeanInfo.ICON_COLOR_16x16));
+return new 
ImageIcon(n.getIcon(BeanInfo.ICON_COLOR_16x16));
 }
 }
 }
diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java 
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index 7a3c73a..8783424 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -28,7 +28,6 @@ import java.awt.Toolkit;
 import java.awt.Transparency;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
-import java.awt.image.FilteredImageSource;
 import java.awt.image.ImageObserver;
 import java.awt.image.RGBImageFilter;
 import java.awt.image.WritableRaster;
@@ -54,6 +53,13 @@ import javax.swing.UIManager;
 
 /** 
  * Useful static methods for manipulation with images/icons, results are 
cached.
+ *
+ * Images can be represented as instances of either {@link Image} or {@link 
Icon}. For best
+ * results on HiDPI displays, clients should use the {@link 
#image2Icon(Image)} method provided by
+ * this class when converting an {@code Image} to an {@code Icon}, rather than 
constructing
+ * {@link ImageIcon} instances themselves. When doing manual painting, clients 
should use
+ * {@link Icon#paintIcon(Component, Graphics, int, int)} rather than
+ * {@link Graphics#drawImage(Image, int, int, ImageObserver)}.
  * 
  * @author Jaroslav Tulach, Tomas Holy
  * @since 7.15
@@ -93,6 +99,22 @@ public final class ImageUtilities {
 private static final Logger ERR = 
Logger.getLogger(ImageUtilities.class.getName());
 
 private static final String DARK_LAF_SUFFIX = "_dark"; //NOI18N
+
+/**
+ * Dummy component to be passed to the first parameter  of
+ * {@link Icon#paintIcon(Component, Graphics, int, int)} when converting 
an {@code Icon} to an
+ * {@code Image}. See comment in {@link #icon2ToolTipImage(Icon)}.
+ */
+private static volatile Component dummyIconComponent;
+
+static {
+Mutex.EVENT.writeAccess(new Runnable() {
+@Override
+public void run() {
+dummyIconComponent = new JLabel();
+}
+});
+}
 
  

[incubator-netbeans] branch master updated: [NETBEANS-731] Rename AutoHidingMenuBarManualTest to avoid a test failure. (#1067)

2019-01-01 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new c451e08  [NETBEANS-731] Rename AutoHidingMenuBarManualTest to avoid a 
test failure. (#1067)
c451e08 is described below

commit c451e080ec1da0b84c1893f5400d65ab5b042098
Author: Eirik Bakke 
AuthorDate: Wed Jan 2 01:54:26 2019 +0100

[NETBEANS-731] Rename AutoHidingMenuBarManualTest to avoid a test failure. 
(#1067)

This avoids a "No runnable methods" error while running tests in the 
core.windows package, due to the AutoHidingMenuBarManualTest class having a 
name that ends with "Test" but no test methods in it. The class in question is 
kept around for manual testing purposes only, and is not intended to be run 
automatically. See https://github.com/apache/incubator-netbeans/pull/1060 .
---
 .../src/org/netbeans/core/windows/view/ui/AutoHidingMenuBar.java| 2 ++
 ...ngMenuBarManualTest.java => AutoHidingMenuBarManualTestApp.java} | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBar.java
 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBar.java
index 0f78c5b..eb1f18d 100644
--- 
a/platform/core.windows/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBar.java
+++ 
b/platform/core.windows/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBar.java
@@ -44,6 +44,8 @@ import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import org.openide.util.Utilities;
 
+/* Note to developers: To manually test the behavior of this class without 
running the entire IDE,
+run AutoHidingMenuBarManualTestApp.java in the test sources. */
 /**
  * Container for logic that allows a {@link JFrame}'s {@link JMenuBar} to be 
hidden by default in
  * full screen mode, but shown again if the user moves the mouse to the top of 
the screen or invokes
diff --git 
a/platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTest.java
 
b/platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTestApp.java
similarity index 96%
rename from 
platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTest.java
rename to 
platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTestApp.java
index bbf4d93..e3a91c4 100644
--- 
a/platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTest.java
+++ 
b/platform/core.windows/test/unit/src/org/netbeans/core/windows/view/ui/AutoHidingMenuBarManualTestApp.java
@@ -37,7 +37,7 @@ import javax.swing.UnsupportedLookAndFeelException;
  * A standalone Swing app that can be used to manually test {@link 
AutoHidingMenuBar} without
  * launching the full IDE. Tested on Windows 10. Not applicable to MacOS.
  */
-public final class AutoHidingMenuBarManualTest {
+public final class AutoHidingMenuBarManualTestApp {
 private final JFrame frame = new JFrame();
 private final JMenuBar mainMenuBar = new JMenuBar();
 
@@ -52,12 +52,12 @@ public final class AutoHidingMenuBarManualTest {
 {
 e.printStackTrace();
 }
-new AutoHidingMenuBarManualTest().setVisible(true);
+new AutoHidingMenuBarManualTestApp().setVisible(true);
 }
 });
 }
 
-public AutoHidingMenuBarManualTest() {
+public AutoHidingMenuBarManualTestApp() {
 initComponents();
 }
 


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[incubator-netbeans] branch master updated: Tweak color of 3 LAF-independent HiDPI icons for dark themes (e.g. Darcula).

2018-10-30 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8f1f57b  Tweak color of 3 LAF-independent HiDPI icons for dark themes 
(e.g. Darcula).
8f1f57b is described below

commit 8f1f57bdc2552541b9947fd12ac8dd74796539f6
Author: Eirik Bakke 
AuthorDate: Tue Oct 30 19:22:08 2018 -0400

Tweak color of 3 LAF-independent HiDPI icons for dark themes (e.g. Darcula).
---
 platform/openide.awt/src/org/openide/awt/IconWithArrow.java| 10 +-
 .../openide.awt/src/org/openide/awt/ToolbarWithOverflow.java   |  9 -
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/platform/openide.awt/src/org/openide/awt/IconWithArrow.java 
b/platform/openide.awt/src/org/openide/awt/IconWithArrow.java
index 1c87da8..d2ac2a8 100644
--- a/platform/openide.awt/src/org/openide/awt/IconWithArrow.java
+++ b/platform/openide.awt/src/org/openide/awt/IconWithArrow.java
@@ -26,6 +26,7 @@ import java.awt.Graphics2D;
 import java.awt.geom.Path2D;
 import javax.swing.Icon;
 import javax.swing.UIManager;
+import org.openide.util.ImageUtilities;
 import org.openide.util.Parameters;
 import org.openide.util.VectorIcon;
 
@@ -101,7 +102,14 @@ class IconWithArrow implements Icon {
 
 @Override
 protected void paintIcon(Component c, Graphics2D g, int width, int 
height, double scaling) {
-g.setColor(disabled ? new Color(201, 201, 201, 255) : new 
Color(86, 86, 86, 255));
+final Color color;
+if (UIManager.getBoolean("nb.dark.theme")) {
+  // Foreground brightness level taken from the combobox dropdown 
on Darcula.
+  color = disabled ? new Color(90, 90, 90, 255) : new Color(187, 
187, 187, 255);
+} else {
+  color = disabled ? new Color(201, 201, 201, 255) : new Color(86, 
86, 86, 255);
+}
+g.setColor(color);
 final double overshoot = 2.0 / scaling;
 final double arrowWidth = width + overshoot * scaling;
 final double arrowHeight = height - 0.2 * scaling;
diff --git a/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java 
b/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java
index b2c03dd..1951e77 100644
--- a/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java
+++ b/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java
@@ -511,7 +511,14 @@ public class ToolbarWithOverflow extends JToolBar {
 // Draw two chevrons pointing downwards. Make strokes a little 
thicker at low scalings.
 double strokeWidth = 0.8 * scaling + 0.3;
 g.setStroke(new BasicStroke((float) strokeWidth));
-g.setColor(new Color(50, 50, 50, 255));
+final Color color;
+if (UIManager.getBoolean("nb.dark.theme")) {
+  // Foreground brightness level taken from the combobox dropdown 
on Darcula.
+  color = new Color(187, 187, 187, 255);
+} else {
+  color = new Color(50, 50, 50, 255);
+}
+g.setColor(color);
 for (int i = 0; i < 2; i++) {
 final int y = round((1.4 + 4.1 * i) * scaling);
 final double arrowWidth = round(5.0 * scaling);


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[incubator-netbeans] branch master updated: [NETBEANS-1197] Avoid ClosedByInterruptException in NetBeans' classloader

2018-10-30 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new ef48003  [NETBEANS-1197] Avoid ClosedByInterruptException in NetBeans' 
classloader
ef48003 is described below

commit ef4800372ccb39c98f610dc9a69569251ab58744
Author: Eirik Bakke 
AuthorDate: Tue Oct 30 17:22:41 2018 -0400

[NETBEANS-1197] Avoid ClosedByInterruptException in NetBeans' classloader

Use NIO by default, but fall back to the old FileInputStream if 
ClosedByInterruptException is detected.
---
 .../src/org/netbeans/JarClassLoader.java   | 74 ++
 1 file changed, 62 insertions(+), 12 deletions(-)

diff --git a/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java 
b/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
index b1cdcc8..77cc076 100644
--- a/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
+++ b/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java
@@ -21,6 +21,7 @@ package org.netbeans;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,6 +37,7 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
+import java.nio.channels.ClosedByInterruptException;
 import java.nio.file.Files;
 import java.nio.file.InvalidPathException;
 import java.security.CodeSource;
@@ -850,20 +852,41 @@ public class JarClassLoader extends ProxyClassLoader {
 super(BaseUtilities.toURI(file).toURL());
 dir = file;
 }
-
+
+private Manifest getManifestHelper(boolean useNIO) throws IOException {
+  File maniF = new File(new File(dir, "META-INF"), "MANIFEST.MF");
+  Manifest mf = new Manifest();
+  if (maniF.canRead()) {
+  try (InputStream istm = useNIO
+  ? Files.newInputStream(maniF.toPath())
+  : new FileInputStream(maniF))
+  {
+  mf.read(istm);
+  }
+  }
+  return mf;
+}
+
 public Manifest getManifest() {
 Manifest mf = manifest;
 if (mf != null) {
 return mf;
 }
-File maniF = new File(new File(dir, "META-INF"), "MANIFEST.MF");
-mf = new Manifest();
-if (maniF.canRead()) {
-try (InputStream istm = Files.newInputStream(maniF.toPath())) {
-mf.read(istm);
-} catch (IOException | InvalidPathException ex) {
-Exceptions.printStackTrace(ex);
+try {
+try {
+mf = getManifestHelper(true);
+} catch (ClosedByInterruptException ex) {
+// See comments in readClass().
+LOGGER.log(Level.INFO,
+"getManifest was interrupted; redoing operation with a 
regular FileInputStream");
+try {
+  mf = getManifestHelper(false);
+} finally {
+  Thread.currentThread().interrupt();
+}
 }
+} catch (IOException | InvalidPathException ex) {
+Exceptions.printStackTrace(ex);
 }
 return manifest = mf;
 }
@@ -876,14 +899,17 @@ public class JarClassLoader extends ProxyClassLoader {
 File resFile = new File(dir, name);
 return resFile.exists() ? BaseUtilities.toURI(resFile).toURL() : 
null;
 }
-
-protected byte[] readClass(String path) throws IOException {
+
+private byte[] readClassHelper(String path, boolean usingNIO) throws 
IOException {
 File clsFile = new File(dir, path.replace('/', 
File.separatorChar));
 if (!clsFile.exists()) return null;
-
+
 int len = (int)clsFile.length();
 byte[] data = new byte[len];
-try (InputStream is = Files.newInputStream(clsFile.toPath())) {
+try (InputStream is = usingNIO
+  ? Files.newInputStream(clsFile.toPath())
+  : new FileInputStream(clsFile))
+{
 int count = 0;
 while (count < len) {
 count += is.read(data, count, len - count);
@@ -893,6 +919,30 @@ public class JarClassLoader extends ProxyClassLoader {
 throw new IOException(ex);
 }
 }
+
+protected byte[] readClass(String path) throws IOException {
+/* "FileOutputStream and FileInputStream complicate 

[incubator-netbeans] branch master updated: [NETBEANS-1238, NETBEANS-1260] HiDPI icons for window system icons on Windows and Mac

2018-10-30 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 0f53295  [NETBEANS-1238,NETBEANS-1260] HiDPI icons for window system 
icons on Windows and Mac
0f53295 is described below

commit 0f53295eaa11cc831cab9c2db43b12f017ed0180
Author: Eirik Bakke 
AuthorDate: Tue Oct 30 17:16:41 2018 -0400

[NETBEANS-1238,NETBEANS-1260] HiDPI icons for window system icons on 
Windows and Mac

This commit introduces vector-drawn Icon implementations for the icons
used in the window system's Windows 8 and Aqua (MacOS) LAFs. Specifically, 
this
replaces most of the bitmap icons for these two LAFs o.n.swing.tabcontrol 
and
openide.awt modules.

An abstract class VectorIcon is added in the UI Utilities Module 
(openide.awt)
as a general-purpose starting point for creating new vector icons. It 
handles
and documents a number of tricky adjustments that are needed to draw icons 
that
appear sharp on HiDPI screens. This class can be used to implement HiDPI 
icons
in other LAFs at a later time, e.g. on Linux.

A small utility, VectorIconTester, was written to preview new icons at 
multiple
resolutions, as well as to compare them with existing bitmap icons. This is 
less
polished code that is nevertheless included here, in tabcontrol's test 
package.
A screenshot of its output, as well as screenshots of the NetBeans IDE 
before
and after the patch on both Windows and MacOS, are attached to the JIRA
ticket NETBEANS-1260.
---
 .../netbeans/swing/plaf/aqua/AquaLFCustoms.java|   4 +-
 .../swing/plaf/windows8/Windows8LFCustoms.java |   4 +-
 .../o.n.swing.tabcontrol/nbproject/project.xml |   2 +-
 .../tabcontrol/plaf/AquaEditorTabCellRenderer.java |  38 +-
 .../plaf/AquaVectorEditorTabCellRenderer.java  |  41 ++
 .../plaf/AquaVectorEditorTabDisplayerUI.java   |  49 ++
 .../tabcontrol/plaf/AquaVectorTabControlIcon.java  | 491 ++
 .../plaf/AquaVectorViewTabDisplayerUI.java |  44 ++
 .../tabcontrol/plaf/AquaViewTabDisplayerUI.java|   4 +-
 .../tabcontrol/plaf/TabControlButtonFactory.java   |   1 -
 .../plaf/WinVistaEditorTabCellRenderer.java|  22 +-
 .../plaf/Windows8EditorTabCellRenderer.java|  21 +-
 .../plaf/Windows8EditorTabDisplayerUI.java |   2 +-
 .../plaf/Windows8VectorEditorTabCellRenderer.java  |  38 ++
 .../plaf/Windows8VectorEditorTabDisplayerUI.java   |  49 ++
 .../plaf/Windows8VectorTabControlIcon.java | 242 +
 .../plaf/Windows8VectorViewTabDisplayerUI.java |  44 ++
 .../plaf/Windows8ViewTabDisplayerUI.java   |   4 +-
 .../swing/tabcontrol/plaf/VectorIconTester.java| 556 +
 platform/openide.awt/nbproject/project.xml |   2 +-
 .../src/org/openide/awt/AquaVectorCloseButton.java |  86 
 .../src/org/openide/awt/CloseButtonFactory.java|  24 +-
 .../src/org/openide/awt/DropDownButton.java|  10 +-
 .../src/org/openide/awt/DropDownToggleButton.java  |  11 +-
 .../src/org/openide/awt/IconWithArrow.java |  39 +-
 .../src/org/openide/awt/ToolbarWithOverflow.java   |  53 +-
 .../org/openide/awt/Windows8VectorCloseButton.java |  65 +++
 platform/openide.util.ui/apichanges.xml|  26 +
 .../src/org/openide/util/VectorIcon.java   | 202 
 29 files changed, 2085 insertions(+), 89 deletions(-)

diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/aqua/AquaLFCustoms.java 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/aqua/AquaLFCustoms.java
index 69f6234..a300812 100644
--- 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/aqua/AquaLFCustoms.java
+++ 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/aqua/AquaLFCustoms.java
@@ -117,8 +117,8 @@ public final class AquaLFCustoms extends LFCustoms {
 
 
 //UI Delegates for the tab control
-EDITOR_TAB_DISPLAYER_UI, 
"org.netbeans.swing.tabcontrol.plaf.AquaEditorTabDisplayerUI",
-VIEW_TAB_DISPLAYER_UI, 
"org.netbeans.swing.tabcontrol.plaf.AquaViewTabDisplayerUI",
+EDITOR_TAB_DISPLAYER_UI, 
"org.netbeans.swing.tabcontrol.plaf.AquaVectorEditorTabDisplayerUI",
+VIEW_TAB_DISPLAYER_UI, 
"org.netbeans.swing.tabcontrol.plaf.AquaVectorViewTabDisplayerUI",
 SLIDING_TAB_BUTTON_UI, 
"org.netbeans.swing.tabcontrol.plaf.SlidingTabDisplayerButtonUI$Aqua",
 "NbTabControl.focusedTabBackground", new Color(135,189,255),
 "NbTabControl.selectedTabBrighterBackground", new 
Color(252,252,252),
diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows

[incubator-netbeans-mavenutils] 01/01: Merge pull request #1 from eirikbakke/fixJDK9detection

2018-10-20 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-netbeans-mavenutils.git

commit 3b08a5951212f3d09bc24e16ff39411d7d3ac473
Merge: 896af4b 33fb2e4
Author: Eirik Bakke 
AuthorDate: Sat Oct 20 17:30:27 2018 -0400

Merge pull request #1 from eirikbakke/fixJDK9detection

Fix 64-bit JDK detection (broke with Java 9's new directory structure)

 .../main/java/org/codehaus/mojo/nbm/RunPlatformAppMojo.java   | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[incubator-netbeans-mavenutils] branch master updated (896af4b -> 3b08a59)

2018-10-20 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-netbeans-mavenutils.git.


from 896af4b  Root file
 add 33fb2e4  Fix 64-bit JDK detection, which broke with Java 9's new 
directory structure.
 new 3b08a59  Merge pull request #1 from eirikbakke/fixJDK9detection

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/codehaus/mojo/nbm/RunPlatformAppMojo.java   | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[incubator-netbeans] branch master updated: [NETBEANS-49] Avoid large scroll pane jumps on Windows (#881)

2018-10-03 Thread ebakke
This is an automated email from the ASF dual-hosted git repository.

ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 6351f39  [NETBEANS-49] Avoid large scroll pane jumps on Windows (#881)
6351f39 is described below

commit 6351f39a0a78e5ff630fd603b6ebe92dbeba3f9b
Author: Eirik Bakke 
AuthorDate: Wed Oct 3 19:08:02 2018 -0400

[NETBEANS-49] Avoid large scroll pane jumps on Windows (#881)

[NETBEANS-49] Handle precise scroll events in all scroll panes on Windows.

This commit adapts a patch originally written by Pavel Fatin, for IntelliJ, 
to NetBeans. See
http://mail.openjdk.java.net/pipermail/awt-dev/2017-January/012507.html .

The main utility of this patch is to avoid scroll panes scrolling a too 
large
number of lines when using a touch pad or mouse wheel on Windows. See the
bug report at NETBEANS-49.

(Adjustments after pull request comments: Adjust license and notice per 
pull request
comments. Use 4-space indentation.)
---
 platform/o.n.swing.plaf/licenseinfo.xml|  11 ++
 .../src/org/netbeans/swing/plaf/Startup.java   |   9 ++
 .../swing/plaf/util/SmoothScrollPaneUI.java| 132 +
 3 files changed, 152 insertions(+)

diff --git a/platform/o.n.swing.plaf/licenseinfo.xml 
b/platform/o.n.swing.plaf/licenseinfo.xml
index 2461eb5..4542462 100644
--- a/platform/o.n.swing.plaf/licenseinfo.xml
+++ b/platform/o.n.swing.plaf/licenseinfo.xml
@@ -44,4 +44,15 @@
 
 
 
+
+src/org/netbeans/swing/plaf/util/SmoothScrollPaneUI.java
+
+
+
+This software includes code from IntelliJ IDEA Community Edition
+Copyright (C) JetBrains s.r.o.
+https://www.jetbrains.com/idea/
+
+
 
diff --git a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
index bb64eba..5daf055 100644
--- a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
+++ b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java
@@ -255,6 +255,15 @@ public final class Startup {
 }
 curCustoms.disposeValues();
 }
+installSmoothScrollPane();
+}
+
+private void installSmoothScrollPane() {
+  UIDefaults defaults = UIManager.getDefaults();
+  final String SCROLL_PANE_UI_CLASS_ID = "ScrollPaneUI";
+  Object existingValue = defaults.get(SCROLL_PANE_UI_CLASS_ID);
+  if ("javax.swing.plaf.basic.BasicScrollPaneUI".equals(existingValue))
+defaults.put(SCROLL_PANE_UI_CLASS_ID, 
"org.netbeans.swing.plaf.util.SmoothScrollPaneUI");
 }
 
 private void loadAllLazyValues (LFCustoms customs) {
diff --git 
a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/util/SmoothScrollPaneUI.java
 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/util/SmoothScrollPaneUI.java
new file mode 100644
index 000..333c8ed
--- /dev/null
+++ 
b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/util/SmoothScrollPaneUI.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* This file is based in part on the commit
+ * 
https://github.com/JetBrains/intellij-community/commit/34b9dfd0585937c3731e06a89554d1dc86f7f235
+ * from 2016-12-14 in the IntelliJ IDEA Community Edition repository, as 
referenced by Pavel Fatin
+ * on the AWT Dev mailing list on 2017-01-04
+ * ( http://mail.openjdk.java.net/pipermail/awt-dev/2017-January/012507.html 
), and retrieved on
+ * 2018-09-17. The source files in question are as follows:
+ *   com.intellij.ui.components.SmoothScrollPane (author Pavel Fatin)
+ *   com.intellij.ui.components.JBScrollPane
+ *
+ * The original code has been modified by Eirik Bakke (eba...@ultorg.com) for 
standalone use outside
+ * the IntelliJ IDE. In particular, we use here a custom ScrollPaneUI 
implementation instead of the
+ * original approach of accessing the mouseScrollListener by reflection.
+ *
+ * The complete license header for the original files (identical for both 
files) is included above.
+ * The NOTICE file is pasted in licenseinfo.xml.
+ */
+package org.netbeans.swing.plaf.util;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseWhe