|
|
|
@ -1,6 +1,9 @@
|
|
|
|
|
package com.fr.design.mainframe.alphafine.preview; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.design.actions.help.alphafine.AlphaFineConstants; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.dialog.link.MessageWithLink; |
|
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
@ -13,7 +16,6 @@ import com.fr.design.utils.DesignUtils;
|
|
|
|
|
import com.fr.design.utils.LinkStrUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JButton; |
|
|
|
|
import javax.swing.JLabel; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
@ -28,6 +30,11 @@ import java.awt.RenderingHints;
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
import static com.fine.theme.utils.FineUIScale.scale; |
|
|
|
|
|
|
|
|
|
public class TemplateResourceDetailPane extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -40,17 +47,18 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
private UIScrollPane detailInfoPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int IMAGE_HEIGHT = 170; |
|
|
|
|
private static final int IMAGE_WIDTH = 310; |
|
|
|
|
private static final int SCROLL_PANE_WIDTH = 315; |
|
|
|
|
private static final int SCROLL_PANE_HEIGHT = 135; |
|
|
|
|
private static final int CONTENT_PANE_WIDTH = 320; |
|
|
|
|
private static final int CONTENT_PANE_HEIGHT = 180; |
|
|
|
|
private static final int DETAIL_PANE_HEIGHT = 95; |
|
|
|
|
private static final int TEXT_SCROLL_PANE_HEIGHT = 500; |
|
|
|
|
private static final int PANE_WIDTH = 635; |
|
|
|
|
private static final int BUTTON_WIDTH = 68; |
|
|
|
|
private static final int BUTTON_HEIGHT = 20; |
|
|
|
|
private static final int IMAGE_HEIGHT = scale(170); |
|
|
|
|
private static final int IMAGE_WIDTH = scale(310); |
|
|
|
|
private static final int SCROLL_PANE_WIDTH = scale(315); |
|
|
|
|
private static final int SCROLL_PANE_HEIGHT = scale(135); |
|
|
|
|
private static final int CONTENT_PANE_WIDTH = scale(320); |
|
|
|
|
private static final int CONTENT_PANE_HEIGHT = scale(180); |
|
|
|
|
private static final int DETAIL_PANE_HEIGHT = scale(95); |
|
|
|
|
private static final int TEXT_SCROLL_PANE_HEIGHT = scale(95); |
|
|
|
|
private static final int PANE_WIDTH = scale(635); |
|
|
|
|
private static final int BUTTON_WIDTH = scale(68); |
|
|
|
|
private static final int BUTTON_HEIGHT = scale(20); |
|
|
|
|
private static final int BUTTON_OFFSET = scale(4); |
|
|
|
|
|
|
|
|
|
private static final String GOTO_DETAIL = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Detail_GOTO_DETAIL"); |
|
|
|
|
private static final String START_USE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Detail_START_USE"); |
|
|
|
@ -66,7 +74,7 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
|
|
|
|
|
private static final Color INFO_PANE_BACKGROUND = new Color(0xf9f9f9); |
|
|
|
|
private static final Color INFO_PANE_FOREGROUND = new Color(0x5b5b5c); |
|
|
|
|
private static final Color MORE_INFO_LINK = new Color(0x419bf9); |
|
|
|
|
private static final Color MORE_INFO_LINK = FineUIUtils.getUIColor("defaultHighlightBorderColor", "Component.focusedBorderColor"); |
|
|
|
|
|
|
|
|
|
private static final Font HTML_FONT = DesignUtils.getDefaultGUIFont().applySize(12); |
|
|
|
|
private static final Color HTML_COLOR = new Color(0x5c5c5d); |
|
|
|
@ -79,11 +87,11 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
public TemplateResourceDetailPane(TemplateResourceDetail detail) { |
|
|
|
|
this.data = detail; |
|
|
|
|
initComponent(); |
|
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT)); |
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); |
|
|
|
|
this.add(imagePane); |
|
|
|
|
this.add(contentPane); |
|
|
|
|
this.add(detailInfoPane); |
|
|
|
|
this.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
this.add(column(LayoutConstants.VGAP_HUGER, |
|
|
|
|
row(LayoutConstants.HORIZONTAL_GAP, cell(imagePane), cell(contentPane)), |
|
|
|
|
cell(detailInfoPane) |
|
|
|
|
).getComponent()); |
|
|
|
|
this.setBackground(Color.WHITE); |
|
|
|
|
SwingUtilities.invokeLater(()->{scrollToTop();}); |
|
|
|
|
} |
|
|
|
@ -120,7 +128,7 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
operatePane = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
|
|
|
|
|
|
|
|
|
JLabel emptyLabel = new JLabel(); |
|
|
|
|
emptyLabel.setPreferredSize(new Dimension(145, 25)); |
|
|
|
|
emptyLabel.setPreferredSize(scale(new Dimension(145, 25))); |
|
|
|
|
JLabel priceLabel = new JLabel(); |
|
|
|
|
priceLabel.setForeground(Color.RED); |
|
|
|
|
if (data.getPrice() == 0) { |
|
|
|
@ -172,11 +180,11 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
|
g2d.setColor(UIConstants.FLESH_BLUE); |
|
|
|
|
g2d.fillRoundRect(0, 0, getWidth(), getHeight(), 4, 4); |
|
|
|
|
g2d.fillRoundRect(0, 0, getWidth(), getHeight(), BUTTON_OFFSET, BUTTON_OFFSET); |
|
|
|
|
super.paintComponent(g2d); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
starUseButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
starUseButton.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
starUseButton.setForeground(Color.WHITE); |
|
|
|
|
starUseButton.setFont(AlphaFineConstants.MEDIUM_FONT); |
|
|
|
|
starUseButton.addActionListener(new StartUseAction(data)); |
|
|
|
@ -214,7 +222,7 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
infoScrollPane = new UIScrollPane(content); |
|
|
|
|
infoScrollPane.setForeground(INFO_PANE_FOREGROUND); |
|
|
|
|
infoScrollPane.setPreferredSize(new Dimension(SCROLL_PANE_WIDTH, SCROLL_PANE_HEIGHT)); |
|
|
|
|
infoScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
infoScrollPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -225,7 +233,7 @@ public class TemplateResourceDetailPane extends JPanel {
|
|
|
|
|
detailInfoPane = new UIScrollPane(content); |
|
|
|
|
detailInfoPane.setPreferredSize(new Dimension(PANE_WIDTH, DETAIL_PANE_HEIGHT)); |
|
|
|
|
detailInfoPane.setBackground(Color.WHITE); |
|
|
|
|
detailInfoPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
detailInfoPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|