|
|
|
@ -4,6 +4,7 @@ import com.fr.design.i18n.Toolkit;
|
|
|
|
|
import com.fr.design.mainframe.alphafine.model.TemplateResource; |
|
|
|
|
import com.fr.design.mainframe.alphafine.preview.TemplateShopPane; |
|
|
|
|
import com.fr.design.utils.BrowseUtils; |
|
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
@ -12,6 +13,7 @@ import javax.swing.JPanel;
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Font; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
|
@ -19,11 +21,13 @@ import java.awt.event.MouseEvent;
|
|
|
|
|
public class TemplateResourcePanel extends JPanel { |
|
|
|
|
|
|
|
|
|
private JPanel northPane; |
|
|
|
|
private JPanel southPane; |
|
|
|
|
private JPanel centerPane; |
|
|
|
|
private TemplateResource templateResource; |
|
|
|
|
|
|
|
|
|
private static final Color PANEL_BORDER_COLOR = new Color(0xe8e8e9); |
|
|
|
|
private static final Color DEMO_LABEL_FOREGROUND = new Color(0x419bf9); |
|
|
|
|
private static final Font RESOURCE_NAME_FONT = DesignUtils.getDefaultGUIFont().applySize(12); |
|
|
|
|
private static final Color RESOURCE_NAME_COLOR = new Color(0x5c5c5d); |
|
|
|
|
|
|
|
|
|
protected TemplateResourcePanel() { |
|
|
|
|
|
|
|
|
@ -35,7 +39,7 @@ public class TemplateResourcePanel extends JPanel {
|
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
this.setBorder(BorderFactory.createLineBorder(PANEL_BORDER_COLOR, 1)); |
|
|
|
|
this.add(northPane, BorderLayout.NORTH); |
|
|
|
|
this.add(southPane, BorderLayout.SOUTH); |
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
addAction(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -60,8 +64,8 @@ public class TemplateResourcePanel extends JPanel {
|
|
|
|
|
public JPanel getNorthPane() { |
|
|
|
|
return northPane; |
|
|
|
|
} |
|
|
|
|
public JPanel getSouthPane() { |
|
|
|
|
return southPane; |
|
|
|
|
public JPanel getCenterPane() { |
|
|
|
|
return centerPane; |
|
|
|
|
} |
|
|
|
|
public TemplateResource getTemplateResource() { |
|
|
|
|
return templateResource; |
|
|
|
@ -71,8 +75,8 @@ public class TemplateResourcePanel extends JPanel {
|
|
|
|
|
this.northPane = northPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setSouthPane(JPanel southPane) { |
|
|
|
|
this.southPane = southPane; |
|
|
|
|
public void setCenterPane(JPanel centerPane) { |
|
|
|
|
this.centerPane = centerPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setTemplateResource(TemplateResource templateResource) { |
|
|
|
@ -81,15 +85,17 @@ public class TemplateResourcePanel extends JPanel {
|
|
|
|
|
|
|
|
|
|
private void initComponent() { |
|
|
|
|
createNorthPane(); |
|
|
|
|
createSouthPane(); |
|
|
|
|
createCenterPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void createNorthPane() { |
|
|
|
|
northPane = new TemplateResourceImagePanel(templateResource); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createSouthPane() { |
|
|
|
|
private void createCenterPane() { |
|
|
|
|
JLabel nameLabel = new JLabel(templateResource.getName()); |
|
|
|
|
nameLabel.setFont(RESOURCE_NAME_FONT); |
|
|
|
|
nameLabel.setForeground(RESOURCE_NAME_COLOR); |
|
|
|
|
nameLabel.setBackground(Color.WHITE); |
|
|
|
|
nameLabel.setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
|
|
|
|
|
@ -109,10 +115,10 @@ public class TemplateResourcePanel extends JPanel {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
southPane = new JPanel(new BorderLayout()); |
|
|
|
|
southPane.setBackground(Color.WHITE); |
|
|
|
|
southPane.add(nameLabel, BorderLayout.WEST); |
|
|
|
|
southPane.add(demoLabel, BorderLayout.EAST); |
|
|
|
|
centerPane = new JPanel(new BorderLayout()); |
|
|
|
|
centerPane.setBackground(Color.WHITE); |
|
|
|
|
centerPane.add(nameLabel, BorderLayout.WEST); |
|
|
|
|
centerPane.add(demoLabel, BorderLayout.EAST); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|