|
|
@ -42,7 +42,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver |
|
|
|
|
|
|
|
|
|
|
|
// 添加一公式编辑器按钮
|
|
|
|
// 添加一公式编辑器按钮
|
|
|
|
formulaTextFieldButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
|
|
|
formulaTextFieldButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
|
|
|
formulaTextFieldButton.setToolTipText(Inter.getLocText("Formula") + "..."); |
|
|
|
formulaTextFieldButton.setToolTipText(Inter.getLocText("FR-Designer_Formula") + "..."); |
|
|
|
formulaTextFieldButton.setPreferredSize(new Dimension(24, 20)); |
|
|
|
formulaTextFieldButton.setPreferredSize(new Dimension(24, 20)); |
|
|
|
formulaTextFieldButton.setOpaque(false); |
|
|
|
formulaTextFieldButton.setOpaque(false); |
|
|
|
formulaTextFieldButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
|
|
|
formulaTextFieldButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
|
|
@ -56,11 +56,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void doOk() { |
|
|
|
public void doOk() { |
|
|
|
Formula fm = formulaPane.update(); |
|
|
|
Formula fm = formulaPane.update(); |
|
|
|
if (fm.getContent().length() <= 1) { |
|
|
|
populateTextField(fm); |
|
|
|
formulaTextField.setText("$$$"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
formulaTextField.setText(fm.getContent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
okEvent(); |
|
|
|
okEvent(); |
|
|
|
} |
|
|
|
} |
|
|
|
}).setVisible(true); |
|
|
|
}).setVisible(true); |
|
|
@ -69,6 +65,14 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver |
|
|
|
initLayout(); |
|
|
|
initLayout(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void populateTextField(Formula fm) { |
|
|
|
|
|
|
|
if (fm.getContent().length() <= 1) { |
|
|
|
|
|
|
|
formulaTextField.setText("$$$"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
formulaTextField.setText(fm.getContent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initLayout() { |
|
|
|
protected void initLayout() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|