|
|
|
@ -40,9 +40,11 @@ import com.fr.stable.core.PropertyChangeAdapter;
|
|
|
|
|
import javax.swing.border.Border; |
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.event.ContainerEvent; |
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author richer |
|
|
|
@ -55,6 +57,9 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
private static final int NORTH = 0; |
|
|
|
|
private FormDesigner designer; |
|
|
|
|
|
|
|
|
|
private static final int LAYOUT_INDEX = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//默认蓝色标题背景
|
|
|
|
|
private static final Color TITLE_COLOR = new Color(51, 132, 240); |
|
|
|
|
|
|
|
|
@ -76,6 +81,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-25-下午6:22:40 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public String createDefaultName() { |
|
|
|
|
return "cardlayout"; |
|
|
|
|
} |
|
|
|
@ -89,6 +95,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-25-下午6:22:17 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public WCardLayout toData() { |
|
|
|
|
return (WCardLayout) data; |
|
|
|
|
} |
|
|
|
@ -97,6 +104,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* 初始化时默认的组件大小 |
|
|
|
|
* @return 默认Dimension |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Dimension initEditorSize() { |
|
|
|
|
return new Dimension(500, 300); |
|
|
|
|
} |
|
|
|
@ -150,6 +158,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-25-下午4:47:23 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
protected XLayoutContainer getCreatorWrapper(String widgetName) { |
|
|
|
|
initStyle(); |
|
|
|
|
Dimension dimension = new Dimension(); |
|
|
|
@ -223,6 +232,16 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
return xFirstBtn; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控件树不显示此组件 |
|
|
|
|
* @param path 控件树list |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void notShowInComponentTree(List<Component> path) { |
|
|
|
|
path.remove(LAYOUT_INDEX); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置父容器的名字 |
|
|
|
|
* |
|
|
|
@ -233,6 +252,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-27-上午9:47:00 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
protected void setWrapperName(XLayoutContainer parentPanel, String widgetName) { |
|
|
|
|
parentPanel.toData().setWidgetName("tablayout" + widgetName.replaceAll(createDefaultName(),"")); |
|
|
|
|
} |
|
|
|
@ -246,6 +266,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-25-下午4:57:55 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){ |
|
|
|
|
parentPanel.add(this, WBorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
@ -259,6 +280,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @date 2014-11-25-下午6:20:10 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void componentAdded(ContainerEvent e) { |
|
|
|
|
if (isRefreshing) { |
|
|
|
|
return; |
|
|
|
@ -284,6 +306,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* 是否支持标题样式 |
|
|
|
|
* @return 默认false |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean hasTitleStyle() { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -293,6 +316,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @return 属性名 |
|
|
|
|
* @throws IntrospectionException |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
|
//嵌套的tab组件,内层的不支持轮播属性,屏蔽属性表
|
|
|
|
|
if(!isNested()) { |
|
|
|
@ -379,6 +403,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//初始化样式
|
|
|
|
|
@Override |
|
|
|
|
protected void initStyle() { |
|
|
|
|
LayoutBorderStyle style = toData().getBorderStyle(); |
|
|
|
|
initBorderTitleStyle(style); |
|
|
|
@ -432,6 +457,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* @param designer 表单设计器 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void deleteRelatedComponent(XCreator creator, FormDesigner designer){ |
|
|
|
|
XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) creator.getBackupParent(); |
|
|
|
|
SelectionModel selectionModel = designer.getSelectionModel(); |
|
|
|
@ -461,6 +487,7 @@ public class XWCardLayout extends XLayoutContainer {
|
|
|
|
|
* data属性改变触发其他操作 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void firePropertyChange(){ |
|
|
|
|
initStyle(); |
|
|
|
|
} |
|
|
|
|