mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 02:02:16 +10:00
splash improvement
This commit is contained in:
@@ -3517,5 +3517,21 @@
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
<org.diylc.appframework.update.Version>
|
||||
<versionNumber>
|
||||
<major>4</major>
|
||||
<minor>17</minor>
|
||||
<build>0</build>
|
||||
</versionNumber>
|
||||
<releaseDate>2021-01-17 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Slightly fancier splash screen :)</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
</a>
|
||||
</java.util.Arrays_-ArrayList>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
@@ -23,7 +24,8 @@ 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() {
|
||||
|
||||
@@ -68,7 +68,7 @@ public enum IconLoader {
|
||||
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");
|
||||
ComponentLarge("component_large.png"), ImportNetlist("import_netlist.png"), SplashIC("splash_ic.png");
|
||||
|
||||
protected String name;
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user