forked from GitHub/gf-core
added a prominent place for the current tooltip description + bugfixes there
This commit is contained in:
@@ -217,7 +217,9 @@ KeyListener, FocusListener {
|
|||||||
private JButton right = new JButton(">");
|
private JButton right = new JButton(">");
|
||||||
/** Moving the focus to the next metavariable */
|
/** Moving the focus to the next metavariable */
|
||||||
private JButton rightMeta = new JButton(">?");
|
private JButton rightMeta = new JButton(">?");
|
||||||
private JLabel actionOnSubterm = new JLabel("Select Action on Subterm");
|
private final static String actionOnSubtermString = "Select Action on Subterm";
|
||||||
|
private JLabel subtermNameLabel = new JLabel();
|
||||||
|
private JLabel subtermDescLabel = new JLabel();
|
||||||
/** Refining with term or linearization from typed string or file */
|
/** Refining with term or linearization from typed string or file */
|
||||||
private JButton read = new JButton("Read");
|
private JButton read = new JButton("Read");
|
||||||
// private JButton parse = new JButton("Parse");
|
// private JButton parse = new JButton("Parse");
|
||||||
@@ -249,7 +251,7 @@ KeyListener, FocusListener {
|
|||||||
/** the panel that contains only the navigation buttons */
|
/** the panel that contains only the navigation buttons */
|
||||||
private JPanel middlePanelUp = new JPanel();
|
private JPanel middlePanelUp = new JPanel();
|
||||||
/** the panel that vontains the the explanatory text for the refinement menu */
|
/** the panel that vontains the the explanatory text for the refinement menu */
|
||||||
private JPanel middlePanelDown = new JPanel();
|
private JPanel middlePanelDown = new JPanel(new BorderLayout());
|
||||||
/** splits between tree and lin above and nav buttons and refinements below */
|
/** splits between tree and lin above and nav buttons and refinements below */
|
||||||
private JSplitPane centerPanel;
|
private JSplitPane centerPanel;
|
||||||
/** the window that contains the refinements when in split mode */
|
/** the window that contains the refinements when in split mode */
|
||||||
@@ -1071,7 +1073,8 @@ KeyListener, FocusListener {
|
|||||||
middlePanelUp.add(top);
|
middlePanelUp.add(top);
|
||||||
middlePanelUp.add(right);
|
middlePanelUp.add(right);
|
||||||
middlePanelUp.add(rightMeta);
|
middlePanelUp.add(rightMeta);
|
||||||
middlePanelDown.add(actionOnSubterm);
|
middlePanelDown.add(subtermNameLabel, BorderLayout.WEST);
|
||||||
|
middlePanelDown.add(subtermDescLabel, BorderLayout.CENTER);
|
||||||
middlePanel.setLayout(new BorderLayout());
|
middlePanel.setLayout(new BorderLayout());
|
||||||
middlePanel.add(middlePanelUp, BorderLayout.NORTH);
|
middlePanel.add(middlePanelUp, BorderLayout.NORTH);
|
||||||
middlePanel.add(middlePanelDown, BorderLayout.CENTER);
|
middlePanel.add(middlePanelDown, BorderLayout.CENTER);
|
||||||
@@ -2444,7 +2447,8 @@ KeyListener, FocusListener {
|
|||||||
top.setFont(newFont);
|
top.setFont(newFont);
|
||||||
right.setFont(newFont);
|
right.setFont(newFont);
|
||||||
rightMeta.setFont(newFont);
|
rightMeta.setFont(newFont);
|
||||||
actionOnSubterm.setFont(newFont);
|
subtermDescLabel.setFont(newFont);
|
||||||
|
subtermNameLabel.setFont(newFont);
|
||||||
read.setFont(newFont);
|
read.setFont(newFont);
|
||||||
alpha.setFont(newFont);
|
alpha.setFont(newFont);
|
||||||
random.setFont(newFont);
|
random.setFont(newFont);
|
||||||
@@ -2630,13 +2634,13 @@ KeyListener, FocusListener {
|
|||||||
if (!node.isMeta()) {
|
if (!node.isMeta()) {
|
||||||
childPrintname = this.printnameManager.getPrintname(node.getFun());
|
childPrintname = this.printnameManager.getPrintname(node.getFun());
|
||||||
}
|
}
|
||||||
|
Printname parentPrintname = null;
|
||||||
if (childPrintname != null) {
|
if (childPrintname != null) {
|
||||||
//we know this one
|
//we know this one
|
||||||
and = new RefinedAstNodeData(childPrintname, node);
|
and = new RefinedAstNodeData(childPrintname, node);
|
||||||
} else if (parent != null && node.isMeta()) {
|
} else if (parent != null && node.isMeta()) {
|
||||||
//new child without refinement
|
//new child without refinement
|
||||||
AstNodeData parentAnd = (AstNodeData)parent.getUserObject();
|
AstNodeData parentAnd = (AstNodeData)parent.getUserObject();
|
||||||
Printname parentPrintname = null;
|
|
||||||
if (parentAnd != null) {
|
if (parentAnd != null) {
|
||||||
parentPrintname = parentAnd.getPrintname();
|
parentPrintname = parentAnd.getPrintname();
|
||||||
}
|
}
|
||||||
@@ -2677,6 +2681,27 @@ KeyListener, FocusListener {
|
|||||||
if (treeLogger.isLoggable(Level.FINER)) {
|
if (treeLogger.isLoggable(Level.FINER)) {
|
||||||
treeLogger.finer("new selected index "+ index);
|
treeLogger.finer("new selected index "+ index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the description of the crrent parameter to a more
|
||||||
|
// prominent place
|
||||||
|
String paramName = null;
|
||||||
|
int paramPosition = -1;
|
||||||
|
if (parentPrintname != null) {
|
||||||
|
paramPosition = parent.getChildCount() - 1;
|
||||||
|
paramName = parentPrintname.getParamName(paramPosition);
|
||||||
|
}
|
||||||
|
if (paramName == null) {
|
||||||
|
subtermNameLabel.setText(actionOnSubtermString);
|
||||||
|
subtermDescLabel.setText("");
|
||||||
|
} else {
|
||||||
|
subtermNameLabel.setText("<html><b>" + paramName + ": </b></html>");
|
||||||
|
String paramDesc = parentPrintname.getParamDescription(paramPosition);
|
||||||
|
if (paramDesc == null) {
|
||||||
|
subtermDescLabel.setText("");
|
||||||
|
} else {
|
||||||
|
subtermDescLabel.setText("<html>" + paramDesc + "</html>");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3615,7 +3640,9 @@ KeyListener, FocusListener {
|
|||||||
File file = fc.getSelectedFile();
|
File file = fc.getSelectedFile();
|
||||||
// importing a new grammar :
|
// importing a new grammar :
|
||||||
newObject = false;
|
newObject = false;
|
||||||
statusLabel.setText(status);
|
statusLabel.setText(status);
|
||||||
|
subtermDescLabel.setText("");
|
||||||
|
subtermNameLabel.setText("");
|
||||||
listModel.clear();
|
listModel.clear();
|
||||||
resetTree(tree);
|
resetTree(tree);
|
||||||
resetNewCategoryMenu();
|
resetNewCategoryMenu();
|
||||||
@@ -3654,7 +3681,9 @@ KeyListener, FocusListener {
|
|||||||
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
newObject = false;
|
newObject = false;
|
||||||
statusLabel.setText(status);
|
statusLabel.setText(status);
|
||||||
|
subtermDescLabel.setText("");
|
||||||
|
subtermNameLabel.setText("");
|
||||||
listModel.clear();
|
listModel.clear();
|
||||||
resetTree(tree);
|
resetTree(tree);
|
||||||
langMenuModel.resetLanguages();
|
langMenuModel.resetLanguages();
|
||||||
|
|||||||
@@ -429,6 +429,15 @@ class Printname {
|
|||||||
String result = "<html><dl>" + text + "</dl></html>";
|
String result = "<html><dl>" + text + "</dl></html>";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* looks up the description for parameter number 'which' and returns it.
|
||||||
|
* Returns null, if no parameter description is present.
|
||||||
|
* @param which The number of the parameter
|
||||||
|
* @return s.a.
|
||||||
|
*/
|
||||||
|
public String getParamDescription(int which) {
|
||||||
|
return (String)paramTexts.get(which);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wraps all parameters together with their explanatory text into
|
* wraps all parameters together with their explanatory text into
|
||||||
|
|||||||
Reference in New Issue
Block a user