Browse Source

bug fix 代码质量

master
XiaXiang 7 years ago
parent
commit
b923aea003
  1. 4
      designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java
  2. 4
      designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java
  3. 4
      designer/src/com/fr/design/mainframe/alphafine/cell/model/NoResultModel.java
  4. 14
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  5. 4
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

4
designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java

@ -61,8 +61,8 @@ public abstract class AlphaCellModel implements Comparable {
this.description = description;
}
public boolean hasNoResult() {
return false;
public boolean hasAction() {
return true;
}
public boolean isNeedToSendToServer() {

4
designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java

@ -60,8 +60,8 @@ public class MoreModel extends AlphaCellModel {
}
@Override
public boolean hasNoResult() {
return true;
public boolean hasAction() {
return false;
}
@Override

4
designer/src/com/fr/design/mainframe/alphafine/cell/model/NoResultModel.java

@ -28,8 +28,8 @@ public class NoResultModel extends AlphaCellModel {
}
@Override
public boolean hasNoResult() {
return true;
public boolean hasAction() {
return false;
}
@Override

14
designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -26,18 +26,18 @@ public class ContentCellRender implements ListCellRenderer<Object> {
AlphaCellModel model = (AlphaCellModel) value;
JPanel panel = new JPanel(new BorderLayout());
panel.setBackground(null);
if (isSelected && !model.hasNoResult()) {
panel.setBackground(AlphaFineConstants.BLUE);
}
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
titleLabel.setText(" " + model.getName());
String iconUrl = "/com/fr/design/mainframe/alphafine/images/alphafine" + model.getType().getTypeValue() + ".png";
if (model.hasNoResult()) {
titleLabel.setIcon(null);
titleLabel.setForeground(AlphaFineConstants.MEDIUM_GRAY);
} else {
if (model.hasAction()) {
if (isSelected) {
panel.setBackground(AlphaFineConstants.BLUE);
}
titleLabel.setIcon(new ImageIcon(IOUtils.readImage(iconUrl)));
titleLabel.setForeground(AlphaFineConstants.BLACK);
} else {
titleLabel.setIcon(null);
titleLabel.setForeground(AlphaFineConstants.MEDIUM_GRAY);
}
titleLabel.setFont(AlphaFineConstants.MEDIUM_FONT);
String description = model.getDescription();

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

@ -829,7 +829,7 @@ public class AlphaFineDialog extends UIDialog {
int previousIndex = getSelectedIndex();
super.setSelectedIndex(index);
AlphaCellModel cellModel = getSelectedValue();
if (cellModel != null && cellModel.hasNoResult()) {
if (cellModel != null && !cellModel.hasAction()) {
if (previousIndex <= getSelectedIndex()) {
setSelectedIndex(index + 1);
} else {
@ -869,7 +869,7 @@ public class AlphaFineDialog extends UIDialog {
public void mouseClicked(MouseEvent e) {
int selectedIndex = getSelectedIndex();
AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && !selectedValue.hasNoResult()) {
if (e.getClickCount() == 2 && selectedValue.hasAction()) {
doNavigate();
saveHistory(selectedValue);
} else if (e.getClickCount() == 1) {

Loading…
Cancel
Save