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