|
|
@ -246,47 +246,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class DoubleClick extends MouseAdapter { |
|
|
|
public class DoubleClick extends MouseAdapter { |
|
|
|
String singlePressContent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String doublePressContent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
int index = tipsList.getSelectedIndex(); |
|
|
|
int index = tipsList.getSelectedIndex(); |
|
|
|
if (index != -1) { |
|
|
|
if (index != -1) { |
|
|
|
if (e.getClickCount() == 1) { |
|
|
|
String currentLineContent = (String) listModel.getElementAt(index); |
|
|
|
singlePressContent = (String) listModel.getElementAt(index); |
|
|
|
if (e.getClickCount() == 2) { |
|
|
|
} else if (e.getClickCount() == 2) { |
|
|
|
|
|
|
|
doublePressContent = (String) listModel.getElementAt(index); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
|
|
|
|
int index = tipsList.getSelectedIndex(); |
|
|
|
|
|
|
|
if (index != -1) { |
|
|
|
|
|
|
|
if (e.getClickCount() == 1) { |
|
|
|
|
|
|
|
if (ComparatorUtils.equals((String) listModel.getElementAt(index), singlePressContent)) { |
|
|
|
|
|
|
|
singleClickActuator(singlePressContent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (e.getClickCount() == 2) { |
|
|
|
|
|
|
|
if (ComparatorUtils.equals((String) listModel.getElementAt(index), doublePressContent)) { |
|
|
|
|
|
|
|
doubleClickActuator(doublePressContent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void singleClickActuator(String currentLineContent) { |
|
|
|
|
|
|
|
refreshDescriptionTextArea(currentLineContent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formulaTextArea.requestFocusInWindow(); |
|
|
|
|
|
|
|
fixFunctionNameList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void doubleClickActuator(String currentLineContent) { |
|
|
|
|
|
|
|
if (ifHasBeenWriten == 0) { |
|
|
|
if (ifHasBeenWriten == 0) { |
|
|
|
formulaTextArea.setForeground(Color.black); |
|
|
|
formulaTextArea.setForeground(Color.black); |
|
|
|
formulaTextArea.setText(""); |
|
|
|
formulaTextArea.setText(""); |
|
|
@ -310,6 +276,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
insertPosition = position; |
|
|
|
insertPosition = position; |
|
|
|
ifHasBeenWriten = 1; |
|
|
|
ifHasBeenWriten = 1; |
|
|
|
listModel.removeAllElements(); |
|
|
|
listModel.removeAllElements(); |
|
|
|
|
|
|
|
} else if (e.getClickCount() == 1) { |
|
|
|
|
|
|
|
refreshDescriptionTextArea(currentLineContent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formulaTextArea.requestFocusInWindow(); |
|
|
|
|
|
|
|
fixFunctionNameList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -807,7 +780,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
public void valueChanged(TreeSelectionEvent e) { |
|
|
|
public void valueChanged(TreeSelectionEvent e) { |
|
|
|
DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent(); |
|
|
|
DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent(); |
|
|
|
Object selectedValue = selectedTreeNode.getUserObject(); |
|
|
|
Object selectedValue = selectedTreeNode.getUserObject(); |
|
|
|
Object selectedParentValue = ((DefaultMutableTreeNode) selectedTreeNode.getParent()).getUserObject(); |
|
|
|
Object selectedParentValue = ((DefaultMutableTreeNode)selectedTreeNode.getParent()).getUserObject(); |
|
|
|
|
|
|
|
|
|
|
|
if (selectedValue == null) { |
|
|
|
if (selectedValue == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|