Révision 1219
| tmp/org.txm.utils/src/org/txm/utils/logger/MessageBox.java (revision 1219) | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
import java.util.logging.Level; |
| 31 | 31 |
|
| 32 |
import javax.swing.SwingUtilities; |
|
| 33 |
|
|
| 32 | 34 |
import org.txm.utils.messages.UtilsCoreMessages; |
| 33 | 35 |
|
| 34 | 36 |
// TODO: Auto-generated Javadoc |
| ... | ... | |
| 179 | 181 |
} |
| 180 | 182 |
|
| 181 | 183 |
/** |
| 182 |
* Show.
|
|
| 184 |
* Displays a Swing alert pop up (in the Swing thread).
|
|
| 183 | 185 |
* |
| 184 | 186 |
* @param title the title |
| 185 | 187 |
* @param message the message |
| 186 | 188 |
* @param level the level |
| 187 | 189 |
*/ |
| 188 |
public static void show(String title, String message, int level) {
|
|
| 189 |
if (level > 900) {
|
|
| 190 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 191 |
javax.swing.JOptionPane.ERROR_MESSAGE); |
|
| 192 |
} else if (level > 800) {
|
|
| 193 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 194 |
javax.swing.JOptionPane.WARNING_MESSAGE); |
|
| 195 |
} else if (level > 700) {
|
|
| 196 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 197 |
javax.swing.JOptionPane.INFORMATION_MESSAGE); |
|
| 198 |
} else// if (level > 600) |
|
| 199 |
{
|
|
| 200 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 201 |
javax.swing.JOptionPane.CLOSED_OPTION); |
|
| 202 |
} |
|
| 190 |
public static void show(final String title, final String message, final int level) {
|
|
| 191 |
|
|
| 192 |
SwingUtilities.invokeLater(new Runnable() {
|
|
| 193 |
|
|
| 194 |
@Override |
|
| 195 |
public void run() {
|
|
| 196 |
|
|
| 197 |
if (level > 900) {
|
|
| 198 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 199 |
javax.swing.JOptionPane.ERROR_MESSAGE); |
|
| 200 |
} else if (level > 800) {
|
|
| 201 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 202 |
javax.swing.JOptionPane.WARNING_MESSAGE); |
|
| 203 |
} else if (level > 700) {
|
|
| 204 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 205 |
javax.swing.JOptionPane.INFORMATION_MESSAGE); |
|
| 206 |
} else// if (level > 600) |
|
| 207 |
{
|
|
| 208 |
javax.swing.JOptionPane.showMessageDialog(null, message, title, |
|
| 209 |
javax.swing.JOptionPane.CLOSED_OPTION); |
|
| 210 |
} |
|
| 211 |
} |
|
| 212 |
}); |
|
| 213 |
|
|
| 203 | 214 |
} |
| 204 | 215 |
|
| 205 | 216 |
} |
| tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java (revision 1219) | ||
|---|---|---|
| 138 | 138 |
new StreamHog(p.getErrorStream(), false); |
| 139 | 139 |
p.waitFor(); |
| 140 | 140 |
} catch (Exception e) {
|
| 141 |
System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
|
|
| 141 |
Log.severe("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
|
|
| 142 | 142 |
e.printStackTrace(); |
| 143 | 143 |
return; |
| 144 | 144 |
} |
| 145 | 145 |
} |
| 146 | 146 |
|
| 147 | 147 |
if (!execFile.exists()) {
|
| 148 |
System.out.println("Cannot find R executable file: "+execFile);
|
|
| 148 |
Log.severe("Cannot find R executable file: "+execFile);
|
|
| 149 | 149 |
return; |
| 150 | 150 |
} |
| 151 | 151 |
|
| 152 | 152 |
if (!execFile.canExecute()) {
|
| 153 |
System.out.println("File right setting error, cannot execute: "+execFile);
|
|
| 153 |
Log.severe("File right setting error, cannot execute: "+execFile);
|
|
| 154 | 154 |
return; |
| 155 | 155 |
} |
| 156 | 156 |
|
| tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 1219) | ||
|---|---|---|
| 27 | 27 |
// |
| 28 | 28 |
package org.txm.ca.rcp.handlers; |
| 29 | 29 |
|
| 30 |
import javax.swing.SwingUtilities; |
|
| 31 |
|
|
| 30 | 32 |
import org.eclipse.core.commands.ExecutionEvent; |
| 31 | 33 |
import org.eclipse.core.commands.ExecutionException; |
| 32 | 34 |
import org.eclipse.jface.dialogs.MessageDialog; |
| ... | ... | |
| 132 | 134 |
Property property = index.getProperties().get(0); |
| 133 | 135 |
|
| 134 | 136 |
if (index.getPartition().getPartsCount() < 4) {
|
| 135 |
// FIXME: remove this swing code that freeze the UI |
|
| 137 |
// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
|
|
| 136 | 138 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_13); |
| 137 | 139 |
return null; |
| 138 | 140 |
} |
| 139 | 141 |
if (index.hasBeenComputedOnce() && index.getAllLines().size() < 4) {
|
| 140 |
// FIXME: remove this swing code that freeze the UI |
|
| 142 |
// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
|
|
| 141 | 143 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_1); |
| 142 | 144 |
return null; |
| 143 | 145 |
} |
| ... | ... | |
| 153 | 155 |
Log.info(NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_0, lexicalTable, property)); |
| 154 | 156 |
|
| 155 | 157 |
if (lexicalTable.getNColumns() < 4) {
|
| 156 |
// FIXME: remove this swing code that freeze the UI |
|
| 158 |
// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
|
|
| 157 | 159 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_13); |
| 158 | 160 |
return null; |
| 159 | 161 |
} |
| 160 | 162 |
if (lexicalTable.getNRows() < 4) {
|
| 161 |
// FIXME: remove this swing code that freeze the UI |
|
| 163 |
// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
|
|
| 162 | 164 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_1); |
| 163 | 165 |
return null; |
| 164 | 166 |
} |
| tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 1219) | ||
|---|---|---|
| 716 | 716 |
|
| 717 | 717 |
@Override |
| 718 | 718 |
public String getSimpleName() {
|
| 719 |
try {
|
|
| 720 |
if (this.hasBeenComputedOnce) {
|
|
| 721 |
return this.getParent().getSimpleName() + " (" + this.firstDimension + "," + this.secondDimension + ")";
|
|
| 722 |
} else {
|
|
| 723 |
return ""; |
|
| 724 |
} |
|
| 725 |
|
|
| 726 |
} |
|
| 727 |
catch (Exception e) {
|
|
| 728 |
return this.getEmptyName(); |
|
| 729 |
} |
|
| 719 |
return this.getParent().getSimpleName() + " (" + this.firstDimension + "," + this.secondDimension + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
| 730 | 720 |
} |
| 731 | 721 |
|
| 732 | 722 |
@Override |
| tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1219) | ||
|---|---|---|
| 564 | 564 |
|
| 565 | 565 |
@Override |
| 566 | 566 |
public String getSimpleName() {
|
| 567 |
if (statsData != null) {
|
|
| 567 |
// if (statsData != null) {
|
|
| 568 | 568 |
StringBuilder strb = new StringBuilder(); |
| 569 | 569 |
if (property != null) {
|
| 570 | 570 |
strb.append(property.getName() + " "); |
| 571 |
try {
|
|
| 572 |
//strb.append(this.getFMin() + " / " + this.getNRows()); |
|
| 573 |
strb.append(this.fMinFilter +" / "+this.vMaxFilter); |
|
| 574 |
} catch (Exception e) {
|
|
| 575 |
// TODO Auto-generated catch block |
|
| 576 |
e.printStackTrace(); |
|
| 577 |
return this.getEmptyName(); |
|
| 578 |
} |
|
| 579 |
return strb.toString(); |
|
| 571 | 580 |
} |
| 572 |
try {
|
|
| 573 |
//strb.append(this.getFMin() + " / " + this.getNRows()); |
|
| 574 |
strb.append(this.fMinFilter +" / "+this.vMaxFilter); |
|
| 575 |
} catch (Exception e) {
|
|
| 576 |
// TODO Auto-generated catch block |
|
| 577 |
e.printStackTrace(); |
|
| 578 |
return this.getEmptyName(); |
|
| 579 |
} |
|
| 580 |
return strb.toString(); |
|
| 581 | 581 |
|
| 582 |
} |
|
| 582 |
// }
|
|
| 583 | 583 |
else {
|
| 584 | 584 |
return this.getEmptyName(); |
| 585 | 585 |
} |
Formats disponibles : Unified diff