|
|
|
@ -1,14 +1,21 @@
|
|
|
|
|
package com.fr.design.actions.replace.ui; |
|
|
|
|
|
|
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.share.ui.base.MouseClickListener; |
|
|
|
|
import com.fr.design.utils.BrowseUtils; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
import java.awt.GridLayout; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 左侧面板 |
|
|
|
@ -18,28 +25,46 @@ import java.awt.GridLayout;
|
|
|
|
|
* created by Destiny.Lin on 2022-09-05 |
|
|
|
|
*/ |
|
|
|
|
public class ITReplaceWestPanel { |
|
|
|
|
JPanel leftJpanel; |
|
|
|
|
private JPanel leftPanel; |
|
|
|
|
private UILabel iconLabel; |
|
|
|
|
private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); |
|
|
|
|
private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); |
|
|
|
|
private static final int FILL_COUNT = 13; |
|
|
|
|
|
|
|
|
|
public ITReplaceWestPanel() { |
|
|
|
|
|
|
|
|
|
leftJpanel = new JPanel(new GridLayout(15, 1, 0, 0)); |
|
|
|
|
leftPanel = new JPanel(new GridLayout(15, 1, 0, 0)); |
|
|
|
|
iconLabel = new UILabel("<html><u><font color = 'rgb(61,153,249)'>" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + "</font></u></html>"); |
|
|
|
|
|
|
|
|
|
UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); |
|
|
|
|
contentButton.setSelected(true); |
|
|
|
|
contentButton.setBorderPainted(false); |
|
|
|
|
leftJpanel.add(contentButton); |
|
|
|
|
leftJpanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); |
|
|
|
|
leftPanel.add(contentButton); |
|
|
|
|
leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); |
|
|
|
|
//填充一下面板
|
|
|
|
|
int labelNum = 14; |
|
|
|
|
for (int i = 0; i < labelNum; i++) { |
|
|
|
|
leftJpanel.add(new UILabel(StringUtils.EMPTY)); |
|
|
|
|
for (int i = 0; i < FILL_COUNT; i++) { |
|
|
|
|
leftPanel.add(new UILabel(StringUtils.EMPTY)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//添加帮助文档按钮及超链
|
|
|
|
|
iconLabel.setIcon(HELP_ICON); |
|
|
|
|
iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); |
|
|
|
|
//设置游标
|
|
|
|
|
iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
|
|
|
|
iconLabel.addMouseListener(new MouseClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
BrowseUtils.browser(HELP_URL); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
leftPanel.add(iconLabel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JPanel getLeftJpanel() { |
|
|
|
|
return leftJpanel; |
|
|
|
|
public JPanel getLeftPanel() { |
|
|
|
|
return leftPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setLeftJpanel(JPanel leftJpanel) { |
|
|
|
|
this.leftJpanel = leftJpanel; |
|
|
|
|
public void setLeftPanel(JPanel leftPanel) { |
|
|
|
|
this.leftPanel = leftPanel; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|