diff --git a/community-resources/src/community_progress_tail.png b/community-resources/src/community_progress_tail.png new file mode 100644 index 000000000000..b6f7661c913c Binary files /dev/null and b/community-resources/src/community_progress_tail.png differ diff --git a/community-resources/src/idea/IdeaApplicationInfo.xml b/community-resources/src/idea/IdeaApplicationInfo.xml index dd0d2e733871..aabd0fb081d2 100644 --- a/community-resources/src/idea/IdeaApplicationInfo.xml +++ b/community-resources/src/idea/IdeaApplicationInfo.xml @@ -3,7 +3,7 @@ - + diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java index 17ff11cc8d1f..1894947fb261 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java @@ -30,7 +30,9 @@ import org.jdom.Document; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import javax.swing.*; import java.awt.*; import java.io.File; import java.util.*; @@ -50,6 +52,8 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern private String myCompanyUrl = "http://www.jetbrains.com/"; private Color myLogoTextColor = new Color(0, 35, 135); // idea blue private Color myProgressColor = null; + private Icon myProgressTailIcon = null; + private int myProgressY = 350; private String myAboutLogoUrl = null; @NonNls private String myIconUrl = "/icon.png"; @@ -98,6 +102,7 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern @NonNls private static final String ATTRIBUTE_TEXT_COLOR = "textcolor"; @NonNls private static final String ATTRIBUTE_PROGRESS_COLOR = "progressColor"; @NonNls private static final String ATTRIBUTE_PROGRESS_Y = "progressY"; + @NonNls private static final String ATTRIBUTE_PROGRESS_TAIL_ICON = "progressTailIcon"; @NonNls private static final String ELEMENT_ABOUT = "about"; @NonNls private static final String ELEMENT_ICON = "icon"; @NonNls private static final String ATTRIBUTE_SIZE32 = "size32"; @@ -211,6 +216,11 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern return myProgressY; } + @Nullable + public Icon getProgressTailIcon() { + return myProgressTailIcon; + } + public String getAboutLogoUrl() { return myAboutLogoUrl; } @@ -399,6 +409,12 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern if (v != null) { myProgressColor = parseColor(v); } + + v = logoElement.getAttributeValue(ATTRIBUTE_PROGRESS_TAIL_ICON); + if (v != null) { + myProgressTailIcon = IconLoader.getIcon(v); + } + v = logoElement.getAttributeValue(ATTRIBUTE_PROGRESS_Y); if (v != null) { myProgressY = Integer.parseInt(v); diff --git a/platform/platform-impl/src/com/intellij/ui/Splash.java b/platform/platform-impl/src/com/intellij/ui/Splash.java index 2fd1383c7927..099193d453a6 100644 --- a/platform/platform-impl/src/com/intellij/ui/Splash.java +++ b/platform/platform-impl/src/com/intellij/ui/Splash.java @@ -37,6 +37,7 @@ import java.util.List; *

textColor is HEX representation of text color for user name *

progressColor is progress bar color *

progressY is Y coordinate of the progress bar + *

progressTailIcon is a path to flame effect icon * * @author Konstantin Bulenkov */ @@ -49,6 +50,8 @@ public class Splash extends JDialog implements StartupProgress { private boolean mySplashIsVisible; private int myProgressLastPosition = 0; private final JLabel myLabel; + private Icon myProgressTail; + public Splash(String imageName, final Color textColor) { @@ -84,6 +87,7 @@ public class Splash extends JDialog implements StartupProgress { myProgressHeight = 2; myProgressColor = appInfo.getProgressColor(); myProgressY = appInfo.getProgressY(); + myProgressTail = appInfo.getProgressTailIcon(); } } @@ -115,14 +119,13 @@ public class Splash extends JDialog implements StartupProgress { } final int progressWidth = (int)((myImage.getIconWidth() - 2) * myProgress); - //if (progressWidth > myProgressLastPosition + 1) { - //g.setColor(ColorUtil.withAlpha(color, 0.6)); final int width = progressWidth - myProgressLastPosition; - //g.fillOval(width - 10, getProgressY() - 2, 12, getProgressHeight() + 4); g.setColor(color); - g.fillRect(myProgressLastPosition + 1, getProgressY(), width, getProgressHeight()); + g.fillRect(1, getProgressY(), width, getProgressHeight()); + if (myProgressTail != null) { + myProgressTail.paintIcon(this, g, width - (myProgressTail.getIconWidth()/2), getProgressY() - (myProgressTail.getIconHeight() - getProgressHeight())/2); + } myProgressLastPosition = progressWidth; - //} } private int getProgressHeight() { @@ -184,4 +187,24 @@ public class Splash extends JDialog implements StartupProgress { return myIcon.getIconHeight(); } } + + //public static void main(String[] args) { + // final ImageIcon icon = new ImageIcon("c:\\IDEA\\ultimate\\ultimate-resources\\src\\progress_tail.png"); + // + // final int w = icon.getIconWidth(); + // final int h = icon.getIconHeight(); + // final BufferedImage image = GraphicsEnvironment.getLocalGraphicsEnvironment() + // .getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(w, h, Color.TRANSLUCENT); + // final Graphics2D g = image.createGraphics(); + // icon.paintIcon(null, g, 0, 0); + // g.dispose(); + // + // for (int y = 0; y < image.getHeight(); y++) { + // for (int x = 0; x < image.getWidth(); x++) { + // final Color c = new Color(image.getRGB(x, y), true); + // System.out.print(String.format("[%3d,%3d,%3d,%3d] ", c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha())); + // } + // System.out.println(""); + // } + //} }