file system refresh animated icon

This commit is contained in:
Konstantin Bulenkov
2012-03-28 16:27:47 +02:00
parent a04c3ac7cb
commit 95a32c6264
22 changed files with 77 additions and 25 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,54 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* 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.
*/
package com.intellij.util.ui;
import com.intellij.openapi.util.IconLoader;
import javax.swing.*;
import java.awt.*;
/**
* @author Konstantin Bulenkov
*/
public class RefreshFileSystemIcon extends AnimatedIcon {
private static final Icon[] ICONS = getIcons("/process/fs/step_", 18);
private static Icon[] getIcons(String path, int count) {
Icon[] icons = new Icon[count];
for (int i = 0; i < icons.length; i++) {
int index = i + 1;
icons[i] = IconLoader.getIcon(path + index + ".png");
}
return icons;
}
public RefreshFileSystemIcon() {
super("Refreshing filesystem", ICONS, EmptyIcon.ICON_16, 800);
}
@Override
public Dimension getPreferredSize() {
if (!isRunning()) return new Dimension(0, 0);
return super.getPreferredSize();
}
@Override
public void paint(Graphics g) {
g.translate(0, -1);
super.paint(g);
g.translate(0, 1);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,10 +41,7 @@ import com.intellij.ui.components.labels.LinkLabel;
import com.intellij.ui.components.labels.LinkListener;
import com.intellij.ui.components.panels.Wrapper;
import com.intellij.util.Alarm;
import com.intellij.util.ui.AbstractLayoutManager;
import com.intellij.util.ui.AsyncProcessIcon;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.*;
import com.intellij.util.ui.update.MergingUpdateQueue;
import com.intellij.util.ui.update.Update;
import org.jetbrains.annotations.NotNull;
@@ -63,7 +60,7 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
private final StatusPanel myInfoPanel = new StatusPanel();
private final JPanel myRefreshAndInfoPanel = new JPanel();
private final AsyncProcessIcon myProgressIcon;
private final AnimatedIcon myProgressIcon;
private final ArrayList<ProgressIndicatorEx> myOriginals = new ArrayList<ProgressIndicatorEx>();
private final ArrayList<TaskInfo> myInfos = new ArrayList<TaskInfo>();
@@ -78,7 +75,7 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
private boolean myShouldClosePopupAndOnProcessFinish;
private final Alarm myRefreshAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
private AsyncProcessIcon myRefreshIcon;
private AnimatedIcon myRefreshIcon;
private EmptyIcon myEmptyRefreshIcon;
private String myCurrentRequestor;
@@ -89,24 +86,25 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
setOpaque(false);
myRefreshIcon = new AsyncProcessIcon("Refreshing filesystem") {
protected Icon getPassiveIcon() {
return myEmptyRefreshIcon;
}
@Override
public Dimension getPreferredSize() {
if (!isRunning()) return new Dimension(0, 0);
return super.getPreferredSize();
}
@Override
public void paint(Graphics g) {
g.translate(0, -1);
super.paint(g);
g.translate(0, 1);
}
};
myRefreshIcon = new RefreshFileSystemIcon();
// new AsyncProcessIcon("Refreshing filesystem") {
// protected Icon getPassiveIcon() {
// return myEmptyRefreshIcon;
// }
//
// @Override
// public Dimension getPreferredSize() {
// if (!isRunning()) return new Dimension(0, 0);
// return super.getPreferredSize();
// }
//
// @Override
// public void paint(Graphics g) {
// g.translate(0, -1);
// super.paint(g);
// g.translate(0, 1);
// }
//};
myRefreshIcon.setPaintPassiveIcon(false);
myEmptyRefreshIcon = new EmptyIcon(0, myRefreshIcon.getPreferredSize().height);