xiaoxia 7 years ago
parent
commit
96662a2a73
  1. 15
      designer/src/com/fr/design/mainframe/alphafine/previewPane/PluginPreviewPane.java

15
designer/src/com/fr/design/mainframe/alphafine/previewPane/PluginPreviewPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.alphafine.previewPane; package com.fr.design.mainframe.alphafine.previewPane;
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.CellType; import com.fr.design.mainframe.alphafine.CellType;
import javax.swing.*; import javax.swing.*;
@ -12,14 +13,17 @@ import java.awt.*;
*/ */
public class PluginPreviewPane extends JPanel { public class PluginPreviewPane extends JPanel {
public PluginPreviewPane(String title, Image image, String version, String jartime, CellType type, int price) { public PluginPreviewPane(String title, Image image, String version, String jartime, CellType type, int price) {
this.setLayout(new BorderLayout()); setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(50,0,0,0)); setBorder(BorderFactory.createEmptyBorder(50,0,0,0));
this.setBackground(Color.white); setBackground(Color.white);
UILabel imageLabel = new UILabel(); UILabel imageLabel = new UILabel();
image = image.getScaledInstance(200, 200, Image.SCALE_SMOOTH); image = image.getScaledInstance(200, 200, Image.SCALE_SMOOTH);
imageLabel.setIcon(new ImageIcon(image)); imageLabel.setIcon(new ImageIcon(image));
imageLabel.setHorizontalAlignment(SwingConstants.CENTER);
imageLabel.setBackground(Color.black);
UILabel nameLabel = new UILabel(title); UILabel nameLabel = new UILabel(title);
nameLabel.setVerticalAlignment(SwingConstants.CENTER); nameLabel.setBackground(Color.yellow);
nameLabel.setHorizontalAlignment(SwingConstants.CENTER);
JPanel line = new JPanel(); JPanel line = new JPanel();
line.setPreferredSize(new Dimension(200,1)); line.setPreferredSize(new Dimension(200,1));
line.setBackground(new Color(0xd2d2d2)); line.setBackground(new Color(0xd2d2d2));
@ -30,7 +34,8 @@ public class PluginPreviewPane extends JPanel {
bottomPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0)); bottomPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
if (type == CellType.PLUGIN) { if (type == CellType.PLUGIN) {
UILabel versionLabel = new UILabel("V" + version); UILabel versionLabel = new UILabel("V" + version);
versionLabel.setBorder(BorderFactory.createEmptyBorder(0,20,10,20)); versionLabel.setHorizontalAlignment(SwingConstants.CENTER);
versionLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
versionLabel.setForeground(new Color(0x666666)); versionLabel.setForeground(new Color(0x666666));
versionLabel.setFont(new Font("Song_TypeFace",0,12)); versionLabel.setFont(new Font("Song_TypeFace",0,12));
panel.add(versionLabel, BorderLayout.CENTER); panel.add(versionLabel, BorderLayout.CENTER);

Loading…
Cancel
Save