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