diff --git a/diylc/diylc-core/src/org/diylc/presenter/update.xml b/diylc/diylc-core/src/org/diylc/presenter/update.xml index 0fddd55a..d9fe16d7 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/update.xml +++ b/diylc/diylc-core/src/org/diylc/presenter/update.xml @@ -3517,5 +3517,21 @@ https://github.com/bancika/diy-layout-creator/releases + + + 4 + 17 + 0 + + 2021-01-17 00:00:00.000 CET + + + + IMPROVEMENT + Slightly fancier splash screen :) + + + https://github.com/bancika/diy-layout-creator/releases + - + diff --git a/diylc/diylc-library/lib/diylc-core.jar b/diylc/diylc-library/lib/diylc-core.jar index 8e385104..ab3620ba 100644 Binary files a/diylc/diylc-library/lib/diylc-core.jar and b/diylc/diylc-library/lib/diylc-core.jar differ diff --git a/diylc/diylc-swing/lib/diylc-core.jar b/diylc/diylc-swing/lib/diylc-core.jar index 8e385104..ab3620ba 100644 Binary files a/diylc/diylc-swing/lib/diylc-core.jar and b/diylc/diylc-swing/lib/diylc-core.jar differ diff --git a/diylc/diylc-swing/library/main.jar b/diylc/diylc-swing/library/main.jar index 1b31ed4d..4e220c76 100644 Binary files a/diylc/diylc-swing/library/main.jar and b/diylc/diylc-swing/library/main.jar differ diff --git a/diylc/diylc-swing/src/org/diylc/DIYLCSplash.java b/diylc/diylc-swing/src/org/diylc/DIYLCSplash.java index f618115e..83719163 100644 --- a/diylc/diylc-swing/src/org/diylc/DIYLCSplash.java +++ b/diylc/diylc-swing/src/org/diylc/DIYLCSplash.java @@ -5,6 +5,7 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; +import java.awt.geom.AffineTransform; import javax.swing.ImageIcon; import javax.swing.JDialog; @@ -22,8 +23,9 @@ public class DIYLCSplash extends JDialog { private static final long serialVersionUID = 1L; private Thread t; - - private int frameNumber = 90; + + private int TOTAL_FRAMES = 90; + private int frameNumber = TOTAL_FRAMES; private Point resistorTarget = new Point(112, 114); private Point filmTarget = new Point(233, 113); @@ -46,7 +48,7 @@ public class DIYLCSplash extends JDialog { @Override public void run() { - for (int i = 90; i >= 0; i--) { + for (int i = TOTAL_FRAMES; i >= 0; i--) { if (!isVisible()) return; frameNumber = i; @@ -77,6 +79,13 @@ public class DIYLCSplash extends JDialog { getFilm().paintIcon(null, g, filmTarget.x, filmTarget.y + pxPerFrame * frameNumber); getElectrolytic().paintIcon(null, g, electrolyticTarget.x, electrolyticTarget.y - pxPerFrame * frameNumber); getCeramic().paintIcon(null, g, ceramicTarget.x + pxPerFrame * frameNumber, ceramicTarget.y); + + int splashX = 90; + int splashY = 52; + double theta = 2 * Math.PI * frameNumber / TOTAL_FRAMES; + g2d.translate(splashX, splashY); + g2d.transform(AffineTransform.getRotateInstance(theta)); + getIc().paintIcon(null, g, -getIc().getIconWidth() / 2, -getIc().getIconHeight() / 2); } public void start() { @@ -120,6 +129,15 @@ public class DIYLCSplash extends JDialog { return electrolytic; } + private ImageIcon ic = null; + + private ImageIcon getIc() { + if (ic == null) { + ic = (ImageIcon) IconLoader.SplashIC.getIcon(); + } + return ic; + } + private ImageIcon splash = null; private ImageIcon getSplash() { diff --git a/diylc/diylc-swing/src/org/diylc/swing/images/IconLoader.java b/diylc/diylc-swing/src/org/diylc/swing/images/IconLoader.java index 17dd9b39..3d4a63a5 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/images/IconLoader.java +++ b/diylc/diylc-swing/src/org/diylc/swing/images/IconLoader.java @@ -1,32 +1,32 @@ -/* - - DIY Layout Creator (DIYLC). - Copyright (c) 2009-2018 held jointly by the individual authors. - - This file is part of DIYLC. - - DIYLC is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - DIYLC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DIYLC. If not, see . - -*/ +/* + + DIY Layout Creator (DIYLC). + Copyright (c) 2009-2018 held jointly by the individual authors. + + This file is part of DIYLC. + + DIYLC is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DIYLC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DIYLC. If not, see . + +*/ package org.diylc.swing.images; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.io.IOException; - -import javax.imageio.ImageIO; -import javax.swing.Icon; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.IOException; + +import javax.imageio.ImageIO; +import javax.swing.Icon; import javax.swing.ImageIcon; /** @@ -62,13 +62,13 @@ public enum IconLoader { "pin_green.png"), CoffeebeanEdit("coffeebean_edit.png"), ApplicationEdit("application_edit.png"), ComponentAdd( "component_add.png"), History("history.png"), DocumentPlain("document_plain.png"), FitToSize("fit_to_size.png"), DocumentsGear( "documents_gear.png"), SplashResistor("splash_resistor.png"), SplashCeramic("splash_ceramic.png"), SplashElectrolytic( - "splash_electrolytic.png"), SplashFilm("splash_film.png"), Splash("splash.png"), Help("help2.png"), ScrollInformation("scroll_information.png"), - Node("node.png"), Web("web.png"), Guitar("guitar.png"), Scientist("scientist.png"), StarGrey("star_grey.png"), StarBlue("star_blue.png"), - JarBeanInto("jar_bean_into.png"), GraphEdgeDirected("graph_edge_directed.png"), LaserPointer("laserpointer.png"), TapeMeasure("tape_measure1.png"), - Elements("elements1.png"), GraphNodes("graph_nodes.png"), User("user1.png"), FlexibleLeads("flexible_leads.png"), Pads("pads.png"), Lock("lock.png"), - Unlock("lock_open.png"), Earth("earth.png"), Loadline("loadline.png"), LoadlineAdd("loadline_add.png"), SnapToGrid("snap_to_grid.png"), - SnapToComponents("snap_to_components.png"), SnapToNone("snap_to_none.png"), TraceProximity("trace_proximity.png"), - ComponentLarge("component_large.png"), ImportNetlist("import_netlist.png"); + "splash_electrolytic.png"), SplashFilm("splash_film.png"), Splash("splash.png"), Help("help2.png"), ScrollInformation("scroll_information.png"), + Node("node.png"), Web("web.png"), Guitar("guitar.png"), Scientist("scientist.png"), StarGrey("star_grey.png"), StarBlue("star_blue.png"), + JarBeanInto("jar_bean_into.png"), GraphEdgeDirected("graph_edge_directed.png"), LaserPointer("laserpointer.png"), TapeMeasure("tape_measure1.png"), + Elements("elements1.png"), GraphNodes("graph_nodes.png"), User("user1.png"), FlexibleLeads("flexible_leads.png"), Pads("pads.png"), Lock("lock.png"), + Unlock("lock_open.png"), Earth("earth.png"), Loadline("loadline.png"), LoadlineAdd("loadline_add.png"), SnapToGrid("snap_to_grid.png"), + SnapToComponents("snap_to_components.png"), SnapToNone("snap_to_none.png"), TraceProximity("trace_proximity.png"), + ComponentLarge("component_large.png"), ImportNetlist("import_netlist.png"), SplashIC("splash_ic.png"); protected String name; diff --git a/diylc/diylc-swing/src/org/diylc/swing/images/splash.png b/diylc/diylc-swing/src/org/diylc/swing/images/splash.png index d326e7e1..1f0304dd 100644 Binary files a/diylc/diylc-swing/src/org/diylc/swing/images/splash.png and b/diylc/diylc-swing/src/org/diylc/swing/images/splash.png differ diff --git a/diylc/diylc-swing/src/org/diylc/swing/images/splash_ic.png b/diylc/diylc-swing/src/org/diylc/swing/images/splash_ic.png new file mode 100644 index 00000000..82d74969 Binary files /dev/null and b/diylc/diylc-swing/src/org/diylc/swing/images/splash_ic.png differ