Browse Source

无JIRA任务,代码规范

master
plough 7 years ago
parent
commit
b82ad6f4a4
  1. 26
      designer_form/src/com/fr/design/mainframe/FormArea.java
  2. 21
      designer_form/src/com/fr/design/mainframe/JForm.java

26
designer_form/src/com/fr/design/mainframe/FormArea.java

@ -35,6 +35,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private static final int ROTATIONS = 50; private static final int ROTATIONS = 50;
private static final int SHOWVALMAX = 400; private static final int SHOWVALMAX = 400;
private static final int SHOWVALMIN = 10; private static final int SHOWVALMIN = 10;
private static final int RESIZE_PANE_GAP = 8;
private FormDesigner designer; private FormDesigner designer;
private int horizontalValue = 0; private int horizontalValue = 0;
private int verticalValue = 0; private int verticalValue = 0;
@ -119,11 +120,10 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
slidePane = JFormSliderPane.getInstance(); slidePane = JFormSliderPane.getInstance();
slidePane.setPreferredSize(new Dimension(200, 20)); slidePane.setPreferredSize(new Dimension(200, 20));
JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(
JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ new JComponent[][]{{ tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"),
{tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"), heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane }},
heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane}}, rowSize, columnSize, RESIZE_PANE_GAP);
rowSize, columnSize, 8);
this.add(FormRulerLayout.BOTTOM, resizePane); this.add(FormRulerLayout.BOTTOM, resizePane);
setWidgetsConfig(); setWidgetsConfig();
// 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小 // 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小
@ -439,14 +439,13 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
int id = evt.getID(); int id = evt.getID();
switch (id) { switch (id) {
case MouseEvent.MOUSE_WHEEL: { case MouseEvent.MOUSE_WHEEL: {
int rotations = evt.getWheelRotation(); int value = this.verScrollBar.getValue() + evt.getWheelRotation() * ROTATIONS;
int value = this.verScrollBar.getValue() + rotations * ROTATIONS; value = Math.max(0, Math.min(value, verticalMax));
value = Math.min(value, verticalMax);
value = Math.max(0, value);
doLayout(); //加dolayout是因为每次滚动都要重置 Max的大小 doLayout(); //加dolayout是因为每次滚动都要重置 Max的大小
this.verScrollBar.setValue(value); this.verScrollBar.setValue(value);
break; break;
} }
default:
} }
} }
@ -743,9 +742,12 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
} }
private class FormRulerLayout extends RulerLayout { private class FormRulerLayout extends RulerLayout {
private int DESIGNERWIDTH = 960; private static final int DESIGNER_WIDTH = 960;
private int DESIGNERHEIGHT = 540; private static final int DESIGNER_HEIGHT = 540;
private int TOPGAP = 8; private static final int TOPGAP = 8;
private int DESIGNERWIDTH = DESIGNER_WIDTH;
private int DESIGNERHEIGHT = DESIGNER_HEIGHT;
public FormRulerLayout() { public FormRulerLayout() {
super(); super();

21
designer_form/src/com/fr/design/mainframe/JForm.java

@ -93,6 +93,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override @Override
public void refreshEastPropertiesPane() { public void refreshEastPropertiesPane() {
// 暂时用不到,遇到的时候再加刷新右侧tab面板的代码
return;
} }
@Override @Override
@ -126,7 +128,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override @Override
public void setJTemplateResolution(int resolution) { public void setJTemplateResolution(int resolution) {
return;
} }
@Override @Override
@ -270,14 +272,14 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
} }
public void setSheetCovered(boolean isCovered) { public void setSheetCovered(boolean isCovered) {
return;
} }
/** /**
* 刷新容器 * 刷新容器
*/ */
public void refreshContainer() { public void refreshContainer() {
return;
} }
/** /**
@ -289,6 +291,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override @Override
public void setScale(int resolution) { public void setScale(int resolution) {
return;
} }
@Override @Override
@ -464,12 +467,12 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override @Override
public ShortCut[] shortcut4TemplateMenu() { public ShortCut[] shortcut4TemplateMenu() {
if (this.index == FORM_TAB) { if (this.index == FORM_TAB) {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ return (ShortCut[]) ArrayUtils.addAll( new ShortCut[]{
new TemplateParameterAction(this), new TemplateParameterAction(this),
new FormMobileAttrAction(this) new FormMobileAttrAction(this)
}, new ShortCut[0]); }, new ShortCut[0]);
} else { } else {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ return (ShortCut[]) ArrayUtils.addAll( new ShortCut[]{
new TemplateParameterAction(this), new TemplateParameterAction(this),
new FormMobileAttrAction(this) new FormMobileAttrAction(this)
}, this.elementCaseDesign.shortcut4TemplateMenu()); }, this.elementCaseDesign.shortcut4TemplateMenu());
@ -680,8 +683,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return; return;
} }
if (formDesign.isReportBlockEditing()) { if (formDesign.isReportBlockEditing() && elementCaseDesign != null) {
if (elementCaseDesign != null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT);
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
@ -690,7 +692,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane()); EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane());
return; return;
} }
}
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
@ -699,6 +700,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
refreshWidgetLibPane();
}
private void refreshWidgetLibPane() {
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) { if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() { new Thread() {
public void run() { public void run() {

Loading…
Cancel
Save