帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

45 lines
1.6 KiB

package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.DesignUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by XiaXiang on 2017/8/14.
*/
public class NoResultPane extends JPanel {
public NoResultPane(String title, Icon icon) {
this(title, icon, AlphaFineConstants.LEFT_WIDTH);
}
public NoResultPane(String title, Icon icon, int width) {
setLayout(new BorderLayout());
setBackground(Color.white);
setPreferredSize(new Dimension(width, 305));
UILabel image = new UILabel();
image.setPreferredSize(new Dimension(150, 111));
image.setHorizontalAlignment(SwingConstants.CENTER);
image.setIcon(icon);
image.setBorder(BorderFactory.createEmptyBorder(30, 0, 0, 0));
add(image, BorderLayout.CENTER);
add(generateDescription(title), BorderLayout.SOUTH);
}
protected Component generateDescription(String title) {
UILabel description = new UILabel(title);
description.setForeground(AlphaFineConstants.MEDIUM_GRAY);
description.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0));
description.setHorizontalAlignment(SwingConstants.CENTER);
return description;
}
}