|
|
@ -1,12 +1,13 @@ |
|
|
|
package com.fr.design.widget; |
|
|
|
package com.fr.design.widget; |
|
|
|
|
|
|
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.fine.swing.ui.layout.BaseLayoutContainer; |
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
import com.fr.design.dialog.AttrScrollPane; |
|
|
|
import com.fr.design.dialog.AttrScrollPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicScrollPane; |
|
|
|
import com.fr.design.dialog.BasicScrollPane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
|
|
|
import com.fr.design.gui.frpane.FineTabbedPane; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
@ -18,6 +19,7 @@ import com.fr.form.ui.Widget; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.CardLayout; |
|
|
|
import java.awt.CardLayout; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
@ -34,9 +36,7 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
private WidgetMobilePane currentWidgetMobilePane; |
|
|
|
private WidgetMobilePane currentWidgetMobilePane; |
|
|
|
//属性配置切换面板
|
|
|
|
//属性配置切换面板
|
|
|
|
private ArrayList<JPanel> paneList; |
|
|
|
private ArrayList<JPanel> paneList; |
|
|
|
private JPanel center; |
|
|
|
private BaseLayoutContainer tabsHeaderIconPane; |
|
|
|
private UIHeadGroup tabsHeaderIconPane; |
|
|
|
|
|
|
|
private CardLayout tabbedPane; |
|
|
|
|
|
|
|
private BasicWidgetPropertySettingPane widgetPropertyPane; |
|
|
|
private BasicWidgetPropertySettingPane widgetPropertyPane; |
|
|
|
|
|
|
|
|
|
|
|
//通用属性容器
|
|
|
|
//通用属性容器
|
|
|
@ -64,23 +64,29 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
this.removeAll(); |
|
|
|
this.removeAll(); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
tabbedPane = new CardLayout(); |
|
|
|
|
|
|
|
center = new JPanel(tabbedPane); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")}; |
|
|
|
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")}; |
|
|
|
tabsHeaderIconPane = new UIHeadGroup(tabTitles) { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void tabChanged(int index) { |
|
|
|
|
|
|
|
tabbedPane.show(center, tabTitles[index]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel wrapperPane = new JPanel(new BorderLayout()); |
|
|
|
Component component = initTabPane(); |
|
|
|
wrapperPane.add(tabsHeaderIconPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
wrapperPane.add(center, BorderLayout.CENTER); |
|
|
|
initTabHead(tabTitles, component); |
|
|
|
wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)); |
|
|
|
|
|
|
|
this.add(wrapperPane, BorderLayout.CENTER); |
|
|
|
this.add(tabsHeaderIconPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initPaneList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initTabHead(String[] tabTitles, Component component) { |
|
|
|
|
|
|
|
tabsHeaderIconPane = FineTabbedPane.builder() |
|
|
|
|
|
|
|
.addTab(tabTitles[0], component) |
|
|
|
|
|
|
|
.addTab(tabTitles[1], eventTabPane) |
|
|
|
|
|
|
|
.addTab(tabTitles[2], mobileTabPane) |
|
|
|
|
|
|
|
.withHeadRatio(1.0f) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Component initTabPane() { |
|
|
|
// 属性
|
|
|
|
// 属性
|
|
|
|
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
BasicScrollPane basicScrollPane = new AttrScrollPane() { |
|
|
|
BasicScrollPane basicScrollPane = new AttrScrollPane() { |
|
|
@ -95,9 +101,9 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
attriCardLayout = (CardLayout) attriCardPane.getLayout(); |
|
|
|
attriCardLayout = (CardLayout) attriCardPane.getLayout(); |
|
|
|
|
|
|
|
|
|
|
|
attriTabPane.add(column( |
|
|
|
attriTabPane.add(column( |
|
|
|
cell(basicPane), |
|
|
|
cell(basicPane), |
|
|
|
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())), |
|
|
|
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())), |
|
|
|
cell(attriCardPane) |
|
|
|
cell(attriCardPane) |
|
|
|
).getComponent() |
|
|
|
).getComponent() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -112,14 +118,10 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
mobileTabPane.add(mobileCardPane, BorderLayout.CENTER); |
|
|
|
mobileTabPane.add(mobileCardPane, BorderLayout.CENTER); |
|
|
|
mobileCardLayout = (CardLayout) mobileCardPane.getLayout(); |
|
|
|
mobileCardLayout = (CardLayout) mobileCardPane.getLayout(); |
|
|
|
|
|
|
|
|
|
|
|
center.add(basicScrollPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute")); |
|
|
|
return basicScrollPane; |
|
|
|
center.add(eventTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event")); |
|
|
|
|
|
|
|
center.add(mobileTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")); |
|
|
|
|
|
|
|
initPaneList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPaneList() { |
|
|
|
protected void initPaneList() { |
|
|
|
paneList = new ArrayList<JPanel>(); |
|
|
|
paneList = new ArrayList<JPanel>(); |
|
|
|
paneList.add(attriTabPane); |
|
|
|
paneList.add(attriTabPane); |
|
|
|
paneList.add(eventPane); |
|
|
|
paneList.add(eventPane); |
|
|
@ -137,7 +139,10 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
public void populate(Widget cellWidget) { |
|
|
|
public void populate(Widget cellWidget) { |
|
|
|
initComponents(pane); |
|
|
|
initComponents(pane); |
|
|
|
|
|
|
|
populateWidget(cellWidget); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void populateWidget(Widget cellWidget) { |
|
|
|
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { |
|
|
|
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void did(DataCreatorUI ui, String cardName) { |
|
|
|
public void did(DataCreatorUI ui, String cardName) { |
|
|
@ -160,8 +165,9 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
mobileCardLayout.show(mobileCardPane, mobilePane.getClass().toString()); |
|
|
|
mobileCardLayout.show(mobileCardPane, mobilePane.getClass().toString()); |
|
|
|
currentWidgetMobilePane = mobilePane; |
|
|
|
currentWidgetMobilePane = mobilePane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tabsHeaderIconPane instanceof UIHeadGroup) { |
|
|
|
tabsHeaderIconPane.setSelectedIndex(0); |
|
|
|
((UIHeadGroup) tabsHeaderIconPane).setSelectedIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Widget update() { |
|
|
|
public Widget update() { |
|
|
@ -195,4 +201,12 @@ public class CellWidgetCardPane extends BasicPane { |
|
|
|
eventPane.checkValid(); |
|
|
|
eventPane.checkValid(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getEventTabPane() { |
|
|
|
|
|
|
|
return this.eventTabPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getMobileTabPane() { |
|
|
|
|
|
|
|
return this.mobileTabPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|