|
From: <de...@us...> - 2013-02-18 18:18:03
|
Revision: 8277
http://fudaa.svn.sourceforge.net/fudaa/?rev=8277&view=rev
Author: deniger
Date: 2013-02-18 18:17:46 +0000 (Mon, 18 Feb 2013)
Log Message:
-----------
variables
Modified Paths:
--------------
trunk/framework/ctulu-common/src/main/java/org/fudaa/ctulu/editor/CtuluExprGUI.java
Modified: trunk/framework/ctulu-common/src/main/java/org/fudaa/ctulu/editor/CtuluExprGUI.java
===================================================================
--- trunk/framework/ctulu-common/src/main/java/org/fudaa/ctulu/editor/CtuluExprGUI.java 2013-02-15 16:20:05 UTC (rev 8276)
+++ trunk/framework/ctulu-common/src/main/java/org/fudaa/ctulu/editor/CtuluExprGUI.java 2013-02-18 18:17:46 UTC (rev 8277)
@@ -55,8 +55,9 @@
* @version $Id: CtuluExprGUI.java,v 1.9 2006-09-19 14:36:55 deniger Exp $
*/
private final class InfoUpdater implements ListSelectionListener {
+
/**
- *
+ *
*/
private final BuLabel lb_;
@@ -168,7 +169,6 @@
private static final class VariableModel extends AbstractListModel implements ComboBoxModel {
final List l_;
-
Object selected_;
VariableModel(final List _l) {
@@ -207,7 +207,7 @@
@Override
public Component getListCellRendererComponent(final JList _list, final Object _value, final int _index,
- final boolean _isSelected, final boolean _cellHasFocus) {
+ final boolean _isSelected, final boolean _cellHasFocus) {
final Component c = super.getListCellRendererComponent(_list, _value, _index, _isSelected, _cellHasFocus);
if (_value == null) {
return c;
@@ -223,21 +223,21 @@
buf.append("</td></tr><tr><td>");
if (expr_.containsDescFor(name)) {
buf.append(CtuluLib.getS("Desc")).append("</td><td>: ").append(expr_.getDesc(name))
- .append("</td></tr><tr><td>");
+ .append("</td></tr><tr><td>");
}
buf.append(CtuluLib.getS("Valeur courante")).append("</td><td>: ").append(CtuluLibString.ESPACE).append(
- v.getValue());
+ v.getValue());
buf.append("</td></tr></table></body></html>");
setToolTipText(buf.toString());
return c;
}
}
- static class TableCellRenderer extends DefaultTableCellRenderer {
+ static class TableCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(final JTable _table, final Object _value, final boolean _isSelected,
- final boolean _hasFocus, final int _row, final int _column) {
+ final boolean _hasFocus, final int _row, final int _column) {
final Component r = super.getTableCellRendererComponent(_table, _value, _isSelected, _hasFocus, _row, _column);
if (_value == null) {
setText(CtuluLib.getS("Pr\xE9ciser une valeur"));
@@ -264,44 +264,26 @@
return ((Variable) _o1).getName().compareTo(((Variable) _o2).getName());
}
}
-
-
-
private boolean isValid_;
-
BuButton btEvaluate_;
-
final BuButton btValid_;
-
final transient CtuluExpr expr_;
-
final VariableModel fctModel_;
-
final transient ListSelectionModel fctSelected_;
-
final VariableModel model_;
-
final VariableModel cstModel_;
-
BuTextField tfResult_;
-
final BuTextArea txt_;
-
final BuLabel txtError_;
-
transient Variable[] varToSet_;
-
final transient ListSelectionModel varSelected_;
-
final transient ListSelectionModel cstSelected_;
-
final ValueTableModel tModel_;
-
final BuTable table_;
/**
* Construit a partir de l'expression par default.
- *
+ *
* @param _expr l'expression
*/
public CtuluExprGUI(final CtuluExpr _expr) {
@@ -412,28 +394,26 @@
cstSelected_.addListSelectionListener(listener);
varSelected_.addListSelectionListener(listener);
listVar.addFocusListener(new FocusListener() {
-
@Override
- public void focusLost(final FocusEvent _e) {}
+ public void focusLost(final FocusEvent _e) {
+ }
@Override
public void focusGained(final FocusEvent _e) {
listener.updateVar();
}
-
});
listCst.addFocusListener(new FocusListener() {
-
@Override
- public void focusLost(final FocusEvent _e) {}
+ public void focusLost(final FocusEvent _e) {
+ }
@Override
public void focusGained(final FocusEvent _e) {
listener.updateCst();
}
-
});
}
@@ -442,7 +422,6 @@
_listFct.setModel(fctModel_);
fctSelected_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
_listFct.addMouseListener(new MouseAdapter() {
-
@Override
public void mouseClicked(final MouseEvent _e) {
if (_e.getClickCount() >= 2) {
@@ -454,24 +433,20 @@
private void initCstVar(final BuEmptyList _listVar, final BuEmptyList _listCst) {
_listVar.addMouseListener(new MouseAdapter() {
-
@Override
public void mouseClicked(final MouseEvent _e) {
if (_e.getClickCount() >= 2) {
insertVar(model_, varSelected_);
}
}
-
});
_listCst.addMouseListener(new MouseAdapter() {
-
@Override
public void mouseClicked(final MouseEvent _e) {
if (_e.getClickCount() >= 2) {
insertVar(cstModel_, cstSelected_);
}
}
-
});
_listVar.setModel(model_);
_listCst.setModel(cstModel_);
@@ -484,6 +459,10 @@
return isValid_;
}
+ public BuTextArea getTxtArea() {
+ return txt_;
+ }
+
private void updateBt() {
btValid_.setEnabled(true);
if (btEvaluate_ != null) {
@@ -501,7 +480,7 @@
} else {
txtError_.setForeground(Color.RED);
txtError_.setText(expr_.getParser().getError(0)
- + (expr_.getParser().getNbError() > 0 ? "..." : CtuluLibString.EMPTY_STRING));
+ + (expr_.getParser().getNbError() > 0 ? "..." : CtuluLibString.EMPTY_STRING));
txtError_.setToolTipText(expr_.getParser().getHtmlError());
}
btValid_.setEnabled(false);
@@ -596,9 +575,9 @@
}
public String getExprText() {
- String txt = txt_.getText();
- txt=txt.replace('\r', ' ');
- txt=txt.replace('\n', ' ');
+ String txt = txt_.getText();
+ txt = txt.replace('\r', ' ');
+ txt = txt.replace('\n', ' ');
return txt;
}
@@ -611,5 +590,4 @@
public void removeUpdate(final DocumentEvent _e) {
updateBt();
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|