Browse Source

alphafine 交互改良

master
XiaXiang 7 years ago
parent
commit
ae7cfe2563
  1. 8
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  2. 57
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  3. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

8
designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java

@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer<Object> {
showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
panel.add(showMoreLabel, BorderLayout.EAST); panel.add(showMoreLabel, BorderLayout.EAST);
} }
if (moreModel.isLoading()) {
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
//设置cell的加载动画
imageIcon.setImageObserver(list);
UILabel loadingLabel = new UILabel(imageIcon);
loadingLabel.setBorder(BorderFactory.createEmptyBorder(LOAD_OFFSET,0,0,0));
panel.add(loadingLabel, 0);
}
panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT)); panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT));
return panel; return panel;
} }

57
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -72,9 +72,10 @@ public class AlphaFineDialog extends UIDialog {
private AlphaFineTextField searchTextField; private AlphaFineTextField searchTextField;
private UIButton closeButton; private UIButton closeButton;
private JPanel searchResultPane; private JPanel searchResultPane;
private Point pressedPoint;
private UIScrollPane leftSearchResultPane; private UIScrollPane leftSearchResultPane;
private JPanel defaultPane; private JPanel defaultPane;
//分割线
private UILabel splitLabel;
private JPanel rightSearchResultPane; private JPanel rightSearchResultPane;
private AlphaFineList searchResultList; private AlphaFineList searchResultList;
private SearchListModel searchListModel; private SearchListModel searchListModel;
@ -302,7 +303,7 @@ public class AlphaFineDialog extends UIDialog {
rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT)); rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT));
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST);
UILabel splitLabel = new UILabel(); splitLabel = new UILabel();
splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1));
searchResultPane.add(splitLabel, BorderLayout.NORTH); searchResultPane.add(splitLabel, BorderLayout.NORTH);
add(searchResultPane, BorderLayout.SOUTH); add(searchResultPane, BorderLayout.SOUTH);
@ -320,6 +321,7 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() { this.searchWorker = new SwingWorker() {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase()); rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@ -327,6 +329,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
protected void done() { protected void done() {
if (!isCancelled()) { if (!isCancelled()) {
splitLabel.setIcon(null);
fireStopLoading(); fireStopLoading();
} }
} }
@ -339,7 +342,8 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void fireStopLoading() { private void fireStopLoading() {
searchListModel.resetState(); searchListModel.resetState();
replaceLeftPane(); refreshContainer();
//replaceLeftPane();
} }
/** /**
@ -680,45 +684,6 @@ public class AlphaFineDialog extends UIDialog {
} }
/**
* 窗口拖拽
*/
private void initMouseListener() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
doMouseDragged(e);
}
});
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
doMousePressed(e);
}
});
}
private void doMousePressed(MouseEvent e) {
pressedPoint = e.getPoint();
}
private void doMouseDragged(MouseEvent e) {
Point point = e.getPoint();// 获取当前坐标
Point locationPoint = getLocation();// 获取窗体坐标
int x = locationPoint.x + point.x - pressedPoint.x;// 计算移动后的新坐标
int y = locationPoint.y + point.y - pressedPoint.y;
setLocation(x, y);// 改变窗体位置
}
/** /**
* 当鼠标在搜索界面边界外点击时触发 * 当鼠标在搜索界面边界外点击时触发
*/ */
@ -880,6 +845,14 @@ public class AlphaFineDialog extends UIDialog {
this.storeText = storeText; this.storeText = storeText;
} }
public UILabel getSplitLabel() {
return splitLabel;
}
public void setSplitLabel(UILabel splitLabel) {
this.splitLabel = splitLabel;
}
/** /**
* +-------------------------------------+ * +-------------------------------------+

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Loading…
Cancel
Save