Browse Source
Merge in DESIGN/design from ~HADES/design:feature/x to feature/x * commit '7b1fd9b72feaaaf14981c0be47d118015ab92f2d': REPORT-50908 填报-填报属性设置-填报属性中对表查询定位的问题 REPORT-47952 公式编辑器中数据集参数获取问题 CHART-18997 处理下打开模板出错时情况 CHART-18997 处理下打开模板出错时情况 REPORT-50908 填报-填报属性设置-填报属性中对表查询定位的问题 REPORT-51199 模版数据集预览图标偏移 REPORT-51162 端口输入限制失效 & REPORT-51260 redshift的特定url格式无法识别 KERNEL-7542 优化设计器发现的一些问题research/11.0
ju|剧浩宇
4 years ago
17 changed files with 270 additions and 61 deletions
@ -0,0 +1,92 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.design.dialog.link.MessageWithLink; |
||||
import com.fr.design.file.HistoryTemplateListCache; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.general.IOUtils; |
||||
import com.fr.stable.StringUtils; |
||||
import java.awt.Color; |
||||
import java.awt.Component; |
||||
import java.awt.Container; |
||||
import java.awt.Dimension; |
||||
import java.awt.LayoutManager; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.event.HyperlinkEvent; |
||||
import javax.swing.event.HyperlinkListener; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/4/20 |
||||
*/ |
||||
public class OpenFailedPane extends JPanel { |
||||
|
||||
private UILabel label; |
||||
private MessageWithLink link; |
||||
|
||||
public OpenFailedPane() { |
||||
this.setLayout(new LayoutManager() { |
||||
@Override |
||||
public void addLayoutComponent(String name, Component comp) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void removeLayoutComponent(Component comp) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public Dimension preferredLayoutSize(Container parent) { |
||||
return parent.getPreferredSize(); |
||||
} |
||||
|
||||
@Override |
||||
public Dimension minimumLayoutSize(Container parent) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void layoutContainer(Container parent) { |
||||
int width = parent.getParent().getWidth(); |
||||
int height = parent.getParent().getHeight(); |
||||
int labelWidth = label.getPreferredSize().width; |
||||
int labelHeight = label.getPreferredSize().height; |
||||
int labelX = (width - labelWidth) / 2; |
||||
int labelY = (height - labelHeight) / 2; |
||||
int linkWidth = link.getPreferredSize().width; |
||||
int linkHeight = link.getPreferredSize().height; |
||||
int linkX = (width - linkWidth) / 2; |
||||
int linkY = (height - labelHeight) / 2 + labelHeight; |
||||
label.setBounds(labelX, labelY, labelWidth, labelHeight); |
||||
link.setBounds(linkX, linkY, linkWidth, linkHeight); |
||||
} |
||||
}); |
||||
this.setBackground(Color.WHITE); |
||||
label = new UILabel(IOUtils.readIcon("/com/fr/design/images/mainframe/open_failed.png"), UILabel.CENTER); |
||||
link = new MessageWithLink(Toolkit.i18nText("Fine-Design_Open_Failed_Tip"), Toolkit.i18nText("Fine-Design_Open_Failed_Retry"), StringUtils.EMPTY, Color.WHITE) { |
||||
@Override |
||||
protected void initListener(String link) { |
||||
addHyperlinkListener(new HyperlinkListener() { |
||||
@Override |
||||
public void hyperlinkUpdate(HyperlinkEvent e) { |
||||
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { |
||||
// 重试
|
||||
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
||||
template = JTemplateFactory.createJTemplate(template.getEditingFILE()); |
||||
DesignerContext.getDesignerFrame().addAndActivateJTemplate(template); |
||||
HistoryTemplateListCache.getInstance(). setCurrentEditingTemplate(template); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
link.setBackground(Color.WHITE); |
||||
this.add(label); |
||||
this.add(link); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in new issue