|
|
@ -341,13 +341,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
// 获得焦点时 安装
|
|
|
|
// 获得焦点时 安装
|
|
|
|
if (autoCompletion == null && autoCompletionCheck.isSelected()) { |
|
|
|
installAutoCompletion(); |
|
|
|
CompletionProvider provider = createCompletionProvider(); |
|
|
|
|
|
|
|
autoCompletion = new FormulaPaneAutoCompletion(provider); |
|
|
|
|
|
|
|
autoCompletion.setListCellRenderer(new CompletionCellRenderer()); |
|
|
|
|
|
|
|
autoCompletion.install(formulaTextArea); |
|
|
|
|
|
|
|
autoCompletion.installVariableTree(variableTreeAndDescriptionArea); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -410,6 +404,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void installAutoCompletion() { |
|
|
|
|
|
|
|
if (autoCompletion == null && autoCompletionCheck.isSelected()) { |
|
|
|
|
|
|
|
CompletionProvider provider = createCompletionProvider(); |
|
|
|
|
|
|
|
autoCompletion = new FormulaPaneAutoCompletion(provider); |
|
|
|
|
|
|
|
autoCompletion.setListCellRenderer(new CompletionCellRenderer()); |
|
|
|
|
|
|
|
autoCompletion.install(formulaTextArea); |
|
|
|
|
|
|
|
autoCompletion.installVariableTree(variableTreeAndDescriptionArea); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void extendCheckBoxPane(JPanel checkBoxPane) { |
|
|
|
protected void extendCheckBoxPane(JPanel checkBoxPane) { |
|
|
|
|
|
|
|
|
|
|
@ -795,11 +799,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void calculateFormula() { |
|
|
|
private final ActionListener calculateActionListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
String formulaText = formulaTextArea.getText().trim(); |
|
|
|
String formulaText = formulaTextArea.getText().trim(); |
|
|
|
String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText); |
|
|
|
String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText); |
|
|
|
if (unSupportFormula != null) { |
|
|
|
if (unSupportFormula != null) { |
|
|
@ -848,6 +848,14 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
confirmCheckResult(checkResult, messageTips); |
|
|
|
confirmCheckResult(checkResult, messageTips); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ActionListener calculateActionListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
calculateFormula(); |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) { |
|
|
|
private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) { |
|
|
|