diff --git a/app/.classpath b/app/.classpath index 64ac39ae3..f32ff129b 100644 --- a/app/.classpath +++ b/app/.classpath @@ -3,31 +3,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - diff --git a/app/lib/README.xml-apis-1.3.04.txt b/app/lib/README.xml-apis-1.3.04.txt new file mode 100644 index 000000000..dcfbcdfc3 --- /dev/null +++ b/app/lib/README.xml-apis-1.3.04.txt @@ -0,0 +1,30 @@ +This distribution includes xml-apis.jar from the XML Commons External +1.3.04 binary distribution, which can also be obtained from: + + http://xml.apache.org/mirrors.cgi + +Source code is available from the XML Commons web site: + + http://xml.apache.org/commons/ + +xml-apis.jar contains: + + - DOM Level 2 Events + - DOM Level 2 HTML + - DOM Level 2 Style + - DOM Level 2 Traversal and Range + - DOM Level 2 Views + - DOM Level 3 Core + - DOM Level 3 Load and Save + - DOM Level 3 XPath + - JAXP 1.3 (JSR 206) + - SAX + +All DOM code is licensed under the W3C Software License, and DOM documentation +under the W3C Document License. See LICENSE.dom-software.txt and +LICENSE.dom-documentation.txt. + +The JAXP 1.3 code is licensed under the Apache Software License 2.0, which is +in the LICENSE in the root directory of this distribution. + +SAX is public domain. See LICENSE.sax.txt. diff --git a/app/lib/README.xml-apis-ext-1.3.04.txt b/app/lib/README.xml-apis-ext-1.3.04.txt new file mode 100644 index 000000000..03a0a1ea4 --- /dev/null +++ b/app/lib/README.xml-apis-ext-1.3.04.txt @@ -0,0 +1,19 @@ +This distribution includes xml-apis-ext.jar from the XML Commons External +1.3.04 binary distribution, which can also be obtained from: + + http://xml.apache.org/mirrors.cgi + +Source code is available from the XML Commons web site: + + http://xml.apache.org/commons/ + +xml-apis-ext.jar contains: + + - SAC 1.3 + - SMIL Java bindings + - SVG 1.1 Java bindings + +SAC 1.3, the SMIL Java bindings and the SVG 1.1 Java bindings are licensed +under the W3C Software License. Related documentation is licensed under the +W3C Document License. See LICENSE.dom-software.txt and +LICENSE.dom-documentation.txt. diff --git a/app/lib/batik-1.8.jar b/app/lib/batik-1.8.jar new file mode 100644 index 000000000..f70af08be Binary files /dev/null and b/app/lib/batik-1.8.jar differ diff --git a/app/lib/batik-anim-1.8.jar b/app/lib/batik-anim-1.8.jar new file mode 100644 index 000000000..9470058c7 Binary files /dev/null and b/app/lib/batik-anim-1.8.jar differ diff --git a/app/lib/batik-awt-util-1.8.jar b/app/lib/batik-awt-util-1.8.jar new file mode 100644 index 000000000..740acb744 Binary files /dev/null and b/app/lib/batik-awt-util-1.8.jar differ diff --git a/app/lib/batik-bridge-1.8.jar b/app/lib/batik-bridge-1.8.jar new file mode 100644 index 000000000..36e8e036b Binary files /dev/null and b/app/lib/batik-bridge-1.8.jar differ diff --git a/app/lib/batik-codec-1.8.jar b/app/lib/batik-codec-1.8.jar new file mode 100644 index 000000000..07b6e79c0 Binary files /dev/null and b/app/lib/batik-codec-1.8.jar differ diff --git a/app/lib/batik-css-1.8.jar b/app/lib/batik-css-1.8.jar new file mode 100644 index 000000000..1c9fb1952 Binary files /dev/null and b/app/lib/batik-css-1.8.jar differ diff --git a/app/lib/batik-dom-1.8.jar b/app/lib/batik-dom-1.8.jar new file mode 100644 index 000000000..4899b514d Binary files /dev/null and b/app/lib/batik-dom-1.8.jar differ diff --git a/app/lib/batik-ext-1.8.jar b/app/lib/batik-ext-1.8.jar new file mode 100644 index 000000000..d7c850b16 Binary files /dev/null and b/app/lib/batik-ext-1.8.jar differ diff --git a/app/lib/batik-gvt-1.8.jar b/app/lib/batik-gvt-1.8.jar new file mode 100644 index 000000000..7bb4e58d0 Binary files /dev/null and b/app/lib/batik-gvt-1.8.jar differ diff --git a/app/lib/batik-parser-1.8.jar b/app/lib/batik-parser-1.8.jar new file mode 100644 index 000000000..1c1223d44 Binary files /dev/null and b/app/lib/batik-parser-1.8.jar differ diff --git a/app/lib/batik-rasterizer-1.8.jar b/app/lib/batik-rasterizer-1.8.jar new file mode 100644 index 000000000..bce640df7 Binary files /dev/null and b/app/lib/batik-rasterizer-1.8.jar differ diff --git a/app/lib/batik-script-1.8.jar b/app/lib/batik-script-1.8.jar new file mode 100644 index 000000000..c3e9a9f70 Binary files /dev/null and b/app/lib/batik-script-1.8.jar differ diff --git a/app/lib/batik-squiggle-1.8.jar b/app/lib/batik-squiggle-1.8.jar new file mode 100644 index 000000000..7e2e8bb1d Binary files /dev/null and b/app/lib/batik-squiggle-1.8.jar differ diff --git a/app/lib/batik-svg-dom-1.8.jar b/app/lib/batik-svg-dom-1.8.jar new file mode 100644 index 000000000..64295503b Binary files /dev/null and b/app/lib/batik-svg-dom-1.8.jar differ diff --git a/app/lib/batik-svgpp-1.8.jar b/app/lib/batik-svgpp-1.8.jar new file mode 100644 index 000000000..fbd6f9053 Binary files /dev/null and b/app/lib/batik-svgpp-1.8.jar differ diff --git a/app/lib/batik-transcoder-1.8.jar b/app/lib/batik-transcoder-1.8.jar new file mode 100644 index 000000000..f3c3c4f8f Binary files /dev/null and b/app/lib/batik-transcoder-1.8.jar differ diff --git a/app/lib/batik-util-1.8.jar b/app/lib/batik-util-1.8.jar new file mode 100644 index 000000000..23e362533 Binary files /dev/null and b/app/lib/batik-util-1.8.jar differ diff --git a/app/lib/batik-xml-1.8.jar b/app/lib/batik-xml-1.8.jar new file mode 100644 index 000000000..1101455a0 Binary files /dev/null and b/app/lib/batik-xml-1.8.jar differ diff --git a/app/lib/batik.LICENSE.ASL-2.0.txt b/app/lib/batik.LICENSE.ASL-2.0.txt new file mode 100644 index 000000000..3e4e3d004 --- /dev/null +++ b/app/lib/batik.LICENSE.ASL-2.0.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. \ No newline at end of file diff --git a/app/lib/xml-apis-1.3.04.jar b/app/lib/xml-apis-1.3.04.jar new file mode 100644 index 000000000..d42c0ea6c Binary files /dev/null and b/app/lib/xml-apis-1.3.04.jar differ diff --git a/app/lib/xml-apis-ext-1.3.04.jar b/app/lib/xml-apis-ext-1.3.04.jar new file mode 100644 index 000000000..a7869d68a Binary files /dev/null and b/app/lib/xml-apis-ext-1.3.04.jar differ diff --git a/app/lib/xmlgraphics-commons-2.0.jar b/app/lib/xmlgraphics-commons-2.0.jar new file mode 100644 index 000000000..a168e4ff4 Binary files /dev/null and b/app/lib/xmlgraphics-commons-2.0.jar differ diff --git a/app/src/cc/arduino/contributions/ContributionsSelfCheck.java b/app/src/cc/arduino/contributions/ContributionsSelfCheck.java index 5803189ef..1031effc3 100644 --- a/app/src/cc/arduino/contributions/ContributionsSelfCheck.java +++ b/app/src/cc/arduino/contributions/ContributionsSelfCheck.java @@ -83,11 +83,11 @@ public class ContributionsSelfCheck extends TimerTask { String text; if (updatableLibraries > 0 && updatablePlatforms <= 0) { - text = I18n.format(tr("
Update available for some of your {0}libraries{1}"), "", ""); + text = I18n.format(tr("Updates available for some of your {0}libraries{1}"), "", ""); } else if (updatableLibraries <= 0 && updatablePlatforms > 0) { - text = I18n.format(tr("
Update available for some of your {0}boards{1}"), "", ""); + text = I18n.format(tr("Updates available for some of your {0}boards{1}"), "", ""); } else { - text = I18n.format(tr("
Update available for some of your {0}boards{1} and {2}libraries{3}"), "", "", "", ""); + text = I18n.format(tr("Updates available for some of your {0}boards{1} and {2}libraries{3}"), "", "", "", ""); } if (cancelled) { diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java index 59087b6b0..a9bd20a92 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java @@ -26,6 +26,7 @@ import cc.arduino.contributions.DownloadableContributionVersionComparator; import cc.arduino.contributions.libraries.ContributedLibrary; import cc.arduino.contributions.ui.InstallerTableCell; import processing.app.Base; +import processing.app.Theme; public class ContributedLibraryTableCellJPanel extends JPanel { @@ -39,7 +40,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel { final JLabel statusLabel; public ContributedLibraryTableCellJPanel(JTable parentTable, Object value, - boolean isSelected) { + boolean isSelected) { super(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); @@ -217,10 +218,10 @@ public class ContributedLibraryTableCellJPanel extends JPanel { Document doc = description.getDocument(); if (doc instanceof HTMLDocument) { HTMLDocument html = (HTMLDocument) doc; - StyleSheet stylesheet = html.getStyleSheet(); - stylesheet.addRule("body { margin: 0; padding: 0;" - + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" - + "font-size: 100%;" + "font-size: 0.95em; }"); + StyleSheet s = html.getStyleSheet(); + s.addRule("body { margin: 0; padding: 0;" + + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" + + "font-size: " + 10 * Theme.getScale() / 100 + "; }"); } description.setOpaque(false); description.setBorder(new EmptyBorder(4, 7, 7, 7)); diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index 7ed3b4480..75464f3d0 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -57,6 +57,7 @@ import cc.arduino.contributions.packages.ContributedHelp; import cc.arduino.contributions.packages.ContributedPlatform; import cc.arduino.contributions.ui.InstallerTableCell; import processing.app.Base; +import processing.app.Theme; @SuppressWarnings("serial") public class ContributedPlatformTableCellJPanel extends JPanel { @@ -259,10 +260,10 @@ public class ContributedPlatformTableCellJPanel extends JPanel { Document doc = description.getDocument(); if (doc instanceof HTMLDocument) { HTMLDocument html = (HTMLDocument) doc; - StyleSheet stylesheet = html.getStyleSheet(); - stylesheet.addRule("body { margin: 0; padding: 0;" - + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" - + "font-size: 100%;" + "font-size: 0.95em; }"); + StyleSheet s = html.getStyleSheet(); + s.addRule("body { margin: 0; padding: 0;" + + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" + + "font-size: " + 10 * Theme.getScale() / 100 + "; }"); } description.setOpaque(false); description.setBorder(new EmptyBorder(4, 7, 7, 7)); diff --git a/app/src/cc/arduino/contributions/ui/InstallerJDialog.java b/app/src/cc/arduino/contributions/ui/InstallerJDialog.java index 9de0dc136..453f5c133 100644 --- a/app/src/cc/arduino/contributions/ui/InstallerJDialog.java +++ b/app/src/cc/arduino/contributions/ui/InstallerJDialog.java @@ -30,6 +30,7 @@ package cc.arduino.contributions.ui; import static processing.app.I18n.tr; +import static processing.app.Theme.scale; import java.awt.BorderLayout; import java.awt.Color; @@ -227,7 +228,7 @@ public abstract class InstallerJDialog extends JDialog { } setProgressVisible(false, ""); - setMinimumSize(new Dimension(800, 450)); + setMinimumSize(scale(new Dimension(800, 450))); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); diff --git a/app/src/cc/arduino/view/NotificationPopup.form b/app/src/cc/arduino/view/NotificationPopup.form deleted file mode 100644 index 5e6f68cc1..000000000 --- a/app/src/cc/arduino/view/NotificationPopup.form +++ /dev/null @@ -1,89 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/app/src/cc/arduino/view/NotificationPopup.java b/app/src/cc/arduino/view/NotificationPopup.java index 947047da7..f5dfc717e 100644 --- a/app/src/cc/arduino/view/NotificationPopup.java +++ b/app/src/cc/arduino/view/NotificationPopup.java @@ -29,26 +29,80 @@ package cc.arduino.view; -import processing.app.Base; -import processing.app.BaseNoGui; +import static processing.app.Theme.scale; -import javax.swing.*; -import javax.swing.event.HyperlinkEvent; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Image; +import java.awt.Point; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.WindowConstants; +import javax.swing.border.LineBorder; import javax.swing.event.HyperlinkListener; -import java.awt.*; -import java.awt.event.*; -import java.nio.file.Paths; + +import processing.app.Theme; public class NotificationPopup extends JDialog { - private final ComponentAdapter parentMovedListener; - - public NotificationPopup(Frame parent, HyperlinkListener hyperlinkListener, String message) { + public NotificationPopup(Frame parent, HyperlinkListener hyperlinkListener, + String message) { super(parent, false); - initComponents(); + setLayout(new FlowLayout()); + setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + setAlwaysOnTop(true); + setUndecorated(true); + setResizable(false); + + Image arduino = Theme.getLibImage("arduino", this, scale(40), scale(40)); + JLabel arduinoIcon = new JLabel(new ImageIcon(arduino)); + add(arduinoIcon); + + JEditorPane text = new JEditorPane(); + text.setBorder(new LineBorder(new Color(0, 0, 0), 0, true)); + text.setContentType("text/html"); // NOI18N + text.setOpaque(false); + text.setEditable(false); + text.setText(" " + message + " "); + text.addHyperlinkListener(hyperlinkListener); + add(text); + + Image close = Theme.getThemeImage("close", this, scale(22), scale(22)); + JButton closeButton = new JButton(new ImageIcon(close)); + closeButton.setBorder(null); + closeButton.setBorderPainted(false); + closeButton.setHideActionText(true); + closeButton.setOpaque(false); + closeButton.setBackground(new Color(0, 0, 0, 0)); + add(closeButton); + + MouseAdapter closeOnClick = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + close(); + } + }; + addMouseListener(closeOnClick); + text.addMouseListener(closeOnClick); + arduinoIcon.addMouseListener(closeOnClick); + closeButton.addMouseListener(closeOnClick); + + pack(); updateLocation(parent); - parentMovedListener = new ComponentAdapter() { + ComponentAdapter parentMovedListener = new ComponentAdapter() { @Override public void componentMoved(ComponentEvent e) { updateLocation(parent); @@ -60,35 +114,12 @@ public class NotificationPopup extends JDialog { } }; parent.addComponentListener(parentMovedListener); - - text.setText("" + message + ""); - - text.addHyperlinkListener(hyperlinkListener); - text.addHyperlinkListener(e -> { - if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) { - return; - } - close(); - }); - addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { parent.removeComponentListener(parentMovedListener); } }); - - Base.registerWindowCloseKeys(getRootPane(), e -> close()); - - MouseAdapter closeOnClick = new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - close(); - } - }; - addMouseListener(closeOnClick); - text.addMouseListener(closeOnClick); - icon.addMouseListener(closeOnClick); } private void updateLocation(Frame parent) { @@ -100,87 +131,6 @@ public class NotificationPopup extends JDialog { } public void close() { - dispatchEvent(new WindowEvent(NotificationPopup.this, WindowEvent.WINDOW_CLOSING)); + dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - icon = new javax.swing.JLabel(); - text = new javax.swing.JEditorPane(); - closeButton = new javax.swing.JButton(); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setAlwaysOnTop(true); - setFocusable(false); - setFocusableWindowState(false); - setUndecorated(true); - setPreferredSize(new java.awt.Dimension(350, 70)); - setResizable(false); - setSize(new java.awt.Dimension(350, 70)); - getContentPane().setLayout(null); - - icon.setIcon(new ImageIcon(Paths.get(BaseNoGui.getContentFile("lib").getAbsolutePath(), "arduino_small.png").toFile().getAbsolutePath())); - getContentPane().add(icon); - icon.setBounds(10, 10, 50, 50); - - text.setEditable(false); - text.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 0, true)); - text.setContentType("text/html"); // NOI18N - text.setOpaque(false); - getContentPane().add(text); - text.setBounds(70, 10, 270, 50); - - closeButton.setIcon(new ImageIcon(Paths.get(BaseNoGui.getContentFile("lib").getAbsolutePath(), "theme", "close.png").toFile().getAbsolutePath())); - closeButton.setBorder(null); - closeButton.setBorderPainted(false); - closeButton.setHideActionText(true); - closeButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - closeButtonActionPerformed(evt); - } - }); - getContentPane().add(closeButton); - closeButton.setBounds(328, 0, 22, 22); - - pack(); - }// //GEN-END:initComponents - - private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed - close(); - }//GEN-LAST:event_closeButtonActionPerformed - - /** - * @param args the command line arguments - */ - public static void main(String args[]) { - - /* Create and display the dialog */ - EventQueue.invokeLater(new Runnable() { - public void run() { - NotificationPopup dialog = new NotificationPopup(new JFrame(), System.out::println, "test test test test test test test test test\n" + - " test test test test test test test test test test test"); - dialog.addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - dialog.setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton closeButton; - private javax.swing.JLabel icon; - private javax.swing.JEditorPane text; - // End of variables declaration//GEN-END:variables - } diff --git a/app/src/cc/arduino/view/SplashScreenHelper.java b/app/src/cc/arduino/view/SplashScreenHelper.java index a3914495f..0e6779026 100644 --- a/app/src/cc/arduino/view/SplashScreenHelper.java +++ b/app/src/cc/arduino/view/SplashScreenHelper.java @@ -35,6 +35,8 @@ import java.awt.*; import java.awt.geom.Rectangle2D; import java.util.Map; +import processing.app.Theme; + public class SplashScreenHelper { private static final int X_OFFSET = 0; @@ -96,7 +98,7 @@ public class SplashScreenHelper { private void prepareTextAreaAndGraphics() { splashTextArea = new Rectangle2D.Double(X_OFFSET, Y_OFFSET, TEXTAREA_WIDTH, TEXTAREA_HEIGHT); - splashGraphics = splash.createGraphics(); + splashGraphics = Theme.setupGraphics2D(splash.createGraphics()); if (desktopHints != null) { splashGraphics.addRenderingHints(desktopHints); diff --git a/app/src/cc/arduino/view/preferences/Preferences.form b/app/src/cc/arduino/view/preferences/Preferences.form index 2f4a8991f..797e9d57d 100644 --- a/app/src/cc/arduino/view/preferences/Preferences.form +++ b/app/src/cc/arduino/view/preferences/Preferences.form @@ -1,6 +1,6 @@ -
+ @@ -42,7 +42,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,12 +102,26 @@ - + + + + - + + + + + + + + + + + + - + @@ -115,8 +129,8 @@ - - + + @@ -169,12 +183,20 @@ + + + + + + + + - + @@ -342,7 +364,7 @@ - + @@ -460,6 +482,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -596,7 +656,7 @@ - + diff --git a/app/src/cc/arduino/view/preferences/Preferences.java b/app/src/cc/arduino/view/preferences/Preferences.java index 7d9b7cf1c..f833024e9 100644 --- a/app/src/cc/arduino/view/preferences/Preferences.java +++ b/app/src/cc/arduino/view/preferences/Preferences.java @@ -36,6 +36,7 @@ import processing.app.Base; import processing.app.BaseNoGui; import processing.app.I18n; import processing.app.PreferencesData; +import processing.app.Theme; import processing.app.helpers.FileUtils; import processing.app.legacy.PApplet; @@ -102,27 +103,27 @@ public class Preferences extends javax.swing.JDialog { manualProxyTypeButtonGroup = new javax.swing.ButtonGroup(); javax.swing.JPanel jPanel2 = new javax.swing.JPanel(); javax.swing.JTabbedPane jTabbedPane1 = new javax.swing.JTabbedPane(); - javax.swing.JPanel jPanel1 = new javax.swing.JPanel(); - javax.swing.JLabel sketchbookLocationLabel = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); + sketchbookLocationLabel = new javax.swing.JLabel(); sketchbookLocationField = new javax.swing.JTextField(); - javax.swing.JButton browseButton = new javax.swing.JButton(); - javax.swing.JLabel comboLanguageLabel = new javax.swing.JLabel(); + browseButton = new javax.swing.JButton(); + comboLanguageLabel = new javax.swing.JLabel(); comboLanguage = new JComboBox(Languages.languages); - javax.swing.JLabel requiresRestartLabel = new javax.swing.JLabel(); - javax.swing.JLabel fontSizeLabel = new javax.swing.JLabel(); + requiresRestartLabel = new javax.swing.JLabel(); + fontSizeLabel = new javax.swing.JLabel(); fontSizeField = new javax.swing.JTextField(); - javax.swing.JLabel showVerboseLabel = new javax.swing.JLabel(); + showVerboseLabel = new javax.swing.JLabel(); verboseCompilationBox = new javax.swing.JCheckBox(); verboseUploadBox = new javax.swing.JCheckBox(); - javax.swing.JLabel comboWarningsLabel = new javax.swing.JLabel(); + comboWarningsLabel = new javax.swing.JLabel(); comboWarnings = new JComboBox(warningItems); - javax.swing.JLabel additionalBoardsManagerLabel = new javax.swing.JLabel(); + additionalBoardsManagerLabel = new javax.swing.JLabel(); additionalBoardsManagerField = new javax.swing.JTextField(); - javax.swing.JButton extendedAdditionalUrlFieldWindow = new javax.swing.JButton(); - javax.swing.JLabel morePreferencesLabel = new javax.swing.JLabel(); + extendedAdditionalUrlFieldWindow = new javax.swing.JButton(); + morePreferencesLabel = new javax.swing.JLabel(); preferencesFileLabel = new javax.swing.JLabel(); - javax.swing.JLabel arduinoNotRunningLabel = new javax.swing.JLabel(); - javax.swing.JPanel checkboxesContainer = new javax.swing.JPanel(); + arduinoNotRunningLabel = new javax.swing.JLabel(); + checkboxesContainer = new javax.swing.JPanel(); displayLineNumbersBox = new javax.swing.JCheckBox(); enableCodeFoldingBox = new javax.swing.JCheckBox(); verifyUploadBox = new javax.swing.JCheckBox(); @@ -130,6 +131,11 @@ public class Preferences extends javax.swing.JDialog { checkUpdatesBox = new javax.swing.JCheckBox(); updateExtensionBox = new javax.swing.JCheckBox(); saveVerifyUploadBox = new javax.swing.JCheckBox(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + scaleSpinner = new javax.swing.JSpinner(); + autoScaleCheckBox = new javax.swing.JCheckBox(); + jLabel3 = new javax.swing.JLabel(); javax.swing.JPanel jPanel4 = new javax.swing.JPanel(); noProxy = new javax.swing.JRadioButton(); autoProxy = new javax.swing.JRadioButton(); @@ -196,7 +202,7 @@ public class Preferences extends javax.swing.JDialog { additionalBoardsManagerField.setToolTipText(tr("Enter a comma separated list of urls")); - extendedAdditionalUrlFieldWindow.setIcon(new ImageIcon(Base.getThemeImage("newwindow.gif", this))); + extendedAdditionalUrlFieldWindow.setIcon(new ImageIcon(Theme.getThemeImage("newwindow", this, Theme.scale(16), Theme.scale(14)))); extendedAdditionalUrlFieldWindow.setMargin(new java.awt.Insets(1, 1, 1, 1)); extendedAdditionalUrlFieldWindow.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -213,11 +219,9 @@ public class Preferences extends javax.swing.JDialog { public void mousePressed(java.awt.event.MouseEvent evt) { preferencesFileLabelMousePressed(evt); } - public void mouseExited(java.awt.event.MouseEvent evt) { preferencesFileLabelMouseExited(evt); } - public void mouseEntered(java.awt.event.MouseEvent evt) { preferencesFileLabelMouseEntered(evt); } @@ -249,96 +253,134 @@ public class Preferences extends javax.swing.JDialog { saveVerifyUploadBox.setText(tr("Save when verifying or uploading")); checkboxesContainer.add(saveVerifyUploadBox); + jLabel1.setText(tr("Interface scale:")); + + jLabel2.setText(tr(" (requires restart of Arduino)")); + + scaleSpinner.setModel(new javax.swing.SpinnerNumberModel(100, 100, 400, 5)); + scaleSpinner.setEnabled(false); + + autoScaleCheckBox.setSelected(true); + autoScaleCheckBox.setText(tr("Automatic")); + autoScaleCheckBox.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + autoScaleCheckBoxItemStateChanged(evt); + } + }); + + jLabel3.setText("%"); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(sketchbookLocationField) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(browseButton)) - .addComponent(checkboxesContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(comboWarningsLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(comboWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(showVerboseLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(verboseCompilationBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(verboseUploadBox)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(comboLanguageLabel) - .addComponent(fontSizeLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(fontSizeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(comboLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(requiresRestartLabel)))) - .addComponent(arduinoNotRunningLabel) - .addComponent(morePreferencesLabel) - .addComponent(preferencesFileLabel) - .addComponent(sketchbookLocationLabel) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(additionalBoardsManagerLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(extendedAdditionalUrlFieldWindow))) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(sketchbookLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(browseButton)) + .addComponent(checkboxesContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(comboWarningsLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(comboWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(autoScaleCheckBox) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(scaleSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2)))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(showVerboseLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(verboseCompilationBox) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(verboseUploadBox)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(comboLanguageLabel) + .addComponent(fontSizeLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(fontSizeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(comboLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(requiresRestartLabel)))) + .addComponent(arduinoNotRunningLabel) + .addComponent(morePreferencesLabel) + .addComponent(preferencesFileLabel) + .addComponent(sketchbookLocationLabel) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(additionalBoardsManagerLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(extendedAdditionalUrlFieldWindow))) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) ); + + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboLanguageLabel, comboWarningsLabel, fontSizeLabel, jLabel1, showVerboseLabel}); + jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(sketchbookLocationLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(sketchbookLocationLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(sketchbookLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(browseButton)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(comboLanguageLabel) + .addComponent(comboLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(requiresRestartLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(fontSizeLabel) + .addComponent(fontSizeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2) + .addComponent(scaleSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(autoScaleCheckBox) + .addComponent(jLabel3)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(showVerboseLabel) + .addComponent(verboseCompilationBox) + .addComponent(verboseUploadBox)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(comboWarningsLabel) + .addComponent(comboWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(checkboxesContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(sketchbookLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(browseButton)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(comboLanguageLabel) - .addComponent(comboLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(requiresRestartLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(fontSizeLabel) - .addComponent(fontSizeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(showVerboseLabel) - .addComponent(verboseCompilationBox) - .addComponent(verboseUploadBox)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(comboWarningsLabel) - .addComponent(comboWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(checkboxesContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(additionalBoardsManagerLabel) - .addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(extendedAdditionalUrlFieldWindow)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(morePreferencesLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(preferencesFileLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(arduinoNotRunningLabel) - .addContainerGap()) + .addComponent(additionalBoardsManagerLabel) + .addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(extendedAdditionalUrlFieldWindow)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(morePreferencesLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(preferencesFileLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(arduinoNotRunningLabel) + .addContainerGap()) ); jTabbedPane1.addTab(tr("Settings"), jPanel1); @@ -400,96 +442,96 @@ public class Preferences extends javax.swing.JDialog { jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(12, 12, 12) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(autoProxyUsePAC) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(12, 12, 12) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(autoProxyUsernameLabel) - .addComponent(autoProxyPasswordLabel)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(autoProxyPACURL) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(autoProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(autoProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE)))) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(noProxy) - .addComponent(autoProxy) - .addComponent(manualProxy) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(12, 12, 12) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addComponent(manualProxyHTTP) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(manualProxySOCKS)) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(manualProxyHostNameLabel) - .addComponent(manualProxyPortLabel) - .addComponent(manualProxyUsernameLabel) - .addComponent(manualProxyPasswordLabel)) - .addGap(18, 18, 18) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(manualProxyHostName, javax.swing.GroupLayout.PREFERRED_SIZE, 541, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(manualProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(manualProxyPassword, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(manualProxyUsername, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))))))) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(autoProxyUsePAC) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(autoProxyUsernameLabel) + .addComponent(autoProxyPasswordLabel)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(autoProxyPACURL) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(autoProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(autoProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE)))) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(noProxy) + .addComponent(autoProxy) + .addComponent(manualProxy) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addComponent(manualProxyHTTP) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(manualProxySOCKS)) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(manualProxyHostNameLabel) + .addComponent(manualProxyPortLabel) + .addComponent(manualProxyUsernameLabel) + .addComponent(manualProxyPasswordLabel)) + .addGap(18, 18, 18) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(manualProxyHostName, javax.swing.GroupLayout.PREFERRED_SIZE, 541, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(manualProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(manualProxyPassword, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(manualProxyUsername, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))))))) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addContainerGap() - .addComponent(noProxy) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(autoProxy) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(autoProxyUsePAC) - .addComponent(autoProxyPACURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(autoProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(autoProxyUsernameLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(autoProxyPasswordLabel) - .addComponent(autoProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(manualProxy) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(manualProxyHTTP) - .addComponent(manualProxySOCKS)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(manualProxyHostNameLabel) - .addComponent(manualProxyHostName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(manualProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(manualProxyPortLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(manualProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(manualProxyUsernameLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(manualProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(manualProxyPasswordLabel)) - .addContainerGap(163, Short.MAX_VALUE)) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(noProxy) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(autoProxy) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(autoProxyUsePAC) + .addComponent(autoProxyPACURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(autoProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(autoProxyUsernameLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(autoProxyPasswordLabel) + .addComponent(autoProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(manualProxy) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(manualProxyHTTP) + .addComponent(manualProxySOCKS)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(manualProxyHostNameLabel) + .addComponent(manualProxyHostName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(manualProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(manualProxyPortLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(manualProxyUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(manualProxyUsernameLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(manualProxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(manualProxyPasswordLabel)) + .addContainerGap(190, Short.MAX_VALUE)) ); jTabbedPane1.addTab(tr("Network"), jPanel4); @@ -514,21 +556,21 @@ public class Preferences extends javax.swing.JDialog { jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(okButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton) - .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(okButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cancelButton) + .addContainerGap()) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(okButton) - .addComponent(cancelButton)) - .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(okButton) + .addComponent(cancelButton)) + .addContainerGap()) ); jPanel2.add(jPanel3); @@ -537,48 +579,20 @@ public class Preferences extends javax.swing.JDialog { getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 691, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(0, 691, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 610, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(0, 637, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// //GEN-END:initComponents - private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed - File dflt = new File(sketchbookLocationField.getText()); - File file = Base.selectFolder(tr("Select new sketchbook location"), dflt, this); - if (file != null) { - String path = file.getAbsolutePath(); - sketchbookLocationField.setText(path); - } - }//GEN-LAST:event_browseButtonActionPerformed - - private void extendedAdditionalUrlFieldWindowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extendedAdditionalUrlFieldWindowActionPerformed - final AdditionalBoardsManagerURLTextArea additionalBoardsManagerURLTextArea = new AdditionalBoardsManagerURLTextArea(this); - additionalBoardsManagerURLTextArea.setText(additionalBoardsManagerField.getText()); - additionalBoardsManagerURLTextArea.onOk(e -> additionalBoardsManagerField.setText(additionalBoardsManagerURLTextArea.getText())); - additionalBoardsManagerURLTextArea.setVisible(true); - }//GEN-LAST:event_extendedAdditionalUrlFieldWindowActionPerformed - - private void preferencesFileLabelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMouseEntered - preferencesFileLabel.setForeground(new Color(0, 0, 140)); - }//GEN-LAST:event_preferencesFileLabelMouseEntered - - private void preferencesFileLabelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMousePressed - Base.openFolder(PreferencesData.getPreferencesFile().getParentFile()); - }//GEN-LAST:event_preferencesFileLabelMousePressed - - private void preferencesFileLabelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMouseExited - preferencesFileLabel.setForeground(new Color(76, 76, 76)); - }//GEN-LAST:event_preferencesFileLabelMouseExited - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); }//GEN-LAST:event_cancelButtonActionPerformed @@ -609,8 +623,42 @@ public class Preferences extends javax.swing.JDialog { autoProxyPACFieldsSetEnabled(autoProxyUsePAC.isSelected()); }//GEN-LAST:event_autoProxyUsePACItemStateChanged + private void preferencesFileLabelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMouseEntered + preferencesFileLabel.setForeground(new Color(0, 0, 140)); + }//GEN-LAST:event_preferencesFileLabelMouseEntered + + private void preferencesFileLabelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMouseExited + preferencesFileLabel.setForeground(new Color(76, 76, 76)); + }//GEN-LAST:event_preferencesFileLabelMouseExited + + private void preferencesFileLabelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_preferencesFileLabelMousePressed + Base.openFolder(PreferencesData.getPreferencesFile().getParentFile()); + }//GEN-LAST:event_preferencesFileLabelMousePressed + + private void extendedAdditionalUrlFieldWindowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extendedAdditionalUrlFieldWindowActionPerformed + final AdditionalBoardsManagerURLTextArea additionalBoardsManagerURLTextArea = new AdditionalBoardsManagerURLTextArea(this); + additionalBoardsManagerURLTextArea.setText(additionalBoardsManagerField.getText()); + additionalBoardsManagerURLTextArea.onOk(e -> additionalBoardsManagerField.setText(additionalBoardsManagerURLTextArea.getText())); + additionalBoardsManagerURLTextArea.setVisible(true); + }//GEN-LAST:event_extendedAdditionalUrlFieldWindowActionPerformed + + private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed + File dflt = new File(sketchbookLocationField.getText()); + File file = Base.selectFolder(tr("Select new sketchbook location"), dflt, this); + if (file != null) { + String path = file.getAbsolutePath(); + sketchbookLocationField.setText(path); + } + }//GEN-LAST:event_browseButtonActionPerformed + + private void autoScaleCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_autoScaleCheckBoxItemStateChanged + scaleSpinner.setEnabled(!autoScaleCheckBox.isSelected()); + }//GEN-LAST:event_autoScaleCheckBoxItemStateChanged + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField additionalBoardsManagerField; + private javax.swing.JLabel additionalBoardsManagerLabel; + private javax.swing.JLabel arduinoNotRunningLabel; private javax.swing.JRadioButton autoProxy; private javax.swing.JTextField autoProxyPACURL; private javax.swing.JPasswordField autoProxyPassword; @@ -618,13 +666,24 @@ public class Preferences extends javax.swing.JDialog { private javax.swing.JCheckBox autoProxyUsePAC; private javax.swing.JTextField autoProxyUsername; private javax.swing.JLabel autoProxyUsernameLabel; + private javax.swing.JCheckBox autoScaleCheckBox; + private javax.swing.JButton browseButton; private javax.swing.JCheckBox checkUpdatesBox; + private javax.swing.JPanel checkboxesContainer; private javax.swing.JComboBox comboLanguage; + private javax.swing.JLabel comboLanguageLabel; private javax.swing.JComboBox comboWarnings; + private javax.swing.JLabel comboWarningsLabel; private javax.swing.JCheckBox displayLineNumbersBox; private javax.swing.JCheckBox enableCodeFoldingBox; + private javax.swing.JButton extendedAdditionalUrlFieldWindow; private javax.swing.JCheckBox externalEditorBox; private javax.swing.JTextField fontSizeField; + private javax.swing.JLabel fontSizeLabel; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPanel jPanel1; private javax.swing.JRadioButton manualProxy; private javax.swing.JRadioButton manualProxyHTTP; private javax.swing.JTextField manualProxyHostName; @@ -637,11 +696,16 @@ public class Preferences extends javax.swing.JDialog { private javax.swing.ButtonGroup manualProxyTypeButtonGroup; private javax.swing.JTextField manualProxyUsername; private javax.swing.JLabel manualProxyUsernameLabel; + private javax.swing.JLabel morePreferencesLabel; private javax.swing.JRadioButton noProxy; private javax.swing.JLabel preferencesFileLabel; private javax.swing.ButtonGroup proxyTypeButtonGroup; + private javax.swing.JLabel requiresRestartLabel; private javax.swing.JCheckBox saveVerifyUploadBox; + private javax.swing.JSpinner scaleSpinner; + private javax.swing.JLabel showVerboseLabel; private javax.swing.JTextField sketchbookLocationField; + private javax.swing.JLabel sketchbookLocationLabel; private javax.swing.JCheckBox updateExtensionBox; private javax.swing.JCheckBox verboseCompilationBox; private javax.swing.JCheckBox verboseUploadBox; @@ -685,6 +749,12 @@ public class Preferences extends javax.swing.JDialog { System.err.println(I18n.format(tr("ignoring invalid font size {0}"), newSizeText)); } + if (autoScaleCheckBox.isSelected()) { + PreferencesData.set("gui.scale", "auto"); + } else { + PreferencesData.set("gui.scale", scaleSpinner.getValue().toString()); + } + // put each of the settings into the table PreferencesData.setBoolean("build.verbose", verboseCompilationBox.isSelected()); PreferencesData.setBoolean("upload.verbose", verboseUploadBox.isSelected()); @@ -734,6 +804,16 @@ public class Preferences extends javax.swing.JDialog { Font editorFont = PreferencesData.getFont("editor.font"); fontSizeField.setText(String.valueOf(editorFont.getSize())); + try { + int scale = PreferencesData.getInteger("gui.scale", -1); + if (scale != -1) { + autoScaleCheckBox.setSelected(false); + scaleSpinner.setValue(scale); + } + } catch (NumberFormatException ignore) { + // In any case defaults to "auto" + } + verboseCompilationBox.setSelected(PreferencesData.getBoolean("build.verbose")); verboseUploadBox.setSelected(PreferencesData.getBoolean("upload.verbose")); diff --git a/app/src/processing/app/AbstractTextMonitor.java b/app/src/processing/app/AbstractTextMonitor.java index 7caeee195..ab8f30804 100644 --- a/app/src/processing/app/AbstractTextMonitor.java +++ b/app/src/processing/app/AbstractTextMonitor.java @@ -43,7 +43,7 @@ public abstract class AbstractTextMonitor extends AbstractMonitor { protected void onCreateWindow(Container mainPane) { Font consoleFont = Theme.getFont("console.font"); Font editorFont = PreferencesData.getFont("editor.font"); - Font font = new Font(consoleFont.getName(), consoleFont.getStyle(), editorFont.getSize()); + Font font = Theme.scale(new Font(consoleFont.getName(), consoleFont.getStyle(), editorFont.getSize())); mainPane.setLayout(new BorderLayout()); diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 3120bdbda..19936e354 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -36,6 +36,7 @@ import cc.arduino.packages.DiscoveryManager; import cc.arduino.view.Event; import cc.arduino.view.JMenuUtils; import cc.arduino.view.SplashScreenHelper; + import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.lang3.StringUtils; import processing.app.debug.TargetBoard; @@ -157,8 +158,6 @@ public class Base { BaseNoGui.initParameters(args); - System.setProperty("swing.aatext", PreferencesData.get("editor.antialias", "true")); - BaseNoGui.initVersion(); // if (System.getProperty("mrj.version") != null) { @@ -207,6 +206,7 @@ public class Base { // setup the theme coloring fun Theme.init(); + System.setProperty("swing.aatext", PreferencesData.get("editor.antialias", "true")); // Set the look and feel before opening the window try { @@ -1742,18 +1742,17 @@ public class Base { */ @SuppressWarnings("serial") public void handleAbout() { - final Image image = getLibImage("about.png", activeEditor); + final Image image = Theme.getLibImage("about", activeEditor, + Theme.scale(475), Theme.scale(300)); final Window window = new Window(activeEditor) { - public void paint(Graphics g) { + public void paint(Graphics graphics) { + Graphics2D g = Theme.setupGraphics2D(graphics); g.drawImage(image, 0, 0, null); - Graphics2D g2 = (Graphics2D) g; - g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); - - g.setFont(new Font("SansSerif", Font.PLAIN, 11)); + Font f = new Font("SansSerif", Font.PLAIN, Theme.scale(11)); + g.setFont(f); g.setColor(Color.white); - g.drawString(BaseNoGui.VERSION_NAME_LONG, 33, 20); + g.drawString(BaseNoGui.VERSION_NAME_LONG, Theme.scale(33), Theme.scale(20)); } }; window.addMouseListener(new MouseAdapter() { @@ -2035,32 +2034,6 @@ public class Base { } - /** - * Get an image associated with the current color theme. - */ - static public Image getThemeImage(String name, Component who) { - return getLibImage("theme/" + name, who); - } - - - /** - * Return an Image object from inside the Processing lib folder. - */ - static public Image getLibImage(String name, Component who) { - Toolkit tk = Toolkit.getDefaultToolkit(); - - File imageLocation = new File(getContentFile("lib"), name); - Image image = tk.getImage(imageLocation.getAbsolutePath()); - MediaTracker tracker = new MediaTracker(who); - tracker.addImage(image, 0); - try { - tracker.waitForAll(); - } catch (InterruptedException e) { - } - return image; - } - - // ................................................................... diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 2f7b5bfdf..566cabf1c 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -54,6 +54,7 @@ import javax.swing.*; import javax.swing.border.MatteBorder; import javax.swing.event.*; import javax.swing.text.BadLocationException; +import javax.swing.text.Element; import javax.swing.text.PlainDocument; import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; @@ -79,6 +80,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import static processing.app.I18n.tr; +import static processing.app.Theme.scale; /** * Main editor panel for the Processing Development Environment. @@ -304,7 +306,6 @@ public class Editor extends JFrame implements RunnerListener { upper.add(scrollPane); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upper, consolePanel); - splitPane.setOneTouchExpandable(true); // repaint child panes while resizing splitPane.setContinuousLayout(true); // if window increases in size, give all of increase to @@ -321,15 +322,11 @@ public class Editor extends JFrame implements RunnerListener { Keys.killBinding(splitPane, Keys.ctrl(KeyEvent.VK_TAB)); Keys.killBinding(splitPane, Keys.ctrlShift(KeyEvent.VK_TAB)); - // the default size on windows is too small and kinda ugly - int dividerSize = PreferencesData.getInteger("editor.divider.size"); - if (dividerSize != 0) { - splitPane.setDividerSize(dividerSize); - } + splitPane.setDividerSize(scale(splitPane.getDividerSize())); // the following changed from 600, 400 for netbooks // http://code.google.com/p/arduino/issues/detail?id=52 - splitPane.setMinimumSize(new Dimension(600, 100)); + splitPane.setMinimumSize(scale(new Dimension(600, 100))); box.add(splitPane); // hopefully these are no longer needed w/ swing @@ -342,35 +339,23 @@ public class Editor extends JFrame implements RunnerListener { pane.setTransferHandler(new FileDropHandler()); -// System.out.println("t1"); - - // Finish preparing Editor (formerly found in Base) - pack(); - -// System.out.println("t2"); - - // Set the window bounds and the divider location before setting it visible - setPlacement(storedLocation, defaultLocation); - - // Set the minimum size for the editor window - setMinimumSize(new Dimension(PreferencesData.getInteger("editor.window.width.min"), - PreferencesData.getInteger("editor.window.height.min"))); -// System.out.println("t3"); + setMinimumSize(scale(new Dimension( + PreferencesData.getInteger("editor.window.width.min"), + PreferencesData.getInteger("editor.window.height.min")))); // Bring back the general options for the editor applyPreferences(); -// System.out.println("t4"); + // Finish preparing Editor (formerly found in Base) + pack(); + + // Set the window bounds and the divider location before setting it visible + setPlacement(storedLocation, defaultLocation); // Open the document that was passed in boolean loaded = handleOpenInternal(file); if (!loaded) sketch = null; - -// System.out.println("t5"); - - // All set, now show the window - //setVisible(true); } @@ -472,18 +457,6 @@ public class Editor extends JFrame implements RunnerListener { } - /** - * Hack for #@#)$(* Mac OS X 10.2. - *

- * This appears to only be required on OS X 10.2, and is not - * even being called on later versions of OS X or Windows. - */ -// public Dimension getMinimumSize() { -// //System.out.println("getting minimum size"); -// return new Dimension(500, 550); -// } - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -518,10 +491,9 @@ public class Editor extends JFrame implements RunnerListener { } // apply changes to the font size for the editor - //TextAreaPainter painter = textarea.getPainter(); - textarea.setFont(PreferencesData.getFont("editor.font")); - //Font font = painter.getFont(); - //textarea.getPainter().setFont(new Font("Courier", Font.PLAIN, 36)); + Font editorFont = scale(PreferencesData.getFont("editor.font")); + textarea.setFont(editorFont); + scrollPane.getGutter().setLineNumberFont(editorFont); // in case tab expansion stuff has changed // listener.applyPreferences(); @@ -1041,28 +1013,20 @@ public class Editor extends JFrame implements RunnerListener { textArea.setAntiAliasingEnabled(PreferencesData.getBoolean("editor.antialias")); textArea.setTabsEmulated(PreferencesData.getBoolean("editor.tabs.expand")); textArea.setTabSize(PreferencesData.getInteger("editor.tabs.size")); - textArea.addHyperlinkListener(new HyperlinkListener() { - @Override - public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) { - try { - platform.openURL(sketch.getFolder(), hyperlinkEvent.getURL().toExternalForm()); - } catch (Exception e) { - Base.showWarning(e.getMessage(), e.getMessage(), e); - } + textArea.addHyperlinkListener(evt -> { + try { + platform.openURL(sketch.getFolder(), evt.getURL().toExternalForm()); + } catch (Exception e) { + Base.showWarning(e.getMessage(), e.getMessage(), e); } }); - textArea.addCaretListener(new CaretListener() { - - @Override - public void caretUpdate(CaretEvent e) { - int lineStart = textArea.getDocument().getDefaultRootElement().getElementIndex(e.getMark()); - int lineEnd = textArea.getDocument().getDefaultRootElement().getElementIndex(e.getDot()); - - lineStatus.set(lineStart, lineEnd); - } + textArea.addCaretListener(e -> { + Element root = textArea.getDocument().getDefaultRootElement(); + int lineStart = root.getElementIndex(e.getMark()); + int lineEnd = root.getElementIndex(e.getDot()); + lineStatus.set(lineStart, lineEnd); }); - ToolTipManager.sharedInstance().registerComponent(textArea); configurePopupMenu(textArea); diff --git a/app/src/processing/app/EditorConsole.java b/app/src/processing/app/EditorConsole.java index f31a01b00..851f46e8a 100644 --- a/app/src/processing/app/EditorConsole.java +++ b/app/src/processing/app/EditorConsole.java @@ -28,6 +28,8 @@ import javax.swing.text.*; import java.awt.*; import java.io.PrintStream; +import static processing.app.Theme.scale; + /** * Message console that sits below the editing area. */ @@ -70,7 +72,7 @@ public class EditorConsole extends JScrollPane { Font consoleFont = Theme.getFont("console.font"); Font editorFont = PreferencesData.getFont("editor.font"); - Font actualFont = new Font(consoleFont.getName(), consoleFont.getStyle(), editorFont.getSize()); + Font actualFont = new Font(consoleFont.getName(), consoleFont.getStyle(), scale(editorFont.getSize())); SimpleAttributeSet stdOutStyle = new SimpleAttributeSet(); StyleConstants.setForeground(stdOutStyle, Theme.getColor("console.output.color")); @@ -102,8 +104,8 @@ public class EditorConsole extends JScrollPane { int height = metrics.getAscent() + metrics.getDescent(); int lines = PreferencesData.getInteger("console.lines"); int sizeFudge = 6; //10; // unclear why this is necessary, but it is - setPreferredSize(new Dimension(1024, (height * lines) + sizeFudge)); - setMinimumSize(new Dimension(1024, (height * 5) + sizeFudge)); + setPreferredSize(new Dimension(100, (height * lines) + sizeFudge)); + setMinimumSize(new Dimension(100, (height * 5) + sizeFudge)); EditorConsole.init(stdOutStyle, System.out, stdErrStyle, System.err); } diff --git a/app/src/processing/app/EditorHeader.java b/app/src/processing/app/EditorHeader.java index 84dc49df4..37ac14b56 100644 --- a/app/src/processing/app/EditorHeader.java +++ b/app/src/processing/app/EditorHeader.java @@ -35,6 +35,7 @@ import java.io.IOException; import javax.swing.*; +import static processing.app.Theme.scale; /** * Sketch tabs at the top of the editor window. @@ -65,15 +66,20 @@ public class EditorHeader extends JComponent { static final int UNSELECTED = 0; static final int SELECTED = 1; - static final String WHERE[] = { "left", "mid", "right", "menu" }; + static final String WHERE[] = { "left", "mid", "right" }; static final int LEFT = 0; static final int MIDDLE = 1; static final int RIGHT = 2; - static final int MENU = 3; - static final int PIECE_WIDTH = 4; + static final int PIECE_WIDTH = scale(4); + static final int PIECE_HEIGHT = scale(33); + + // value for the size bars, buttons, etc + // TODO: Should be a Theme value? + static final int GRID_SIZE = 33; static Image[][] pieces; + static Image menuButtons[]; Image offscreen; int sizeW, sizeH; @@ -144,11 +150,16 @@ public class EditorHeader extends JComponent { if (pieces == null) { pieces = new Image[STATUS.length][WHERE.length]; + menuButtons = new Image[STATUS.length]; for (int i = 0; i < STATUS.length; i++) { for (int j = 0; j < WHERE.length; j++) { - String path = "tab-" + STATUS[i] + "-" + WHERE[j] + ".gif"; - pieces[i][j] = Base.getThemeImage(path, this); + String path = "tab-" + STATUS[i] + "-" + WHERE[j]; + pieces[i][j] = Theme.getThemeImage(path, this, PIECE_WIDTH, + PIECE_HEIGHT); } + String path = "tab-" + STATUS[i] + "-menu"; + menuButtons[i] = Theme.getThemeImage(path, this, PIECE_HEIGHT, + PIECE_HEIGHT); } } @@ -212,18 +223,13 @@ public class EditorHeader extends JComponent { offscreen = createImage(imageW, imageH); } - Graphics g = offscreen.getGraphics(); + Graphics2D g = Theme.setupGraphics2D(offscreen.getGraphics()); if (font == null) { font = Theme.getFont("header.text.font"); } g.setFont(font); // need to set this each time through metrics = g.getFontMetrics(); fontAscent = metrics.getAscent(); - //} - - //Graphics2D g2 = (Graphics2D) g; - //g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - // RenderingHints.VALUE_TEXT_ANTIALIAS_ON); // set the background for the offscreen g.setColor(backgroundColor); @@ -235,7 +241,7 @@ public class EditorHeader extends JComponent { tabRight = new int[codeCount]; } - int x = 6; // offset from left edge of the component + int x = scale(6); // offset from left edge of the component for (int i = 0; i < sketch.getCodeCount(); i++) { SketchCode code = sketch.getCode(i); @@ -245,9 +251,8 @@ public class EditorHeader extends JComponent { // if modified, add the li'l glyph next to the name String text = " " + codeName + (code.isModified() ? " \u00A7" : " "); - Graphics2D g2 = (Graphics2D) g; int textWidth = (int) - font.getStringBounds(text, g2.getFontRenderContext()).getWidth(); + font.getStringBounds(text, g.getFontRenderContext()).getWidth(); int pieceCount = 2 + (textWidth / PIECE_WIDTH); int pieceWidth = pieceCount * PIECE_WIDTH; @@ -274,10 +279,10 @@ public class EditorHeader extends JComponent { x += PIECE_WIDTH - 1; // overlap by 1 pixel } - menuLeft = sizeW - (16 + pieces[0][MENU].getWidth(this)); + menuLeft = sizeW - (16 + menuButtons[0].getWidth(this)); menuRight = sizeW - 16; // draw the dropdown menu target - g.drawImage(pieces[popup.isVisible() ? SELECTED : UNSELECTED][MENU], + g.drawImage(menuButtons[popup.isVisible() ? SELECTED : UNSELECTED], menuLeft, 0, null); screen.drawImage(offscreen, 0, 0, null); @@ -337,17 +342,17 @@ public class EditorHeader extends JComponent { public Dimension getMinimumSize() { - if (OSUtils.isMacOS()) { - return new Dimension(300, Preferences.GRID_SIZE); - } - return new Dimension(300, Preferences.GRID_SIZE - 1); + Dimension size = scale(new Dimension(300, GRID_SIZE)); + if (OSUtils.isMacOS()) + size.height--; + return size; } public Dimension getMaximumSize() { - if (OSUtils.isMacOS()) { - return new Dimension(3000, Preferences.GRID_SIZE); - } - return new Dimension(3000, Preferences.GRID_SIZE - 1); + Dimension size = scale(new Dimension(3000, GRID_SIZE)); + if (OSUtils.isMacOS()) + size.height--; + return size; } } diff --git a/app/src/processing/app/EditorLineStatus.java b/app/src/processing/app/EditorLineStatus.java index e0ba1c968..b68b74b46 100644 --- a/app/src/processing/app/EditorLineStatus.java +++ b/app/src/processing/app/EditorLineStatus.java @@ -30,35 +30,37 @@ import processing.app.helpers.OSUtils; import processing.app.helpers.PreferencesMap; import static processing.app.I18n.tr; +import static processing.app.Theme.scale; /** * Li'l status bar fella that shows the line number. */ public class EditorLineStatus extends JComponent { + int start = -1, stop; Image resize; + private static final int RESIZE_IMAGE_SIZE = scale(20); Color foreground; Color background; Color messageForeground; Font font; - int high; + int height; String text = ""; String name = ""; String serialport = ""; - public EditorLineStatus() { background = Theme.getColor("linestatus.bgcolor"); font = Theme.getFont("linestatus.font"); foreground = Theme.getColor("linestatus.color"); - high = Theme.getInteger("linestatus.height"); + height = Theme.getInteger("linestatus.height"); if (OSUtils.isMacOS()) { - resize = Base.getThemeImage("resize.gif", this); + resize = Theme.getThemeImage("resize", this, RESIZE_IMAGE_SIZE, RESIZE_IMAGE_SIZE); } //linestatus.bgcolor = #000000 //linestatus.font = SansSerif,plain,10 @@ -87,7 +89,8 @@ public class EditorLineStatus extends JComponent { repaint(); } - public void paintComponent(Graphics g) { + public void paintComponent(Graphics graphics) { + Graphics2D g = Theme.setupGraphics2D(graphics); if (name == "" && serialport == "") { PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences(); if (boardPreferences != null) @@ -102,18 +105,19 @@ public class EditorLineStatus extends JComponent { g.setFont(font); g.setColor(foreground); - int baseline = (high + g.getFontMetrics().getAscent()) / 2; - g.drawString(text, 6, baseline); + int baseline = (size.height + g.getFontMetrics().getAscent()) / 2; + g.drawString(text, scale(6), baseline); g.setColor(messageForeground); String tmp = I18n.format(tr("{0} on {1}"), name, serialport); Rectangle2D bounds = g.getFontMetrics().getStringBounds(tmp, null); - g.drawString(tmp, size.width - (int) bounds.getWidth() -20 , baseline); + g.drawString(tmp, size.width - (int) bounds.getWidth() - RESIZE_IMAGE_SIZE, + baseline); if (OSUtils.isMacOS()) { - g.drawImage(resize, size.width - 20, 0, this); + g.drawImage(resize, size.width - RESIZE_IMAGE_SIZE, 0, this); } } @@ -126,7 +130,7 @@ public class EditorLineStatus extends JComponent { } public Dimension getPreferredSize() { - return new Dimension(300, high); + return scale(new Dimension(300, height)); } public Dimension getMinimumSize() { @@ -134,6 +138,6 @@ public class EditorLineStatus extends JComponent { } public Dimension getMaximumSize() { - return new Dimension(3000, high); + return scale(new Dimension(3000, height)); } } diff --git a/app/src/processing/app/EditorStatus.java b/app/src/processing/app/EditorStatus.java index b6551c7fa..4d5ebbad2 100644 --- a/app/src/processing/app/EditorStatus.java +++ b/app/src/processing/app/EditorStatus.java @@ -33,7 +33,7 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import static processing.app.I18n.tr; - +import static processing.app.Theme.scale; /** * Panel just below the editing area that contains status messages. @@ -67,6 +67,10 @@ public class EditorStatus extends JPanel { FGCOLOR[5] = Theme.getColor("status.notice.fgcolor"); } + // value for the size bars, buttons, etc + // TODO: Should be a Theme value? + static final int GRID_SIZE = 33; + private final Editor editor; private final Font font; @@ -215,15 +219,15 @@ public class EditorStatus extends JPanel { offscreen = createImage(imageW, imageH); } - Graphics graphics = offscreen.getGraphics(); - graphics.setColor(BGCOLOR[mode]); - graphics.fillRect(0, 0, imageW, imageH); - graphics.setColor(FGCOLOR[mode]); + Graphics2D g = Theme.setupGraphics2D(offscreen.getGraphics()); + g.setColor(BGCOLOR[mode]); + g.fillRect(0, 0, imageW, imageH); + g.setColor(FGCOLOR[mode]); - graphics.setFont(font); // needs to be set each time on osx - int ascent = graphics.getFontMetrics().getAscent(); + g.setFont(font); // needs to be set each time on osx + int ascent = g.getFontMetrics().getAscent(); assert message != null; - graphics.drawString(message, Preferences.GUI_SMALL, (sizeH + ascent) / 2); + g.drawString(message, Preferences.GUI_SMALL, (sizeH + ascent) / 2); screen.drawImage(offscreen, 0, 0, null); } @@ -395,11 +399,11 @@ public class EditorStatus extends JPanel { } public Dimension getMinimumSize() { - return new Dimension(300, Preferences.GRID_SIZE); + return scale(new Dimension(300, GRID_SIZE)); } public Dimension getMaximumSize() { - return new Dimension(3000, Preferences.GRID_SIZE); + return scale(new Dimension(3000, GRID_SIZE)); } public boolean isErr() { diff --git a/app/src/processing/app/EditorToolbar.java b/app/src/processing/app/EditorToolbar.java index e433d372c..a6b8bce60 100644 --- a/app/src/processing/app/EditorToolbar.java +++ b/app/src/processing/app/EditorToolbar.java @@ -31,7 +31,7 @@ import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import static processing.app.I18n.tr; - +import static processing.app.Theme.scale; /** * run/stop/etc buttons for the ide @@ -56,19 +56,19 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key /** * Width of each toolbar button. */ - private static final int BUTTON_WIDTH = 27; + private static final int BUTTON_WIDTH = scale(27); /** * Height of each toolbar button. */ - private static final int BUTTON_HEIGHT = 32; + private static final int BUTTON_HEIGHT = scale(32); /** * The amount of space between groups of buttons on the toolbar. */ - private static final int BUTTON_GAP = 5; + private static final int BUTTON_GAP = scale(5); /** * Size of the button image being chopped up. */ - private static final int BUTTON_IMAGE_SIZE = 33; + private static final int BUTTON_IMAGE_SIZE = scale(33); private static final int RUN = 0; @@ -139,16 +139,20 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key } private void loadButtons() { - Image allButtons = Base.getThemeImage("buttons.gif", this); + Image allButtons = Theme.getThemeImage("buttons", this, + BUTTON_IMAGE_SIZE * BUTTON_COUNT, + BUTTON_IMAGE_SIZE * 3); buttonImages = new Image[BUTTON_COUNT][3]; for (int i = 0; i < BUTTON_COUNT; i++) { for (int state = 0; state < 3; state++) { Image image = createImage(BUTTON_WIDTH, BUTTON_HEIGHT); Graphics g = image.getGraphics(); - g.drawImage(allButtons, - -(i * BUTTON_IMAGE_SIZE) - 3, - (-2 + state) * BUTTON_IMAGE_SIZE, null); + g.setColor(bgcolor); + g.fillRect(0, 0, BUTTON_WIDTH, BUTTON_HEIGHT); + int offset = (BUTTON_IMAGE_SIZE - BUTTON_WIDTH) / 2; + g.drawImage(allButtons, -(i * BUTTON_IMAGE_SIZE) - offset, + (-2 + state) * BUTTON_IMAGE_SIZE, null); buttonImages[i][state] = image; } } @@ -193,7 +197,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key x1[SERIAL] = width - BUTTON_WIDTH - 14; x2[SERIAL] = width - 14; } - Graphics g = offscreen.getGraphics(); + Graphics2D g = Theme.setupGraphics2D(offscreen.getGraphics()); g.setColor(bgcolor); //getBackground()); g.fillRect(0, 0, width, height); @@ -437,7 +441,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key public Dimension getMaximumSize() { - return new Dimension(3000, BUTTON_HEIGHT); + return new Dimension(scale(3000), BUTTON_HEIGHT); } diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index d53f5b0d8..9472dda7a 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -69,11 +69,6 @@ public class Preferences { */ static public int BUTTON_HEIGHT = 24; - // value for the size bars, buttons, etc - - static final int GRID_SIZE = 33; - - // indents and spacing standards. these probably need to be modified // per platform as well, since macosx is so huge, windows is smaller, // and linux is all over the map diff --git a/app/src/processing/app/Theme.java b/app/src/processing/app/Theme.java index 893050def..931710342 100644 --- a/app/src/processing/app/Theme.java +++ b/app/src/processing/app/Theme.java @@ -21,19 +21,39 @@ package processing.app; -import processing.app.helpers.OSUtils; -import processing.app.helpers.PreferencesHelper; -import processing.app.helpers.PreferencesMap; +import static processing.app.I18n.tr; -import javax.swing.text.StyleContext; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.MediaTracker; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.SystemColor; +import java.awt.Toolkit; import java.awt.font.TextAttribute; +import java.io.ByteArrayOutputStream; import java.io.File; +import java.net.URL; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; -import static processing.app.I18n.tr; +import javax.swing.text.StyleContext; + +import org.apache.batik.transcoder.Transcoder; +import org.apache.batik.transcoder.TranscoderException; +import org.apache.batik.transcoder.TranscoderInput; +import org.apache.batik.transcoder.TranscoderOutput; +import org.apache.batik.transcoder.image.PNGTranscoder; + +import processing.app.helpers.OSUtils; +import processing.app.helpers.PreferencesHelper; +import processing.app.helpers.PreferencesMap; /** * Storage class for theme settings. This was separated from the Preferences @@ -55,8 +75,9 @@ public class Theme { try { table.load(new File(BaseNoGui.getContentFile("lib"), "theme/theme.txt")); } catch (Exception te) { - Base.showError(null, tr("Could not read color theme settings.\n" + - "You'll need to reinstall Arduino."), te); + Base.showError(null, tr("Could not read color theme settings.\n" + + "You'll need to reinstall Arduino."), + te); } // other things that have to be set explicitly for the defaults @@ -94,6 +115,41 @@ public class Theme { set(key, String.valueOf(value)); } + static public int getScale() { + try { + int scale = PreferencesData.getInteger("gui.scale", -1); + if (scale != -1) + return scale; + } catch (NumberFormatException ignore) { + } + return 100; + } + + static public int scale(int size) { + return size * getScale() / 100; + } + + static public Dimension scale(Dimension dim) { + return new Dimension(scale(dim.width), scale(dim.height)); + } + + static public Font scale(Font font) { + float size = scale(font.getSize()); + // size must be float to call the correct Font.deriveFont(float) + // method that is different from Font.deriveFont(int)! + Font scaled = font.deriveFont(size); + return scaled; + } + + static public Rectangle scale(Rectangle rect) { + Rectangle res = new Rectangle(rect); + res.x = scale(res.x); + res.y = scale(res.y); + res.width = scale(res.width); + res.height = scale(res.height); + return res; + } + static public Color getColorCycleColor(String name, int i) { int cycleSize = getInteger(name + ".size"); name = String.format("%s.%02d", name, i % cycleSize); @@ -122,7 +178,7 @@ public class Theme { set(attr, value); font = PreferencesHelper.getFont(table, attr); } - return font; + return font.deriveFont((float) scale(font.getSize())); } /** @@ -155,7 +211,7 @@ public class Theme { } } - //System.out.println(font.getFamily() + ", " + font.getName()); + // System.out.println(font.getFamily() + ", " + font.getName()); return font; } @@ -169,7 +225,8 @@ public class Theme { boolean italic = style.contains("italic"); boolean underlined = style.contains("underlined"); - Font styledFont = new Font(font.getFamily(), (bold ? Font.BOLD : 0) | (italic ? Font.ITALIC : 0), font.getSize()); + Font styledFont = new Font(font.getFamily(), + (bold ? Font.BOLD : 0) | (italic ? Font.ITALIC : 0), font.getSize()); if (underlined) { Map attr = new Hashtable(); attr.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); @@ -183,4 +240,89 @@ public class Theme { return result; } + /** + * Return an Image object from inside the Processing lib folder. + */ + static public Image getLibImage(String filename, Component who, int width, + int height) { + File libFolder = BaseNoGui.getContentFile("lib"); + Image image = null; + + // Use vector image when available + File vectorFile = new File(libFolder, filename + ".svg"); + if (vectorFile.exists()) { + try { + image = imageFromSVG(vectorFile.toURI().toURL(), width, height); + } catch (Exception e) { + System.err.println("Failed to load " + vectorFile.getAbsolutePath() + + ": " + e.getMessage()); + } + } + + // Otherwise fall-back to PNG bitmaps + if (image == null) { + File bitmapFile = new File(libFolder, filename + ".png"); + File bitmap2xFile = new File(libFolder, filename + "@2x.png"); + + File imageFile; + if ((getScale() > 125 && bitmap2xFile.exists()) || !bitmapFile.exists()) { + imageFile = bitmap2xFile; + } else { + imageFile = bitmapFile; + } + Toolkit tk = Toolkit.getDefaultToolkit(); + image = tk.getImage(imageFile.getAbsolutePath()); + } + + MediaTracker tracker = new MediaTracker(who); + try { + tracker.addImage(image, 0); + tracker.waitForAll(); + } catch (InterruptedException e) { + } + + if (image.getWidth(null) != width || image.getHeight(null) != height) { + image = image.getScaledInstance(width, height, Image.SCALE_SMOOTH); + try { + tracker.addImage(image, 1); + tracker.waitForAll(); + } catch (InterruptedException e) { + } + } + + return image; + } + + /** + * Get an image associated with the current color theme. + */ + static public Image getThemeImage(String name, Component who, int width, + int height) { + return getLibImage("theme/" + name, who, width, height); + } + + private static Image imageFromSVG(URL url, int width, int height) + throws TranscoderException { + Transcoder t = new PNGTranscoder(); + t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width)); + t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height)); + + TranscoderInput input = new TranscoderInput(url.toString()); + ByteArrayOutputStream ostream = new ByteArrayOutputStream(); + TranscoderOutput output = new TranscoderOutput(ostream); + t.transcode(input, output); + + byte[] imgData = ostream.toByteArray(); + return Toolkit.getDefaultToolkit().createImage(imgData); + } + + static public Graphics2D setupGraphics2D(Graphics graphics) { + Graphics2D g = (Graphics2D) graphics; + if (PreferencesData.getBoolean("editor.antialias")) { + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + } + return g; + } + } diff --git a/build/arduino-builder-linux32-1.3.10.tar.bz2.sha b/build/arduino-builder-linux32-1.3.10.tar.bz2.sha deleted file mode 100644 index 7cbcb41e5..000000000 --- a/build/arduino-builder-linux32-1.3.10.tar.bz2.sha +++ /dev/null @@ -1 +0,0 @@ -26377e7ef2fb521c2321a896c3cdece0188dd630 diff --git a/build/arduino-builder-linux32-1.3.11.tar.bz2.sha b/build/arduino-builder-linux32-1.3.11.tar.bz2.sha new file mode 100644 index 000000000..5941333cf --- /dev/null +++ b/build/arduino-builder-linux32-1.3.11.tar.bz2.sha @@ -0,0 +1 @@ +bd7e378b422312d2564cd94f770569607292a9e4 diff --git a/build/arduino-builder-linux64-1.3.10.tar.bz2.sha b/build/arduino-builder-linux64-1.3.10.tar.bz2.sha deleted file mode 100644 index 4ca2be77b..000000000 --- a/build/arduino-builder-linux64-1.3.10.tar.bz2.sha +++ /dev/null @@ -1 +0,0 @@ -c12d4444718f18d52bf12b62d2158b426212d777 diff --git a/build/arduino-builder-linux64-1.3.11.tar.bz2.sha b/build/arduino-builder-linux64-1.3.11.tar.bz2.sha new file mode 100644 index 000000000..88e2cc66d --- /dev/null +++ b/build/arduino-builder-linux64-1.3.11.tar.bz2.sha @@ -0,0 +1 @@ +e48746e807410b4e71ac8bef6d822c7e7ddb0dc2 diff --git a/build/arduino-builder-macosx-1.3.10.tar.bz2.sha b/build/arduino-builder-macosx-1.3.10.tar.bz2.sha deleted file mode 100644 index c9ba19786..000000000 --- a/build/arduino-builder-macosx-1.3.10.tar.bz2.sha +++ /dev/null @@ -1 +0,0 @@ -c164df8696423a72fdceef75e70d73f0b9aaa8ec diff --git a/build/arduino-builder-macosx-1.3.11.tar.bz2.sha b/build/arduino-builder-macosx-1.3.11.tar.bz2.sha new file mode 100644 index 000000000..7049aec6b --- /dev/null +++ b/build/arduino-builder-macosx-1.3.11.tar.bz2.sha @@ -0,0 +1 @@ +4f0db525df3e391c818cad56221d428cfc626682 diff --git a/build/arduino-builder-windows-1.3.10.zip.sha b/build/arduino-builder-windows-1.3.10.zip.sha deleted file mode 100644 index 08a2b216c..000000000 --- a/build/arduino-builder-windows-1.3.10.zip.sha +++ /dev/null @@ -1 +0,0 @@ -c52b8da5ee46c5f50d8d53781faed9834173c824 diff --git a/build/arduino-builder-windows-1.3.11.zip.sha b/build/arduino-builder-windows-1.3.11.zip.sha new file mode 100644 index 000000000..1e5d53534 --- /dev/null +++ b/build/arduino-builder-windows-1.3.11.zip.sha @@ -0,0 +1 @@ +5b2e4b95adbf4262ee20b1ec9c263c285dd1829c diff --git a/build/build.xml b/build/build.xml index 1764bbf13..15d9d7887 100644 --- a/build/build.xml +++ b/build/build.xml @@ -73,7 +73,7 @@ - + @@ -885,7 +885,7 @@ - + diff --git a/build/shared/lib/about@2x.png b/build/shared/lib/about@2x.png new file mode 100644 index 000000000..017d08153 Binary files /dev/null and b/build/shared/lib/about@2x.png differ diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index bef6fbaf4..26ac20ddb 100644 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -71,6 +71,11 @@ platform.auto_file_type_associations = true # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# GUI - Scaling, edit this to scale to higher dots-per-inch displays +# "auto" means autodetect. +gui.scale=auto +#gui.scale=200 + # default size for the main window editor.window.width.default = 500 editor.window.height.default = 600 diff --git a/build/shared/lib/theme/buttons.gif b/build/shared/lib/theme/buttons.gif deleted file mode 100644 index 4de0905d2..000000000 Binary files a/build/shared/lib/theme/buttons.gif and /dev/null differ diff --git a/build/shared/lib/theme/buttons.png b/build/shared/lib/theme/buttons.png new file mode 100644 index 000000000..cbd4c0148 Binary files /dev/null and b/build/shared/lib/theme/buttons.png differ diff --git a/build/shared/lib/theme/buttons.svg b/build/shared/lib/theme/buttons.svg new file mode 100644 index 000000000..347eba06d --- /dev/null +++ b/build/shared/lib/theme/buttons.svg @@ -0,0 +1,869 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/buttons@2x.png b/build/shared/lib/theme/buttons@2x.png new file mode 100644 index 000000000..9f38fe96d Binary files /dev/null and b/build/shared/lib/theme/buttons@2x.png differ diff --git a/build/shared/lib/theme/close.svg b/build/shared/lib/theme/close.svg new file mode 100755 index 000000000..2d01d66a8 --- /dev/null +++ b/build/shared/lib/theme/close.svg @@ -0,0 +1,76 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/build/shared/lib/theme/close@2x.png b/build/shared/lib/theme/close@2x.png new file mode 100644 index 000000000..8041c8bde Binary files /dev/null and b/build/shared/lib/theme/close@2x.png differ diff --git a/build/shared/lib/theme/lock.svg b/build/shared/lib/theme/lock.svg new file mode 100644 index 000000000..28efcfbdc --- /dev/null +++ b/build/shared/lib/theme/lock.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/build/shared/lib/theme/lock@2x.png b/build/shared/lib/theme/lock@2x.png new file mode 100644 index 000000000..76f3f7f03 Binary files /dev/null and b/build/shared/lib/theme/lock@2x.png differ diff --git a/build/shared/lib/theme/newwindow.gif b/build/shared/lib/theme/newwindow.gif deleted file mode 100644 index 1cf77a620..000000000 Binary files a/build/shared/lib/theme/newwindow.gif and /dev/null differ diff --git a/build/shared/lib/theme/newwindow.png b/build/shared/lib/theme/newwindow.png new file mode 100644 index 000000000..d6e8f8593 Binary files /dev/null and b/build/shared/lib/theme/newwindow.png differ diff --git a/build/shared/lib/theme/newwindow.svg b/build/shared/lib/theme/newwindow.svg new file mode 100644 index 000000000..c1a8748b4 --- /dev/null +++ b/build/shared/lib/theme/newwindow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/build/shared/lib/theme/newwindow@2x.png b/build/shared/lib/theme/newwindow@2x.png new file mode 100644 index 000000000..0e08b4c98 Binary files /dev/null and b/build/shared/lib/theme/newwindow@2x.png differ diff --git a/build/shared/lib/theme/resize.gif b/build/shared/lib/theme/resize.gif deleted file mode 100644 index ed31c0ad8..000000000 Binary files a/build/shared/lib/theme/resize.gif and /dev/null differ diff --git a/build/shared/lib/theme/resize.png b/build/shared/lib/theme/resize.png new file mode 100644 index 000000000..d550abda4 Binary files /dev/null and b/build/shared/lib/theme/resize.png differ diff --git a/build/shared/lib/theme/resize.svg b/build/shared/lib/theme/resize.svg new file mode 100644 index 000000000..290e2b33d --- /dev/null +++ b/build/shared/lib/theme/resize.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/shared/lib/theme/resize@2x.png b/build/shared/lib/theme/resize@2x.png new file mode 100644 index 000000000..b29c3f5bb Binary files /dev/null and b/build/shared/lib/theme/resize@2x.png differ diff --git a/build/shared/lib/theme/tab-sel-left.gif b/build/shared/lib/theme/tab-sel-left.gif deleted file mode 100644 index 252ebcc6d..000000000 Binary files a/build/shared/lib/theme/tab-sel-left.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-sel-left.png b/build/shared/lib/theme/tab-sel-left.png new file mode 100644 index 000000000..0f93dc7c5 Binary files /dev/null and b/build/shared/lib/theme/tab-sel-left.png differ diff --git a/build/shared/lib/theme/tab-sel-left.svg b/build/shared/lib/theme/tab-sel-left.svg new file mode 100644 index 000000000..12aed209b --- /dev/null +++ b/build/shared/lib/theme/tab-sel-left.svg @@ -0,0 +1,57 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-sel-left@2x.png b/build/shared/lib/theme/tab-sel-left@2x.png new file mode 100644 index 000000000..1e0c3b652 Binary files /dev/null and b/build/shared/lib/theme/tab-sel-left@2x.png differ diff --git a/build/shared/lib/theme/tab-sel-menu.gif b/build/shared/lib/theme/tab-sel-menu.gif deleted file mode 100644 index 3b213f4a7..000000000 Binary files a/build/shared/lib/theme/tab-sel-menu.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-sel-menu.png b/build/shared/lib/theme/tab-sel-menu.png new file mode 100644 index 000000000..ca3548e88 Binary files /dev/null and b/build/shared/lib/theme/tab-sel-menu.png differ diff --git a/build/shared/lib/theme/tab-sel-menu.svg b/build/shared/lib/theme/tab-sel-menu.svg new file mode 100644 index 000000000..a3d5dd5d5 --- /dev/null +++ b/build/shared/lib/theme/tab-sel-menu.svg @@ -0,0 +1,54 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-sel-menu@2x.png b/build/shared/lib/theme/tab-sel-menu@2x.png new file mode 100644 index 000000000..dc19ce636 Binary files /dev/null and b/build/shared/lib/theme/tab-sel-menu@2x.png differ diff --git a/build/shared/lib/theme/tab-sel-mid.gif b/build/shared/lib/theme/tab-sel-mid.gif deleted file mode 100644 index 4bd19a0c3..000000000 Binary files a/build/shared/lib/theme/tab-sel-mid.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-sel-mid.png b/build/shared/lib/theme/tab-sel-mid.png new file mode 100644 index 000000000..52422f1bc Binary files /dev/null and b/build/shared/lib/theme/tab-sel-mid.png differ diff --git a/build/shared/lib/theme/tab-sel-mid.svg b/build/shared/lib/theme/tab-sel-mid.svg new file mode 100644 index 000000000..f8f32ad52 --- /dev/null +++ b/build/shared/lib/theme/tab-sel-mid.svg @@ -0,0 +1,53 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-sel-mid@2x.png b/build/shared/lib/theme/tab-sel-mid@2x.png new file mode 100644 index 000000000..77fe7cb96 Binary files /dev/null and b/build/shared/lib/theme/tab-sel-mid@2x.png differ diff --git a/build/shared/lib/theme/tab-sel-right.gif b/build/shared/lib/theme/tab-sel-right.gif deleted file mode 100644 index 4ceb3ed80..000000000 Binary files a/build/shared/lib/theme/tab-sel-right.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-sel-right.png b/build/shared/lib/theme/tab-sel-right.png new file mode 100644 index 000000000..cde6f944d Binary files /dev/null and b/build/shared/lib/theme/tab-sel-right.png differ diff --git a/build/shared/lib/theme/tab-sel-right.svg b/build/shared/lib/theme/tab-sel-right.svg new file mode 100644 index 000000000..229326faa --- /dev/null +++ b/build/shared/lib/theme/tab-sel-right.svg @@ -0,0 +1,59 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-sel-right@2x.png b/build/shared/lib/theme/tab-sel-right@2x.png new file mode 100644 index 000000000..6e431914a Binary files /dev/null and b/build/shared/lib/theme/tab-sel-right@2x.png differ diff --git a/build/shared/lib/theme/tab-unsel-left.gif b/build/shared/lib/theme/tab-unsel-left.gif deleted file mode 100644 index cdc98861f..000000000 Binary files a/build/shared/lib/theme/tab-unsel-left.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-unsel-left.png b/build/shared/lib/theme/tab-unsel-left.png new file mode 100644 index 000000000..2a1037a6b Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-left.png differ diff --git a/build/shared/lib/theme/tab-unsel-left.svg b/build/shared/lib/theme/tab-unsel-left.svg new file mode 100644 index 000000000..7058128d0 --- /dev/null +++ b/build/shared/lib/theme/tab-unsel-left.svg @@ -0,0 +1,55 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-unsel-left@2x.png b/build/shared/lib/theme/tab-unsel-left@2x.png new file mode 100644 index 000000000..d35565df8 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-left@2x.png differ diff --git a/build/shared/lib/theme/tab-unsel-menu.gif b/build/shared/lib/theme/tab-unsel-menu.gif deleted file mode 100644 index 3c9177118..000000000 Binary files a/build/shared/lib/theme/tab-unsel-menu.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-unsel-menu.png b/build/shared/lib/theme/tab-unsel-menu.png new file mode 100644 index 000000000..5deadb6a9 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-menu.png differ diff --git a/build/shared/lib/theme/tab-unsel-menu.svg b/build/shared/lib/theme/tab-unsel-menu.svg new file mode 100644 index 000000000..cf3048ed3 --- /dev/null +++ b/build/shared/lib/theme/tab-unsel-menu.svg @@ -0,0 +1,54 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-unsel-menu@2x.png b/build/shared/lib/theme/tab-unsel-menu@2x.png new file mode 100644 index 000000000..db3ed4bd7 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-menu@2x.png differ diff --git a/build/shared/lib/theme/tab-unsel-mid.gif b/build/shared/lib/theme/tab-unsel-mid.gif deleted file mode 100644 index c538ad2fe..000000000 Binary files a/build/shared/lib/theme/tab-unsel-mid.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-unsel-mid.png b/build/shared/lib/theme/tab-unsel-mid.png new file mode 100644 index 000000000..ed8a04669 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-mid.png differ diff --git a/build/shared/lib/theme/tab-unsel-mid.svg b/build/shared/lib/theme/tab-unsel-mid.svg new file mode 100644 index 000000000..b1a33685c --- /dev/null +++ b/build/shared/lib/theme/tab-unsel-mid.svg @@ -0,0 +1,51 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-unsel-mid@2x.png b/build/shared/lib/theme/tab-unsel-mid@2x.png new file mode 100644 index 000000000..cd943e64c Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-mid@2x.png differ diff --git a/build/shared/lib/theme/tab-unsel-right.gif b/build/shared/lib/theme/tab-unsel-right.gif deleted file mode 100644 index 3150eb5ea..000000000 Binary files a/build/shared/lib/theme/tab-unsel-right.gif and /dev/null differ diff --git a/build/shared/lib/theme/tab-unsel-right.png b/build/shared/lib/theme/tab-unsel-right.png new file mode 100644 index 000000000..593488de5 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-right.png differ diff --git a/build/shared/lib/theme/tab-unsel-right.svg b/build/shared/lib/theme/tab-unsel-right.svg new file mode 100644 index 000000000..ef08d48a0 --- /dev/null +++ b/build/shared/lib/theme/tab-unsel-right.svg @@ -0,0 +1,55 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/build/shared/lib/theme/tab-unsel-right@2x.png b/build/shared/lib/theme/tab-unsel-right@2x.png new file mode 100644 index 000000000..750754de3 Binary files /dev/null and b/build/shared/lib/theme/tab-unsel-right@2x.png differ diff --git a/build/shared/lib/theme/theme.txt b/build/shared/lib/theme/theme.txt index 67ac3d33b..678926b0f 100644 --- a/build/shared/lib/theme/theme.txt +++ b/build/shared/lib/theme/theme.txt @@ -7,7 +7,6 @@ #COMMENTS // COLOR #95A5A6 - LIGHT GREY #COMMENTS /**/ COLOR #434F54 - DARK GREY - # GUI - STATUS status.notice.fgcolor = #002325 status.notice.bgcolor = #17A1A5 diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index b2b110431..14436e9c4 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,6 +1,10 @@ ARDUINO 1.6.8 [ide] +* Added support for GUI interface scaling for UHD monitors. + Thanks to all contributors and testers: + https://github.com/arduino/Arduino/pull/4376 + https://github.com/arduino/Arduino/pull/2776 * Editor position is saved when closing with Alt+F4 or clicking on the "X" button. Thanks @willie68 * Fixed a NullPointerException when dealing with some rare combination of package_*.json files * Fixed incorrect key bindings handling for changing tab. Thanks @matthijskooijman diff --git a/build/windows/launcher/config.xml b/build/windows/launcher/config.xml index 9a9796a6c..0bfadc663 100644 --- a/build/windows/launcher/config.xml +++ b/build/windows/launcher/config.xml @@ -9,6 +9,24 @@ processing.app.Base %EXEDIR%/lib/apple.jar %EXEDIR%/lib/arduino-core.jar + %EXEDIR%/lib/batik-1.8.jar + %EXEDIR%/lib/batik-anim-1.8.jar + %EXEDIR%/lib/batik-awt-util-1.8.jar + %EXEDIR%/lib/batik-bridge-1.8.jar + %EXEDIR%/lib/batik-codec-1.8.jar + %EXEDIR%/lib/batik-css-1.8.jar + %EXEDIR%/lib/batik-dom-1.8.jar + %EXEDIR%/lib/batik-ext-1.8.jar + %EXEDIR%/lib/batik-gvt-1.8.jar + %EXEDIR%/lib/batik-parser-1.8.jar + %EXEDIR%/lib/batik-rasterizer-1.8.jar + %EXEDIR%/lib/batik-script-1.8.jar + %EXEDIR%/lib/batik-squiggle-1.8.jar + %EXEDIR%/lib/batik-svg-dom-1.8.jar + %EXEDIR%/lib/batik-svgpp-1.8.jar + %EXEDIR%/lib/batik-transcoder-1.8.jar + %EXEDIR%/lib/batik-util-1.8.jar + %EXEDIR%/lib/batik-xml-1.8.jar %EXEDIR%/lib/bcpg-jdk15on-152.jar %EXEDIR%/lib/bcprov-jdk15on-152.jar %EXEDIR%/lib/commons-codec-1.7.jar @@ -30,6 +48,9 @@ %EXEDIR%/lib/jssc-2.8.0.jar %EXEDIR%/lib/pde.jar %EXEDIR%/lib/rsyntaxtextarea-2.5.8.1+arduino.jar + %EXEDIR%/lib/xml-apis-1.3.04.jar + %EXEDIR%/lib/xml-apis-ext-1.3.04.jar + %EXEDIR%/lib/xmlgraphics-commons-2.0.jar java @@ -38,9 +59,6 @@ -Dsun.java2d.d3d=false -DAPP_DIR="%EXEDIR%" - - lib/splash.bmp - Arduino IDE Arduino LLC diff --git a/build/windows/launcher/config_debug.xml b/build/windows/launcher/config_debug.xml index 8d4b656a1..708ef610f 100644 --- a/build/windows/launcher/config_debug.xml +++ b/build/windows/launcher/config_debug.xml @@ -9,6 +9,24 @@ processing.app.Base %EXEDIR%/lib/apple.jar %EXEDIR%/lib/arduino-core.jar + %EXEDIR%/lib/batik-1.8.jar + %EXEDIR%/lib/batik-anim-1.8.jar + %EXEDIR%/lib/batik-awt-util-1.8.jar + %EXEDIR%/lib/batik-bridge-1.8.jar + %EXEDIR%/lib/batik-codec-1.8.jar + %EXEDIR%/lib/batik-css-1.8.jar + %EXEDIR%/lib/batik-dom-1.8.jar + %EXEDIR%/lib/batik-ext-1.8.jar + %EXEDIR%/lib/batik-gvt-1.8.jar + %EXEDIR%/lib/batik-parser-1.8.jar + %EXEDIR%/lib/batik-rasterizer-1.8.jar + %EXEDIR%/lib/batik-script-1.8.jar + %EXEDIR%/lib/batik-squiggle-1.8.jar + %EXEDIR%/lib/batik-svg-dom-1.8.jar + %EXEDIR%/lib/batik-svgpp-1.8.jar + %EXEDIR%/lib/batik-transcoder-1.8.jar + %EXEDIR%/lib/batik-util-1.8.jar + %EXEDIR%/lib/batik-xml-1.8.jar %EXEDIR%/lib/bcpg-jdk15on-152.jar %EXEDIR%/lib/bcprov-jdk15on-152.jar %EXEDIR%/lib/commons-codec-1.7.jar @@ -30,6 +48,9 @@ %EXEDIR%/lib/jssc-2.8.0.jar %EXEDIR%/lib/pde.jar %EXEDIR%/lib/rsyntaxtextarea-2.5.8.1+arduino.jar + %EXEDIR%/lib/xml-apis-1.3.04.jar + %EXEDIR%/lib/xml-apis-ext-1.3.04.jar + %EXEDIR%/lib/xmlgraphics-commons-2.0.jar java