xiaoxia 8 years ago
parent
commit
2b7c7239ca
  1. 56
      designer/src/com/fr/design/mainframe/alphafine/Main.java
  2. 5
      designer/src/com/fr/design/mainframe/alphafine/cell/cellRender/TitleCellRender.java
  3. 1
      designer/src/com/fr/design/mainframe/alphafine/previewPane/ActionPreviewPane.java

56
designer/src/com/fr/design/mainframe/alphafine/Main.java

@ -1,56 +0,0 @@
package com.fr.design.mainframe.alphafine;//package com.fr.design.mainframe.alphafine;
//
//import javax.swing.*;
//import java.awt.*;
//import java.awt.image.ImageObserver;
//import java.util.Vector;
//
///**
// * Created by XiaXiang on 2017/5/10.
// */
//public class Main {
// public static void main(String args[]) {
// JFrame frame = new JFrame("JList Background Demonstration");
//
// JList list = new JList();
//
// String [] imageIcon = new String[] {
// "female.gif", "male.gif"
// };
//
// // create model
// Vector v = new Vector();
// for (int i=0; i<10; i++) {
// ImageIcon ii = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
// ii.setImageObserver(new AnimatedObserver(list, i));
// v.addElement(ii);
// }
//
// list.setListData(v);
//
// frame.getContentPane().add(BorderLayout.CENTER, list); //new JScrollPane(list));
// frame.setDefaultCloseOperation(3);
// frame.pack();
// frame.setVisible(true);
// }
//}
//
//class AnimatedObserver implements ImageObserver
//{
// JList list;
// int index;
//
// public AnimatedObserver(JList list, int index) {
// this.list = list;
// this.index = index;
// }
//
// public boolean imageUpdate (Image img, int infoflags, int x, int y, int width, int height) {
// if ((infoflags & (FRAMEBITS|ALLBITS)) != 0) {
// Rectangle rect = list.getCellBounds(index, index);
// list.repaint(rect);
// }
//
// return (infoflags & (ALLBITS|ABORT)) == 0;
// }
//}

5
designer/src/com/fr/design/mainframe/alphafine/cell/cellRender/TitleCellRender.java

@ -34,7 +34,10 @@ public class TitleCellRender implements ListCellRenderer<Object> {
panel.add(this.more, BorderLayout.EAST);
}
if (moreModel.isLoading()) {
UILabel loadingLabel = new UILabel(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif")));
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
//设置cell的加载动画
imageIcon.setImageObserver(list);
UILabel loadingLabel = new UILabel(imageIcon);
panel.add(loadingLabel, BorderLayout.SOUTH);
}
return panel;

1
designer/src/com/fr/design/mainframe/alphafine/previewPane/ActionPreviewPane.java

@ -4,4 +4,5 @@ package com.fr.design.mainframe.alphafine.previewPane;
* Created by XiaXiang on 2017/5/5.
*/
public class ActionPreviewPane {
//todo:还没确定要不要使用面板截图
}

Loading…
Cancel
Save