forked from fanruan/design
MoMeak
7 years ago
5 changed files with 223 additions and 224 deletions
@ -1,48 +1,62 @@ |
|||||||
package com.fr.design.widget.ui; |
package com.fr.design.widget.ui; |
||||||
|
|
||||||
|
import com.fr.design.constants.LayoutConstants; |
||||||
import com.fr.design.foldablepane.UIExpandablePane; |
import com.fr.design.foldablepane.UIExpandablePane; |
||||||
import com.fr.design.gui.ilable.UILabel; |
import com.fr.design.gui.ilable.UILabel; |
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
|
|
||||||
import com.fr.design.gui.itextfield.UITextField; |
import com.fr.design.gui.itextfield.UITextField; |
||||||
import com.fr.design.layout.FRGUIPaneFactory; |
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
import com.fr.form.ui.CheckBox; |
import com.fr.form.ui.CheckBox; |
||||||
import com.fr.general.Inter; |
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { |
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { |
||||||
private UITextField text; |
private UITextField text; |
||||||
|
|
||||||
public CheckBoxDefinePane() { |
public CheckBoxDefinePane() { |
||||||
this.iniComoponents(); |
this.iniComoponents(); |
||||||
} |
} |
||||||
|
|
||||||
private void iniComoponents() { |
private void iniComoponents() { |
||||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); |
text = new UITextField(8); |
||||||
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
JPanel panel = new JPanel(new BorderLayout()); |
||||||
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
panel.add(text, BorderLayout.CENTER); |
||||||
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane); |
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); |
||||||
textPane.add(new UILabel(Inter.getLocText("Text") + ":")); |
|
||||||
text = new UITextField(8); |
double f = TableLayout.FILL; |
||||||
textPane.add(text); |
double p = TableLayout.PREFERRED; |
||||||
this.add(uiExpandablePane); |
Component[][] components = new Component[][]{ |
||||||
} |
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), panel}, |
||||||
|
}; |
||||||
@Override |
double[] rowSize = {p}; |
||||||
protected String title4PopupWindow() { |
double[] columnSize = {p, f}; |
||||||
return "CheckBox"; |
int[][] rowCount = {{1, 1}}; |
||||||
} |
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); |
||||||
|
|
||||||
@Override |
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, pane); |
||||||
public void populateBean(CheckBox check) { |
pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); |
||||||
text.setText(check.getText()); |
|
||||||
} |
this.add(uiExpandablePane); |
||||||
|
} |
||||||
@Override |
|
||||||
public CheckBox updateBean() { |
@Override |
||||||
CheckBox box = new CheckBox(); |
protected String title4PopupWindow() { |
||||||
box.setText(text.getText()); |
return "CheckBox"; |
||||||
return box; |
} |
||||||
} |
|
||||||
|
@Override |
||||||
|
public void populateBean(CheckBox check) { |
||||||
|
text.setText(check.getText()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public CheckBox updateBean() { |
||||||
|
CheckBox box = new CheckBox(); |
||||||
|
box.setText(text.getText()); |
||||||
|
return box; |
||||||
|
} |
||||||
} |
} |
Loading…
Reference in new issue