|
|
@ -4,6 +4,7 @@ import com.fr.base.mobile.MobileFitAttrState; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
@ -11,19 +12,14 @@ import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 报表块-移动端属性面板 |
|
|
|
* 报表块-移动端属性面板 |
|
|
@ -45,13 +41,27 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ |
|
|
|
private UICheckBox heightRestrictCheckBox; // 手机显示限制高度复选框
|
|
|
|
private UICheckBox heightRestrictCheckBox; // 手机显示限制高度复选框
|
|
|
|
private UILabel maxHeightLabel; |
|
|
|
private UILabel maxHeightLabel; |
|
|
|
private UISpinner maxHeightSpinner; // 最大高度Spinner
|
|
|
|
private UISpinner maxHeightSpinner; // 最大高度Spinner
|
|
|
|
|
|
|
|
private AttributeChangeListener changeListener; |
|
|
|
|
|
|
|
|
|
|
|
public ElementCaseDefinePane (XCreator xCreator) { |
|
|
|
public ElementCaseDefinePane (XCreator xCreator) { |
|
|
|
this.xCreator = xCreator; |
|
|
|
this.xCreator = xCreator; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected void initContentPane() {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected JPanel createContentPane() { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String getIconPath() { |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String title4PopupWindow() { |
|
|
|
return "ElementCase"; |
|
|
|
return "ElementCase"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -86,39 +96,68 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ |
|
|
|
UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper); |
|
|
|
UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper); |
|
|
|
this.add(folderPane, BorderLayout.NORTH); |
|
|
|
this.add(folderPane, BorderLayout.NORTH); |
|
|
|
this.bingListeners2Widgets(); |
|
|
|
this.bingListeners2Widgets(); |
|
|
|
|
|
|
|
this.setGlobalNames(); |
|
|
|
this.repaint(); |
|
|
|
this.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void bingListeners2Widgets() { |
|
|
|
private void bingListeners2Widgets() { |
|
|
|
this.hComboBox.addActionListener(new ActionListener() { |
|
|
|
reInitAllListeners(); |
|
|
|
|
|
|
|
this.changeListener = new AttributeChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void attributeChange() { |
|
|
|
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1)); |
|
|
|
update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 后台初始化所有事件. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void reInitAllListeners() { |
|
|
|
|
|
|
|
initListener(this); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.vComboBox.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void populate(FormDesigner designer) { |
|
|
|
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1)); |
|
|
|
this.designer = designer; |
|
|
|
|
|
|
|
this.addAttributeChangeListener(changeListener); |
|
|
|
|
|
|
|
ElementCaseEditor elementCaseEditor = (ElementCaseEditor)xCreator.toData(); |
|
|
|
|
|
|
|
this.hComboBox.setSelectedIndex(elementCaseEditor.getHorziontalAttr().getState() - 1); |
|
|
|
|
|
|
|
this.vComboBox.setSelectedIndex(elementCaseEditor.getVerticalAttr().getState() - 1); |
|
|
|
|
|
|
|
this.heightRestrictCheckBox.setSelected(elementCaseEditor.isHeightRestrict()); |
|
|
|
|
|
|
|
this.maxHeightLabel.setVisible(elementCaseEditor.isHeightRestrict()); |
|
|
|
|
|
|
|
this.maxHeightSpinner.setVisible(elementCaseEditor.isHeightRestrict()); |
|
|
|
|
|
|
|
this.maxHeightSpinner.setValue(elementCaseEditor.getHeightPercent()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.heightRestrictCheckBox.addItemListener(new ItemListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void update() { |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
|
|
|
|
|
|
|
|
String globalName = this.getGlobalName(); |
|
|
|
|
|
|
|
switch (globalName) { |
|
|
|
|
|
|
|
case "hComboBox": |
|
|
|
|
|
|
|
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "vComboBox": |
|
|
|
|
|
|
|
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "heightRestrictCheckBox": |
|
|
|
boolean isHeightRestrict = heightRestrictCheckBox.isSelected(); |
|
|
|
boolean isHeightRestrict = heightRestrictCheckBox.isSelected(); |
|
|
|
((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict); |
|
|
|
((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict); |
|
|
|
maxHeightSpinner.setVisible(isHeightRestrict); |
|
|
|
maxHeightSpinner.setVisible(isHeightRestrict); |
|
|
|
maxHeightLabel.setVisible(isHeightRestrict); |
|
|
|
maxHeightLabel.setVisible(isHeightRestrict); |
|
|
|
} |
|
|
|
break; |
|
|
|
}); |
|
|
|
case "maxHeightSpinner": |
|
|
|
|
|
|
|
|
|
|
|
this.maxHeightSpinner.addChangeListener(new ChangeListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
|
|
|
((ElementCaseEditor)xCreator.toData()).setHeightPercent(maxHeightSpinner.getValue()); |
|
|
|
((ElementCaseEditor)xCreator.toData()).setHeightPercent(maxHeightSpinner.getValue()); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setGlobalNames() { |
|
|
|
|
|
|
|
this.hComboBox.setGlobalName("hComboBox"); |
|
|
|
|
|
|
|
this.vComboBox.setGlobalName("vComboBox"); |
|
|
|
|
|
|
|
this.heightRestrictCheckBox.setGlobalName("heightRestrictCheckBox"); |
|
|
|
|
|
|
|
this.maxHeightSpinner.setGlobalName("maxHeightSpinner"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|