Browse Source

代码质量,格式化代码

master
XiaXiang 7 years ago
parent
commit
ed26cbcec1
  1. 2
      designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  2. 3
      designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java
  3. 3
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  4. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  5. 2
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  6. 2
      designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java
  7. 2
      designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java

2
designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java

@ -6,8 +6,6 @@ import com.fr.general.FRLogger;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import javax.swing.*;
/** /**
* Created by XiaXiang on 2017/4/20. * Created by XiaXiang on 2017/4/20.
*/ */

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

@ -68,6 +68,7 @@ public abstract class AlphaCellModel implements Comparable {
public boolean isNeedToSendToServer() { public boolean isNeedToSendToServer() {
return true; return true;
} }
/** /**
* model转json * model转json
* *
@ -102,7 +103,7 @@ public abstract class AlphaCellModel implements Comparable {
@Override @Override
public int compareTo(Object o) { public int compareTo(Object o) {
AlphaCellModel cellModel = (AlphaCellModel)o; AlphaCellModel cellModel = (AlphaCellModel) o;
int difference = cellModel.getSearchCount() - this.getSearchCount(); int difference = cellModel.getSearchCount() - this.getSearchCount();
if (difference != 0) { if (difference != 0) {
return difference; return difference;

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

@ -5,7 +5,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -55,7 +54,7 @@ public class ContentCellRender implements ListCellRenderer<Object> {
detailLabel.setForeground(AlphaFineConstants.LIGHT_GRAY); detailLabel.setForeground(AlphaFineConstants.LIGHT_GRAY);
panel.add(detailLabel, BorderLayout.CENTER); panel.add(detailLabel, BorderLayout.CENTER);
int width = (int) (titleLabel.getPreferredSize().getWidth() + detailLabel.getPreferredSize().getWidth()); int width = (int) (titleLabel.getPreferredSize().getWidth() + detailLabel.getPreferredSize().getWidth());
if ( width > AlphaFineConstants.LEFT_WIDTH - OFFSET) { if (width > AlphaFineConstants.LEFT_WIDTH - OFFSET) {
int nameWidth = (int) (AlphaFineConstants.LEFT_WIDTH - detailLabel.getPreferredSize().getWidth() - OFFSET); int nameWidth = (int) (AlphaFineConstants.LEFT_WIDTH - detailLabel.getPreferredSize().getWidth() - OFFSET);
titleLabel.setPreferredSize(new Dimension(nameWidth, AlphaFineConstants.CELL_HEIGHT)); titleLabel.setPreferredSize(new Dimension(nameWidth, AlphaFineConstants.CELL_HEIGHT));
} }

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

@ -3,7 +3,6 @@ package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;

2
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -8,10 +8,8 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.utils.ThemeUtils; import com.fr.design.utils.ThemeUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;

2
designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java

@ -18,7 +18,7 @@ public class FilePreviewPane extends JPanel {
float widthScale = (AlphaFineConstants.RIGHT_WIDTH) / (float) image.getWidth(); float widthScale = (AlphaFineConstants.RIGHT_WIDTH) / (float) image.getWidth();
float heightScale = (AlphaFineConstants.CONTENT_HEIGHT) / (float) image.getHeight(); float heightScale = (AlphaFineConstants.CONTENT_HEIGHT) / (float) image.getHeight();
Image showImage; Image showImage;
showImage = widthScale > heightScale? image.getScaledInstance((int) (image.getWidth() * heightScale), AlphaFineConstants.CONTENT_HEIGHT, Image.SCALE_SMOOTH) : image.getScaledInstance(AlphaFineConstants.RIGHT_WIDTH, (int) (image.getWidth() * widthScale), Image.SCALE_SMOOTH); showImage = widthScale > heightScale ? image.getScaledInstance((int) (image.getWidth() * heightScale), AlphaFineConstants.CONTENT_HEIGHT, Image.SCALE_SMOOTH) : image.getScaledInstance(AlphaFineConstants.RIGHT_WIDTH, (int) (image.getWidth() * widthScale), Image.SCALE_SMOOTH);
label.setIcon(new ImageIcon(showImage)); label.setIcon(new ImageIcon(showImage));
add(label); add(label);
} }

2
designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java

@ -20,7 +20,7 @@ public class NoResultPane extends JPanel {
image.setPreferredSize(new Dimension(150, 111)); image.setPreferredSize(new Dimension(150, 111));
image.setHorizontalAlignment(SwingConstants.CENTER); image.setHorizontalAlignment(SwingConstants.CENTER);
image.setIcon(IconLoader.getIcon(iconUrl)); image.setIcon(IconLoader.getIcon(iconUrl));
image.setBorder(BorderFactory.createEmptyBorder(100,0,0,0)); image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0));
UILabel description = new UILabel(title); UILabel description = new UILabel(title);
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); description.setForeground(AlphaFineConstants.MEDIUM_GRAY);
description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14));

Loading…
Cancel
Save