|
|
@ -1,12 +1,14 @@ |
|
|
|
package com.fr.design.mainframe.widget.ui; |
|
|
|
package com.fr.design.mainframe.widget.ui; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import java.awt.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by ibm on 2017/7/26. |
|
|
|
* Created by ibm on 2017/7/26. |
|
|
@ -14,20 +16,26 @@ import java.awt.*; |
|
|
|
public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane { |
|
|
|
public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane { |
|
|
|
private UICheckBox enableCheckBox; |
|
|
|
private UICheckBox enableCheckBox; |
|
|
|
private UICheckBox visibleCheckBox; |
|
|
|
private UICheckBox visibleCheckBox; |
|
|
|
|
|
|
|
private XCreator xCreator; |
|
|
|
|
|
|
|
|
|
|
|
public FormBasicWidgetPropertyPane (){ |
|
|
|
public FormBasicWidgetPropertyPane (XCreator xCreator){ |
|
|
|
|
|
|
|
this.xCreator = xCreator; |
|
|
|
initOtherPane(); |
|
|
|
initOtherPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initOtherPane() { |
|
|
|
protected void initOtherPane() { |
|
|
|
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); |
|
|
|
if(xCreator.supportSetEnable()){ |
|
|
|
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); |
|
|
|
pane2.add(enableCheckBox); |
|
|
|
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); |
|
|
|
pane2.add(enableCheckBox); |
|
|
|
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
} |
|
|
|
pane2.add(visibleCheckBox); |
|
|
|
if(xCreator.supportSetVisible()){ |
|
|
|
|
|
|
|
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); |
|
|
|
|
|
|
|
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
|
|
|
|
pane2.add(visibleCheckBox); |
|
|
|
|
|
|
|
} |
|
|
|
this.add(pane2, BorderLayout.CENTER); |
|
|
|
this.add(pane2, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -38,14 +46,22 @@ public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane { |
|
|
|
|
|
|
|
|
|
|
|
public void populate(Widget widget) { |
|
|
|
public void populate(Widget widget) { |
|
|
|
super.populate(widget); |
|
|
|
super.populate(widget); |
|
|
|
enableCheckBox.setSelected(widget.isEnabled()); |
|
|
|
if(xCreator.supportSetEnable()){ |
|
|
|
visibleCheckBox.setSelected(widget.isVisible()); |
|
|
|
enableCheckBox.setSelected(widget.isEnabled()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(xCreator.supportSetVisible()){ |
|
|
|
|
|
|
|
visibleCheckBox.setSelected(widget.isVisible()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void update(Widget widget) { |
|
|
|
public void update(Widget widget) { |
|
|
|
super.update(widget); |
|
|
|
super.update(widget); |
|
|
|
widget.setEnabled(enableCheckBox.isSelected()); |
|
|
|
if(xCreator.supportSetEnable()){ |
|
|
|
widget.setVisible(visibleCheckBox.isSelected()); |
|
|
|
widget.setEnabled(enableCheckBox.isSelected()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(xCreator.supportSetVisible()){ |
|
|
|
|
|
|
|
widget.setVisible(visibleCheckBox.isSelected()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|