You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/02/06 15:58:27 UTC

[GitHub] [netbeans] AlexFalappa opened a new pull request #1928: FlatLaf toolbar grips

AlexFalappa opened a new pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928
 
 
   Implementation of toolbar grippers (or dragger) following FlatLaf design. The current code does not recognize the LAF and uses a fallback Metal LAF lookalike.
   
   **NOTE:** should support HiDPI but I couldn't test it (no HiDPI devices here). Also not tested on MacOS.
   
   Before:
   ![before-light](https://user-images.githubusercontent.com/1875690/73953798-374fe800-4901-11ea-8d2b-191cd16642b0.png)
   ![before-dark](https://user-images.githubusercontent.com/1875690/73953805-3a4ad880-4901-11ea-91eb-0d56e4d3e3c6.png)
   
   After:
   ![after-light](https://user-images.githubusercontent.com/1875690/73953827-4040b980-4901-11ea-8946-c15272984a9e.png)
   ![after-dark](https://user-images.githubusercontent.com/1875690/73953842-43d44080-4901-11ea-9fd6-01b67314c3ee.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375993571
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   Could you explain why this is needed? Does FlatLAF do its own scaling on Java 8?
   
   On Java 9 and above I would expect getMinimumSize to return the same logical pixel value regardless of HiDPI scaling setting. Is this correct?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375972826
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
+    }
+
+    @Override
+    public Dimension getPreferredSize () {
+        return this.getMinimumSize ();
+    }
+
+    @Override
+    public Dimension getMaximumSize () {
+        return max;
 
 Review comment:
   For HiDPI on Java 8 change this line to `return UIScale.scale(max);`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on issue #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on issue #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#issuecomment-583005825
 
 
   @DevCharly thanks for the additional HiDPI testing (and for FlatLaf of course).
   
   Please tell me if you find anything wrong.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375968930
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
 
 Review comment:
   Oops, will correct this

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375973307
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
 
 Review comment:
   For HiDPI on Java 8 change (unscaled) `DOT_SIZE` to (scaled) `dotSize`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r376018397
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375994962
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   (I'd be inclined to disallow HiDPI scaling altogether on Java 8 and below, for consistency with other components that are not drawn by FlatLAF.)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lkishalmi commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375962667
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
 
 Review comment:
   The //NOI18N is missing, though I do not know how strict shall we be on that rule.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] DevCharly commented on issue #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
DevCharly commented on issue #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#issuecomment-582995068
 
 
   Great.
   
   Looks also good on HiDPI 150% Java 13:
   
   ![image](https://user-images.githubusercontent.com/5604048/73958138-bfd18700-4907-11ea-9f7e-00776a825729.png)
   
   ![image](https://user-images.githubusercontent.com/5604048/73958143-c3fda480-4907-11ea-9110-ee73662b1ab5.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375993571
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   Could you explain why this is needed? Is this to support scaling on Java 8?
   
   On Java 9 and above I would expect getMinimumSize to return the same logical pixel value regardless of HiDPI scaling setting. Is this correct?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r376002597
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
+    }
+
+    @Override
+    public Dimension getPreferredSize () {
+        return this.getMinimumSize ();
+    }
+
+    @Override
+    public Dimension getMaximumSize () {
+        return max;
 
 Review comment:
   Will change this also

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r376002904
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
 
 Review comment:
   Will do also this

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375997342
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   OK, nevermind my comments here. Looking at https://github.com/JFormDesigner/FlatLaf/blob/master/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java I think I understand it. UIScale.scale(min) makes sense for consistency with other FlatLAF code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
DevCharly commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r375972610
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   For HiDPI on Java 8 change this line to `return UIScale.scale(min);`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on issue #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on issue #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#issuecomment-583065911
 
 
   All comments addressed.
   
   This should be OK now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
AlexFalappa commented on a change in pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928#discussion_r376002424
 
 

 ##########
 File path: platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/ui/FlatToolbarDragger.java
 ##########
 @@ -0,0 +1,83 @@
+/*
+ * 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.laf.flatlaf.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import com.formdev.flatlaf.util.UIScale;
+
+/**
+ * Toolbar grip consistent with FlatLaf style.
+ * Paint code is modeled after {@code com.formdev.flatlaf.ui.FlatToolBarBorder}.
+ */
+public class FlatToolbarDragger extends JPanel {
+	private static final int DOT_COUNT = 4;
+	private static final int DOT_SIZE = 2;
+	private static final int GRIP_WIDTH = DOT_SIZE * 3;
+    /** Minimum size. */
+    private final Dimension min;
+    /** Maximum size. */
+    private final Dimension max;
+    protected final Color gripColor = UIManager.getColor( "ToolBar.gripColor" );
+
+    public FlatToolbarDragger() {
+        min = new Dimension(GRIP_WIDTH, GRIP_WIDTH);
+        max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE);
+    }
+
+    @Override
+    public void paint (Graphics g) {
+        Graphics2D g2 = (Graphics2D)g.create();
+        try {
+            Utils.setRenderingHints(g2);
+            g2.setColor(gripColor);
+            int dotSize = UIScale.scale(DOT_SIZE);
+            int gapSize = dotSize;
+            int gripSize = (dotSize * DOT_COUNT) + ((gapSize * (DOT_COUNT - 1)));
+            // paint dots
+            int y = Math.round((getHeight() - gripSize) / 2f);
+            for(int i = 0; i < DOT_COUNT; i++) {
+                g2.fillOval(DOT_SIZE, y, dotSize, dotSize);
+                y += dotSize + gapSize;
+            }
+        } finally {
+            g2.dispose();
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize () {
+        return min;
 
 Review comment:
   Will do

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] ebarboni merged pull request #1928: FlatLaf toolbar grips

Posted by GitBox <gi...@apache.org>.
ebarboni merged pull request #1928: FlatLaf toolbar grips
URL: https://github.com/apache/netbeans/pull/1928
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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