Browse Source
* commit 'c785bce4d8277795220ffd1c1cf18d7cf7cd625b': 界面调整 界面调整 删除无用代码 代码调整 REPORT-3293 9.0设计器控件设置重画master
superman
7 years ago
13 changed files with 334 additions and 222 deletions
@ -1 +1,64 @@ |
|||||||
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : Shockway
* Date: 13-9-18
* Time: 下午2:17
*/
public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> {
private UICheckBox customDataCheckBox;
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30;
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30;
public CustomWritableRepeatEditorPane() {
this.initComponents();
}
@Override
protected JPanel setThirdContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false);
this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
JPanel otherContentPane = this.setForthContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
}
return contentPane;
}
public JPanel setValidatePane(){
JPanel otherContentPane = super.setValidatePane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5));
return otherContentPane;
}
protected abstract JPanel setForthContentPane();
protected void populateSubWritableRepeatEditorBean(T e) {
this.customDataCheckBox.setSelected(e.isCustomData());
populateSubCustomWritableRepeatEditorBean(e);
}
protected abstract void populateSubCustomWritableRepeatEditorBean(T e);
protected T updateSubWritableRepeatEditorBean() {
T e = updateSubCustomWritableRepeatEditorBean();
e.setCustomData(this.customDataCheckBox.isSelected());
return e;
}
protected abstract T updateSubCustomWritableRepeatEditorBean();
} |
package com.fr.design.widget.ui; |
||||||
|
|
||||||
|
import com.fr.base.GraphHelper; |
||||||
|
import com.fr.design.gui.icheckbox.UICheckBox; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.utils.gui.GUICoreUtils; |
||||||
|
import com.fr.form.ui.CustomWriteAbleRepeatEditor; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Author : Shockway |
||||||
|
* Date: 13-9-18 |
||||||
|
* Time: 下午2:17 |
||||||
|
*/ |
||||||
|
public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { |
||||||
|
|
||||||
|
private UICheckBox customDataCheckBox; |
||||||
|
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; |
||||||
|
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; |
||||||
|
|
||||||
|
public CustomWritableRepeatEditorPane() { |
||||||
|
this.initComponents(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected JPanel setThirdContentPane() { |
||||||
|
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||||
|
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||||
|
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); |
||||||
|
this.customDataCheckBox.setPreferredSize( |
||||||
|
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); |
||||||
|
JPanel otherContentPane = this.setForthContentPane(); |
||||||
|
return otherContentPane; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public JPanel setValidatePane(){ |
||||||
|
JPanel otherContentPane = super.setValidatePane(); |
||||||
|
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); |
||||||
|
return otherContentPane; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected abstract JPanel setForthContentPane(); |
||||||
|
|
||||||
|
protected void populateSubWritableRepeatEditorBean(T e) { |
||||||
|
this.customDataCheckBox.setSelected(e.isCustomData()); |
||||||
|
populateSubCustomWritableRepeatEditorBean(e); |
||||||
|
} |
||||||
|
|
||||||
|
protected abstract void populateSubCustomWritableRepeatEditorBean(T e); |
||||||
|
|
||||||
|
protected T updateSubWritableRepeatEditorBean() { |
||||||
|
T e = updateSubCustomWritableRepeatEditorBean(); |
||||||
|
e.setCustomData(this.customDataCheckBox.isSelected()); |
||||||
|
return e; |
||||||
|
} |
||||||
|
|
||||||
|
protected abstract T updateSubCustomWritableRepeatEditorBean(); |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue