Change calls to log.user() to log.info().
Use the USER_MARKER for any log.user() calls. Now you'll be able to log.error(USER_MARKER, "whatever...")
This commit is contained in:
parent
7fb5a7ad81
commit
e1457ca2a1
@ -12,6 +12,7 @@ import net.sf.openrocket.document.events.DocumentChangeEvent;
|
||||
import net.sf.openrocket.document.events.DocumentChangeListener;
|
||||
import net.sf.openrocket.document.events.SimulationChangeEvent;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.logging.TraceException;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
@ -114,7 +115,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
|
||||
|
||||
public void addCustomExpression(CustomExpression expression){
|
||||
if (customExpressions.contains(expression)){
|
||||
log.user("Could not add custom expression "+expression.getName()+" to document as document alerady has a matching expression.");
|
||||
log.info(Markers.USER_MARKER, "Could not add custom expression "+expression.getName()+" to document as document alerady has a matching expression.");
|
||||
} else {
|
||||
customExpressions.add(expression);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import java.util.List;
|
||||
import javax.swing.AbstractAction;
|
||||
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
import net.sf.openrocket.util.ChangeSource;
|
||||
@ -267,7 +268,7 @@ public class BooleanModel extends AbstractAction implements StateChangeListener,
|
||||
}
|
||||
|
||||
boolean v = (Boolean) this.getValue(SELECTED_KEY);
|
||||
log.user("Value of " + this + " changed to " + v + " oldValue=" + oldValue);
|
||||
log.info(Markers.USER_MARKER, "Value of " + this + " changed to " + v + " oldValue=" + oldValue);
|
||||
if (v != oldValue) {
|
||||
firing++;
|
||||
setValue(v);
|
||||
|
@ -18,6 +18,7 @@ import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.unit.Unit;
|
||||
import net.sf.openrocket.unit.UnitGroup;
|
||||
@ -98,13 +99,13 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
// Update the doublemodel with the new number or return to the last number if not possible
|
||||
if (((Double) num).isNaN()) {
|
||||
DoubleModel.this.setValue(lastValue);
|
||||
log.user("SpinnerModel could not set value for " + DoubleModel.this.toString() + ". Could not convert " + value.toString());
|
||||
log.info(Markers.USER_MARKER, "SpinnerModel could not set value for " + DoubleModel.this.toString() + ". Could not convert " + value.toString());
|
||||
}
|
||||
else {
|
||||
double newValue = num.doubleValue();
|
||||
double converted = currentUnit.fromUnit(newValue);
|
||||
|
||||
log.user("SpinnerModel setValue called for " + DoubleModel.this.toString() + " newValue=" + newValue +
|
||||
log.info(Markers.USER_MARKER, "SpinnerModel setValue called for " + DoubleModel.this.toString() + " newValue=" + newValue +
|
||||
" converted=" + converted);
|
||||
DoubleModel.this.setValue(converted);
|
||||
}
|
||||
@ -331,7 +332,7 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
}
|
||||
|
||||
double converted = currentUnit.fromUnit(currentUnit.round(currentUnit.toUnit(scaledValue)));
|
||||
log.user("SliderModel setValue called for " + DoubleModel.this.toString() + " newValue=" + newValue +
|
||||
log.info(Markers.USER_MARKER, "SliderModel setValue called for " + DoubleModel.this.toString() + " newValue=" + newValue +
|
||||
" scaledValue=" + scaledValue + " converted=" + converted);
|
||||
DoubleModel.this.setValue(converted);
|
||||
}
|
||||
@ -472,7 +473,7 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
return;
|
||||
}
|
||||
if (key.equals(Action.SELECTED_KEY) && (value instanceof Boolean)) {
|
||||
log.user("ActionModel putValue called for " + DoubleModel.this.toString() +
|
||||
log.info(Markers.USER_MARKER, "ActionModel putValue called for " + DoubleModel.this.toString() +
|
||||
" key=" + key + " value=" + value);
|
||||
oldValue = (Boolean) value;
|
||||
setAutomatic((Boolean) value);
|
||||
|
@ -12,6 +12,7 @@ import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
import net.sf.openrocket.util.ChangeSource;
|
||||
@ -42,7 +43,7 @@ public class IntegerModel implements StateChangeListener {
|
||||
}
|
||||
Number num = (Number) value;
|
||||
int newValue = num.intValue();
|
||||
log.user("SpinnerModel setValue called for " + IntegerModel.this.toString() + " newValue=" + newValue);
|
||||
log.info(Markers.USER_MARKER, "SpinnerModel setValue called for " + IntegerModel.this.toString() + " newValue=" + newValue);
|
||||
IntegerModel.this.setValue(newValue);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.gui.dialogs.preset.ComponentPresetChooserDialog;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.preset.ComponentPreset;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
@ -62,7 +63,7 @@ public class PresetModel extends AbstractListModel implements ComboBoxModel, Com
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(Object item) {
|
||||
log.user("User selected preset item '" + item + "' for component " + component);
|
||||
log.info(Markers.USER_MARKER, "User selected preset item '" + item + "' for component " + component);
|
||||
|
||||
if (item == null) {
|
||||
throw new BugException("item is null");
|
||||
|
@ -11,6 +11,7 @@ import javax.swing.JDialog;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
/**
|
||||
@ -34,7 +35,7 @@ public class ColorChooserButton extends JButton {
|
||||
this.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Activating color chooser");
|
||||
log.info(Markers.USER_MARKER, "Activating color chooser");
|
||||
final JColorChooser chooser = new JColorChooser(getSelectedColor());
|
||||
chooser.setPreviewPanel(new JPanel());
|
||||
final JDialog dialog = JColorChooser.createDialog(ColorChooserButton.this, "Select color", true,
|
||||
@ -42,7 +43,7 @@ public class ColorChooserButton extends JButton {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e2) {
|
||||
Color c = chooser.getColor();
|
||||
log.user("User selected color " + c);
|
||||
log.info(Markers.USER_MARKER, "User selected color " + c);
|
||||
setSelectedColor(chooser.getColor());
|
||||
}
|
||||
}, null);
|
||||
|
@ -11,6 +11,7 @@ import net.sf.openrocket.gui.components.StyledLabel.Style;
|
||||
import net.sf.openrocket.gui.components.UnitSelector;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.CenteringRing;
|
||||
import net.sf.openrocket.rocketcomponent.Coaxial;
|
||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
||||
@ -57,7 +58,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
convert.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Converting " + component.getComponentName() + " into freeform fin set");
|
||||
log.info(Markers.USER_MARKER, "Converting " + component.getComponentName() + " into freeform fin set");
|
||||
|
||||
// Do change in future for overall safety
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@ -83,7 +84,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
split.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Splitting " + component.getComponentName() + " into separate fins, fin count=" +
|
||||
log.info(Markers.USER_MARKER, "Splitting " + component.getComponentName() + " into separate fins, fin count=" +
|
||||
((FinSet) component).getFinCount());
|
||||
|
||||
// Do change in future for overall safety
|
||||
@ -214,7 +215,7 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
||||
autoCalc.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Computing " + component.getComponentName() + " tab height.");
|
||||
log.info(Markers.USER_MARKER, "Computing " + component.getComponentName() + " tab height.");
|
||||
|
||||
RocketComponent parent = component.getParent();
|
||||
if (parent instanceof Coaxial) {
|
||||
|
@ -43,6 +43,7 @@ import net.sf.openrocket.gui.util.FileHelper;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.material.Material;
|
||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
||||
import net.sf.openrocket.rocketcomponent.FreeformFinSet;
|
||||
@ -218,7 +219,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
|
||||
scaleButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Scaling free-form fin");
|
||||
log.info(Markers.USER_MARKER, "Scaling free-form fin");
|
||||
ScaleDialog dialog = new ScaleDialog(document, finset, SwingUtilities.getWindowAncestor(FreeformFinSetConfig.this), true);
|
||||
dialog.setVisible(true);
|
||||
dialog.dispose();
|
||||
|
@ -28,6 +28,7 @@ import net.sf.openrocket.gui.components.UnitSelector;
|
||||
import net.sf.openrocket.gui.util.Icons;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.simulation.customexpression.CustomExpression;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
@ -104,7 +105,7 @@ public class CustomExpressionPanel extends JPanel {
|
||||
doc.addCustomExpression(exp);
|
||||
}
|
||||
} catch (RocketLoadException e1) {
|
||||
log.user("Error opening document to import expressions from.");
|
||||
log.info(Markers.USER_MARKER, "Error opening document to import expressions from.");
|
||||
}
|
||||
updateExpressions();
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.LogLevel;
|
||||
import net.sf.openrocket.logging.LogLevelBufferLogger;
|
||||
import net.sf.openrocket.logging.LogLine;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.logging.StackTraceWriter;
|
||||
import net.sf.openrocket.logging.TraceException;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -167,7 +168,7 @@ public class DebugLogDialog extends JDialog {
|
||||
clear.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Clearing log buffer");
|
||||
log.info(Markers.USER_MARKER, "Clearing log buffer");
|
||||
buffer.clear();
|
||||
queue.clear();
|
||||
model.fireTableDataChanged();
|
||||
@ -358,7 +359,7 @@ public class DebugLogDialog extends JDialog {
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
log.user("Closing debug log dialog");
|
||||
log.info(Markers.USER_MARKER, "Closing debug log dialog");
|
||||
timer.stop();
|
||||
if (delegator != null) {
|
||||
log.info("Removing log listener");
|
||||
|
@ -22,6 +22,7 @@ import net.sf.openrocket.gui.print.PrintSettings;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
/**
|
||||
@ -91,7 +92,7 @@ public class PrintSettingsDialog extends JDialog {
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Resetting print setting values to defaults");
|
||||
log.info(Markers.USER_MARKER, "Resetting print setting values to defaults");
|
||||
PrintSettings defaults = new PrintSettings();
|
||||
settings.loadFrom(defaults);
|
||||
fillColorButton.setSelectedColor(settings.getTemplateFillColor());
|
||||
|
@ -28,6 +28,7 @@ import net.sf.openrocket.gui.components.UnitSelector;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.BodyComponent;
|
||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||
import net.sf.openrocket.rocketcomponent.EllipticalFinSet;
|
||||
@ -434,14 +435,14 @@ public class ScaleDialog extends JDialog {
|
||||
|
||||
if (MathUtil.equals(mul, 1.0)) {
|
||||
// Nothing to do
|
||||
log.user("Scaling by value 1.0 - nothing to do");
|
||||
log.info(Markers.USER_MARKER, "Scaling by value 1.0 - nothing to do");
|
||||
return;
|
||||
}
|
||||
|
||||
boolean scaleMass = scaleMassValues.isSelected();
|
||||
|
||||
Object item = selectionOption.getSelectedItem();
|
||||
log.user("Scaling design by factor " + mul + ", option=" + item);
|
||||
log.info(Markers.USER_MARKER, "Scaling design by factor " + mul + ", option=" + item);
|
||||
if (SCALE_ROCKET.equals(item)) {
|
||||
|
||||
// Scale the entire rocket design
|
||||
|
@ -17,6 +17,7 @@ import javax.swing.SwingWorker;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.MathUtil;
|
||||
|
||||
@ -72,7 +73,7 @@ public class SwingWorkerDialog extends JDialog implements PropertyChangeListener
|
||||
cancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("User cancelled SwingWorker operation");
|
||||
log.info(Markers.USER_MARKER, "User cancelled SwingWorker operation");
|
||||
cancel();
|
||||
}
|
||||
});
|
||||
|
@ -54,6 +54,7 @@ import net.sf.openrocket.gui.util.Icons;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -271,12 +272,12 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
|
||||
if (row >= 0) {
|
||||
row = table.convertRowIndexToModel(row);
|
||||
ThrustCurveMotorSet motorSet = model.getMotorSet(row);
|
||||
log.user("Selected table row " + row + ": " + motorSet);
|
||||
log.info(Markers.USER_MARKER, "Selected table row " + row + ": " + motorSet);
|
||||
if (motorSet != selectedMotorSet) {
|
||||
select(selectMotor(motorSet));
|
||||
}
|
||||
} else {
|
||||
log.user("Selected table row " + row + ", nothing selected");
|
||||
log.info(Markers.USER_MARKER, "Selected table row " + row + ", nothing selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -70,6 +70,7 @@ import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.optimization.general.OptimizationException;
|
||||
import net.sf.openrocket.optimization.general.Point;
|
||||
import net.sf.openrocket.optimization.rocketoptimization.OptimizableParameter;
|
||||
@ -319,7 +320,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
removeAllButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Removing all selected modifiers");
|
||||
log.info(Markers.USER_MARKER, "Removing all selected modifiers");
|
||||
selectedModifiers.clear();
|
||||
selectedModifierTableModel.fireTableDataChanged();
|
||||
availableModifierTree.repaint();
|
||||
@ -352,7 +353,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
addModifier(mod);
|
||||
clearHistory();
|
||||
} else {
|
||||
log.user("Double-clicked non-available option");
|
||||
log.info(Markers.USER_MARKER, "Double-clicked non-available option");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -589,10 +590,10 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
return;
|
||||
}
|
||||
if (running) {
|
||||
log.user("Stopping optimization");
|
||||
log.info(Markers.USER_MARKER, "Stopping optimization");
|
||||
stopOptimization();
|
||||
} else {
|
||||
log.user("Starting optimization");
|
||||
log.info(Markers.USER_MARKER, "Starting optimization");
|
||||
startOptimization();
|
||||
}
|
||||
}
|
||||
@ -605,7 +606,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
plotButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Plotting optimization path, dimensionality=" + selectedModifiers.size());
|
||||
log.info(Markers.USER_MARKER, "Plotting optimization path, dimensionality=" + selectedModifiers.size());
|
||||
OptimizationPlotDialog dialog = new OptimizationPlotDialog(
|
||||
Collections.unmodifiableList(optimizationPath),
|
||||
Collections.unmodifiableMap(evaluationHistory),
|
||||
@ -625,7 +626,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
saveButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("User selected save path");
|
||||
log.info(Markers.USER_MARKER, "User selected save path");
|
||||
savePath();
|
||||
}
|
||||
});
|
||||
@ -646,7 +647,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
applyButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Applying optimization changes");
|
||||
log.info(Markers.USER_MARKER, "Applying optimization changes");
|
||||
applyDesign();
|
||||
}
|
||||
});
|
||||
@ -658,7 +659,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Resetting optimization design");
|
||||
log.info(Markers.USER_MARKER, "Resetting optimization design");
|
||||
resetDesign();
|
||||
}
|
||||
});
|
||||
@ -670,7 +671,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
closeButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Closing optimization dialog");
|
||||
log.info(Markers.USER_MARKER, "Closing optimization dialog");
|
||||
stopOptimization();
|
||||
GeneralOptimizationDialog.this.dispose();
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ import net.sf.openrocket.gui.util.SimpleFileFilter;
|
||||
import net.sf.openrocket.l10n.L10N;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.startup.Preferences;
|
||||
import net.sf.openrocket.unit.Unit;
|
||||
@ -232,7 +233,7 @@ public class PreferencesDialog extends JDialog {
|
||||
//// Add
|
||||
int returnVal = chooser.showDialog(PreferencesDialog.this, trans.get("pref.dlg.Add"));
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
log.user("Adding user thrust curve: " + chooser.getSelectedFile());
|
||||
log.info(Markers.USER_MARKER, "Adding user thrust curve: " + chooser.getSelectedFile());
|
||||
defaultDirectory = chooser.getCurrentDirectory();
|
||||
String text = field.getText().trim();
|
||||
if (text.length() > 0) {
|
||||
|
@ -18,6 +18,7 @@ import net.miginfocom.swing.MigLayout;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
import net.sf.openrocket.util.Chars;
|
||||
@ -52,7 +53,7 @@ public class SlideShowDialog extends JDialog {
|
||||
prevButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Clicked previous button");
|
||||
log.info(Markers.USER_MARKER, "Clicked previous button");
|
||||
setPosition(position - 1);
|
||||
}
|
||||
});
|
||||
@ -64,7 +65,7 @@ public class SlideShowDialog extends JDialog {
|
||||
nextButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Clicked next button");
|
||||
log.info(Markers.USER_MARKER, "Clicked next button");
|
||||
setPosition(position + 1);
|
||||
}
|
||||
});
|
||||
@ -138,7 +139,7 @@ public class SlideShowDialog extends JDialog {
|
||||
Action next = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
log.user("Key action for next slide");
|
||||
log.info(Markers.USER_MARKER, "Key action for next slide");
|
||||
if (position < slideSet.getSlideCount() - 1) {
|
||||
setPosition(position + 1);
|
||||
}
|
||||
@ -148,7 +149,7 @@ public class SlideShowDialog extends JDialog {
|
||||
Action previous = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
log.user("Key action for previous slide");
|
||||
log.info(Markers.USER_MARKER, "Key action for previous slide");
|
||||
if (position > 0) {
|
||||
setPosition(position - 1);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ import net.sf.openrocket.gui.util.SaveFileWorker;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -407,7 +408,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("New... selected");
|
||||
log.info(Markers.USER_MARKER, "New... selected");
|
||||
newAction();
|
||||
closeIfReplaceable();
|
||||
}
|
||||
@ -423,7 +424,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Open... selected");
|
||||
log.info(Markers.USER_MARKER, "Open... selected");
|
||||
openAction();
|
||||
}
|
||||
});
|
||||
@ -446,11 +447,11 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Open example... selected");
|
||||
log.info(Markers.USER_MARKER, "Open example... selected");
|
||||
URL[] urls = ExampleDesignDialog.selectExampleDesigns(BasicFrame.this);
|
||||
if (urls != null) {
|
||||
for (URL u : urls) {
|
||||
log.user("Opening example " + u);
|
||||
log.info(Markers.USER_MARKER, "Opening example " + u);
|
||||
open(u, BasicFrame.this);
|
||||
}
|
||||
}
|
||||
@ -469,7 +470,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Save selected");
|
||||
log.info(Markers.USER_MARKER, "Save selected");
|
||||
saveAction();
|
||||
}
|
||||
});
|
||||
@ -485,7 +486,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Save as... selected");
|
||||
log.info(Markers.USER_MARKER, "Save as... selected");
|
||||
saveAsAction();
|
||||
}
|
||||
});
|
||||
@ -500,7 +501,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Print action selected");
|
||||
log.info(Markers.USER_MARKER, "Print action selected");
|
||||
printAction();
|
||||
}
|
||||
});
|
||||
@ -518,7 +519,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Close selected");
|
||||
log.info(Markers.USER_MARKER, "Close selected");
|
||||
closeAction();
|
||||
}
|
||||
});
|
||||
@ -535,7 +536,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Quit selected");
|
||||
log.info(Markers.USER_MARKER, "Quit selected");
|
||||
quitAction();
|
||||
}
|
||||
});
|
||||
@ -593,7 +594,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Scale... selected");
|
||||
log.info(Markers.USER_MARKER, "Scale... selected");
|
||||
ScaleDialog dialog = new ScaleDialog(document, getSelectedComponent(), BasicFrame.this);
|
||||
dialog.setVisible(true);
|
||||
dialog.dispose();
|
||||
@ -611,7 +612,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Preferences selected");
|
||||
log.info(Markers.USER_MARKER, "Preferences selected");
|
||||
PreferencesDialog.showPreferences(BasicFrame.this);
|
||||
}
|
||||
});
|
||||
@ -648,7 +649,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Component analysis selected");
|
||||
log.info(Markers.USER_MARKER, "Component analysis selected");
|
||||
ComponentAnalysisDialog.showDialog(rocketpanel);
|
||||
}
|
||||
});
|
||||
@ -660,7 +661,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Rocket optimization selected");
|
||||
log.info(Markers.USER_MARKER, "Rocket optimization selected");
|
||||
new GeneralOptimizationDialog(document, BasicFrame.this).setVisible(true);
|
||||
}
|
||||
});
|
||||
@ -702,7 +703,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Guided tours selected");
|
||||
log.info(Markers.USER_MARKER, "Guided tours selected");
|
||||
GuidedTourSelectionDialog.showDialog(BasicFrame.this);
|
||||
}
|
||||
});
|
||||
@ -717,7 +718,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Bug report selected");
|
||||
log.info(Markers.USER_MARKER, "Bug report selected");
|
||||
BugReportDialog.showBugReportDialog(BasicFrame.this);
|
||||
}
|
||||
});
|
||||
@ -730,7 +731,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Debug log selected");
|
||||
log.info(Markers.USER_MARKER, "Debug log selected");
|
||||
new DebugLogDialog(BasicFrame.this).setVisible(true);
|
||||
}
|
||||
});
|
||||
@ -746,7 +747,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("License selected");
|
||||
log.info(Markers.USER_MARKER, "License selected");
|
||||
new LicenseDialog(BasicFrame.this).setVisible(true);
|
||||
}
|
||||
});
|
||||
@ -760,7 +761,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("About selected");
|
||||
log.info(Markers.USER_MARKER, "About selected");
|
||||
new AboutDialog(BasicFrame.this).setVisible(true);
|
||||
}
|
||||
});
|
||||
@ -788,7 +789,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("What is this menu? selected");
|
||||
log.info(Markers.USER_MARKER, "What is this menu? selected");
|
||||
JOptionPane.showMessageDialog(BasicFrame.this,
|
||||
new Object[] {
|
||||
"The 'Debug' menu includes actions for testing and debugging " +
|
||||
@ -808,7 +809,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Create test rocket selected");
|
||||
log.info(Markers.USER_MARKER, "Create test rocket selected");
|
||||
JTextField field = new JTextField();
|
||||
int sel = JOptionPane.showOptionDialog(BasicFrame.this, new Object[] {
|
||||
"Input text key to generate random rocket:",
|
||||
@ -841,7 +842,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Create Iso-Haisu selected");
|
||||
log.info(Markers.USER_MARKER, "Create Iso-Haisu selected");
|
||||
Rocket r = TestRockets.makeIsoHaisu();
|
||||
OpenRocketDocument doc = new OpenRocketDocument(r);
|
||||
doc.setSaved(true);
|
||||
@ -856,7 +857,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Create Big Blue selected");
|
||||
log.info(Markers.USER_MARKER, "Create Big Blue selected");
|
||||
Rocket r = TestRockets.makeBigBlue();
|
||||
OpenRocketDocument doc = new OpenRocketDocument(r);
|
||||
doc.setSaved(true);
|
||||
@ -873,7 +874,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Memory statistics selected");
|
||||
log.info(Markers.USER_MARKER, "Memory statistics selected");
|
||||
|
||||
// Get discarded but remaining objects (this also runs System.gc multiple times)
|
||||
List<MemoryData> objects = MemoryManagement.getRemainingCollectableObjects();
|
||||
@ -915,7 +916,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Exhaust memory selected");
|
||||
log.info(Markers.USER_MARKER, "Exhaust memory selected");
|
||||
LinkedList<byte[]> data = new LinkedList<byte[]>();
|
||||
int count = 0;
|
||||
final int bytesPerArray = 10240;
|
||||
@ -948,7 +949,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Exception here selected");
|
||||
log.info(Markers.USER_MARKER, "Exception here selected");
|
||||
throw new RuntimeException("Testing exception from menu action listener");
|
||||
}
|
||||
});
|
||||
@ -958,7 +959,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Exception from EDT selected");
|
||||
log.info(Markers.USER_MARKER, "Exception from EDT selected");
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -974,7 +975,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Exception from other thread selected");
|
||||
log.info(Markers.USER_MARKER, "Exception from other thread selected");
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -989,7 +990,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("OutOfMemoryError here selected");
|
||||
log.info(Markers.USER_MARKER, "OutOfMemoryError here selected");
|
||||
throw new OutOfMemoryError("Testing OutOfMemoryError from menu action listener");
|
||||
}
|
||||
});
|
||||
@ -1003,7 +1004,7 @@ public class BasicFrame extends JFrame {
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.user("Test popup selected");
|
||||
log.info(Markers.USER_MARKER, "Test popup selected");
|
||||
JPanel panel = new JPanel();
|
||||
panel.add(new JTextField(40));
|
||||
panel.add(new JSpinner());
|
||||
@ -1046,14 +1047,14 @@ public class BasicFrame extends JFrame {
|
||||
chooser.setCurrentDirectory(((SwingPreferences) Application.getPreferences()).getDefaultDirectory());
|
||||
int option = chooser.showOpenDialog(this);
|
||||
if (option != JFileChooser.APPROVE_OPTION) {
|
||||
log.user("Decided not to open files, option=" + option);
|
||||
log.info(Markers.USER_MARKER, "Decided not to open files, option=" + option);
|
||||
return;
|
||||
}
|
||||
|
||||
((SwingPreferences) Application.getPreferences()).setDefaultDirectory(chooser.getCurrentDirectory());
|
||||
|
||||
File[] files = chooser.getSelectedFiles();
|
||||
log.user("Opening files " + Arrays.toString(files));
|
||||
log.info(Markers.USER_MARKER, "Opening files " + Arrays.toString(files));
|
||||
|
||||
for (File file : files) {
|
||||
log.info("Opening file: " + file);
|
||||
@ -1312,13 +1313,13 @@ public class BasicFrame extends JFrame {
|
||||
|
||||
int option = chooser.showSaveDialog(BasicFrame.this);
|
||||
if (option != JFileChooser.APPROVE_OPTION) {
|
||||
log.user("User decided not to save, option=" + option);
|
||||
log.info(Markers.USER_MARKER, "User decided not to save, option=" + option);
|
||||
return false;
|
||||
}
|
||||
|
||||
file = chooser.getSelectedFile();
|
||||
if (file == null) {
|
||||
log.user("User did not select a file");
|
||||
log.info(Markers.USER_MARKER, "User did not select a file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1368,7 +1369,7 @@ public class BasicFrame extends JFrame {
|
||||
|
||||
if (!StorageOptionChooser.verifyStorageOptions(document, this)) {
|
||||
// User cancelled the dialog
|
||||
log.user("User cancelled saving in storage options dialog");
|
||||
log.info(Markers.USER_MARKER, "User cancelled saving in storage options dialog");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1379,7 +1380,7 @@ public class BasicFrame extends JFrame {
|
||||
"Writing " + file.getName() + "...", worker)) {
|
||||
|
||||
// User cancelled the save
|
||||
log.user("User cancelled the save, deleting the file");
|
||||
log.info(Markers.USER_MARKER, "User cancelled the save, deleting the file");
|
||||
file.delete();
|
||||
return false;
|
||||
}
|
||||
@ -1424,17 +1425,17 @@ public class BasicFrame extends JFrame {
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
// Save
|
||||
log.user("User requested file save");
|
||||
log.info(Markers.USER_MARKER, "User requested file save");
|
||||
if (!saveAction()) {
|
||||
log.info("File save was interrupted, not closing");
|
||||
return false;
|
||||
}
|
||||
} else if (result == JOptionPane.NO_OPTION) {
|
||||
// Don't save: No-op
|
||||
log.user("User requested to discard design");
|
||||
log.info(Markers.USER_MARKER, "User requested to discard design");
|
||||
} else {
|
||||
// Cancel or close
|
||||
log.user("User cancelled closing, result=" + result);
|
||||
log.info(Markers.USER_MARKER, "User cancelled closing, result=" + result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import net.sf.openrocket.gui.configdialog.ComponentConfigDialog;
|
||||
import net.sf.openrocket.gui.main.componenttree.ComponentTreeModel;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.BodyComponent;
|
||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||
import net.sf.openrocket.rocketcomponent.Bulkhead;
|
||||
@ -387,7 +388,7 @@ public class ComponentAddButtons extends JPanel implements Scrollable {
|
||||
@Override
|
||||
protected void fireActionPerformed(ActionEvent event) {
|
||||
super.fireActionPerformed(event);
|
||||
log.user("Adding component of type " + componentClass.getSimpleName());
|
||||
log.info(Markers.USER_MARKER, "Adding component of type " + componentClass.getSimpleName());
|
||||
RocketComponent c = null;
|
||||
Integer position = null;
|
||||
|
||||
|
@ -5,6 +5,7 @@ import javax.swing.SwingUtilities;
|
||||
|
||||
import net.sf.openrocket.gui.dialogs.BugReportDialog;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.logging.TraceException;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.startup.ExceptionHandler;
|
||||
@ -210,12 +211,12 @@ public class SwingExceptionHandler implements Thread.UncaughtExceptionHandler, E
|
||||
|
||||
if (selection != 0) {
|
||||
// User cancelled
|
||||
log.user("User chose not to fill bug report");
|
||||
log.info(Markers.USER_MARKER, "User chose not to fill bug report");
|
||||
return;
|
||||
}
|
||||
|
||||
// Show bug report dialog
|
||||
log.user("User requested sending bug report");
|
||||
log.info(Markers.USER_MARKER, "User requested sending bug report");
|
||||
BugReportDialog.showExceptionDialog(null, t, e);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import net.sf.openrocket.document.UndoRedoListener;
|
||||
import net.sf.openrocket.gui.util.Icons;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
|
||||
@ -57,12 +58,12 @@ public class UndoRedoAction extends AbstractAction implements UndoRedoListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (type) {
|
||||
case UNDO:
|
||||
log.user("Performing undo, event=" + e);
|
||||
log.info(Markers.USER_MARKER, "Performing undo, event=" + e);
|
||||
document.undo();
|
||||
break;
|
||||
|
||||
case REDO:
|
||||
log.user("Performing redo, event=" + e);
|
||||
log.info(Markers.USER_MARKER, "Performing redo, event=" + e);
|
||||
document.redo();
|
||||
break;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import javax.swing.tree.TreePath;
|
||||
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -136,14 +137,14 @@ public class ComponentTreeTransferHandler extends TransferHandler {
|
||||
// Check whether move action would be a no-op
|
||||
if ((action == MOVE) && (data.srcParent == data.destParent) &&
|
||||
(data.destIndex == data.srcIndex || data.destIndex == data.srcIndex + 1)) {
|
||||
log.user("Dropped component at the same place as previously: " + data);
|
||||
log.info(Markers.USER_MARKER, "Dropped component at the same place as previously: " + data);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
switch (action) {
|
||||
case MOVE:
|
||||
log.user("Performing DnD move operation: " + data);
|
||||
log.info(Markers.USER_MARKER, "Performing DnD move operation: " + data);
|
||||
|
||||
// If parents are the same, check whether removing the child changes the insert position
|
||||
int index = data.destIndex;
|
||||
@ -167,7 +168,7 @@ public class ComponentTreeTransferHandler extends TransferHandler {
|
||||
return true;
|
||||
|
||||
case COPY:
|
||||
log.user("Performing DnD copy operation: " + data);
|
||||
log.info(Markers.USER_MARKER, "Performing DnD copy operation: " + data);
|
||||
RocketComponent copy = data.child.copy();
|
||||
try {
|
||||
document.startUndo("Copy component");
|
||||
|
@ -7,6 +7,7 @@ import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.ResourceBundleTranslator;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.material.Material;
|
||||
import net.sf.openrocket.preset.ComponentPreset;
|
||||
import net.sf.openrocket.preset.loader.MaterialHolder;
|
||||
@ -339,14 +340,14 @@ public class ComponentPresetEditor extends JPanel implements PresetResultListene
|
||||
int option = chooser.showOpenDialog(ComponentPresetEditor.this);
|
||||
if (option != JFileChooser.APPROVE_OPTION) {
|
||||
editContext.setOpenedFile(null);
|
||||
log.user("User decided not to open, option=" + option);
|
||||
log.info(Markers.USER_MARKER, "User decided not to open, option=" + option);
|
||||
return false;
|
||||
}
|
||||
|
||||
File file = chooser.getSelectedFile();
|
||||
try {
|
||||
if (file == null) {
|
||||
log.user("User did not select a file");
|
||||
log.info(Markers.USER_MARKER, "User did not select a file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -419,13 +420,13 @@ public class ComponentPresetEditor extends JPanel implements PresetResultListene
|
||||
|
||||
int option = chooser.showSaveDialog(ComponentPresetEditor.this);
|
||||
if (option != JFileChooser.APPROVE_OPTION) {
|
||||
log.user("User decided not to save, option=" + option);
|
||||
log.info(Markers.USER_MARKER, "User decided not to save, option=" + option);
|
||||
return false;
|
||||
}
|
||||
|
||||
file = chooser.getSelectedFile();
|
||||
if (file == null) {
|
||||
log.user("User did not select a file");
|
||||
log.info(Markers.USER_MARKER, "User did not select a file");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package net.sf.openrocket.gui.util;
|
||||
import net.sf.openrocket.l10n.L10N;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -140,7 +141,7 @@ public final class FileHelper {
|
||||
*/
|
||||
public static boolean confirmWrite(File file, Component parent) {
|
||||
if (file.exists()) {
|
||||
log.info(1, "File " + file + " exists, confirming overwrite from user");
|
||||
log.user(1, "File " + file + " exists, confirming overwrite from user");
|
||||
int result = JOptionPane.showConfirmDialog(parent,
|
||||
L10N.replace(trans.get("error.fileExists.desc"), "{filename}", file.getName()),
|
||||
trans.get("error.fileExists.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
|
||||
|
@ -73,6 +73,7 @@ import javax.swing.tree.TreeSelectionModel;
|
||||
|
||||
import net.sf.openrocket.gui.Resettable;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
import net.sf.openrocket.util.Invalidatable;
|
||||
@ -164,7 +165,7 @@ public class GUIUtil {
|
||||
Action dispatchClosing = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
log.user("Closing dialog " + dialog);
|
||||
log.info(Markers.USER_MARKER, "Closing dialog " + dialog);
|
||||
dialog.dispatchEvent(new WindowEvent(dialog, WindowEvent.WINDOW_CLOSING));
|
||||
}
|
||||
};
|
||||
|
@ -5,6 +5,7 @@ import java.util.regex.*;
|
||||
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.simulation.FlightDataType;
|
||||
import net.sf.openrocket.simulation.SimulationStatus;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -240,7 +241,7 @@ public class CustomExpression implements Cloneable{
|
||||
ArrayList<String> symbols = getAllSymbols().clone();
|
||||
if (symbols.contains(symbol.trim())){
|
||||
int index = symbols.indexOf(symbol.trim());
|
||||
log.user("Symbol "+symbol+" already exists, found "+symbols.get(index));
|
||||
log.info(Markers.USER_MARKER, "Symbol "+symbol+" already exists, found "+symbols.get(index));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -260,7 +261,7 @@ public class CustomExpression implements Cloneable{
|
||||
ArrayList<String> names = getAllNames().clone();
|
||||
if (names.contains(name.trim())){
|
||||
int index = names.indexOf(name.trim());
|
||||
log.user("Name "+name+" already exists, found "+names.get(index));
|
||||
log.info(Markers.USER_MARKER, "Name "+name+" already exists, found "+names.get(index));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -311,7 +312,7 @@ public class CustomExpression implements Cloneable{
|
||||
case ']' : square--; break;
|
||||
case ':' :
|
||||
if (square <= 0){
|
||||
log.user(": found outside range expression");
|
||||
log.info(Markers.USER_MARKER, ": found outside range expression");
|
||||
return false;
|
||||
}
|
||||
else break;
|
||||
@ -321,7 +322,7 @@ public class CustomExpression implements Cloneable{
|
||||
}
|
||||
}
|
||||
if (round != 0 || square != 0) {
|
||||
log.user("Expression has unballanced brackets");
|
||||
log.info(Markers.USER_MARKER, "Expression has unballanced brackets");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -345,7 +346,7 @@ public class CustomExpression implements Cloneable{
|
||||
try {
|
||||
builder.build();
|
||||
} catch (Exception e) {
|
||||
log.user("Custom expression " + this.toString() + " invalid : " + e.toString());
|
||||
log.info(Markers.USER_MARKER, "Custom expression " + this.toString() + " invalid : " + e.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -375,10 +376,10 @@ public class CustomExpression implements Cloneable{
|
||||
try {
|
||||
calc = b.build();
|
||||
} catch (UnknownFunctionException e1) {
|
||||
log.user("Unknown function. Could not build custom expression "+this.toString());
|
||||
log.info(Markers.USER_MARKER, "Unknown function. Could not build custom expression "+this.toString());
|
||||
return null;
|
||||
} catch (UnparsableExpressionException e1) {
|
||||
log.user("Unparsable expression. Could not build custom expression "+this.toString()+". "+e1.getMessage());
|
||||
log.info(Markers.USER_MARKER, "Unparsable expression. Could not build custom expression "+this.toString()+". "+e1.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -413,7 +414,7 @@ public class CustomExpression implements Cloneable{
|
||||
result = calc.calculate().getDoubleValue();
|
||||
}
|
||||
catch (java.util.EmptyStackException e){
|
||||
log.user("Unable to calculate expression "+this.expression+" due to empty stack exception");
|
||||
log.info(Markers.USER_MARKER, "Unable to calculate expression "+this.expression+" due to empty stack exception");
|
||||
}
|
||||
|
||||
return new Variable(name, result);
|
||||
@ -450,13 +451,13 @@ public class CustomExpression implements Cloneable{
|
||||
if ( !expressions.isEmpty() ) {
|
||||
// check if expression already exists
|
||||
if ( expressions.contains(this) ){
|
||||
log.user("Expression already in document. This unit : "+this.getUnit()+", existing unit : "+expressions.get(0).getUnit());
|
||||
log.info(Markers.USER_MARKER, "Expression already in document. This unit : "+this.getUnit()+", existing unit : "+expressions.get(0).getUnit());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.checkAll()){
|
||||
log.user("Custom expression added to rocket document");
|
||||
log.info(Markers.USER_MARKER, "Custom expression added to rocket document");
|
||||
doc.addCustomExpression( this );
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import de.congrace.exp4j.Calculable;
|
||||
import de.congrace.exp4j.Variable;
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.simulation.customexpression.CustomExpression;
|
||||
import net.sf.openrocket.simulation.FlightDataType;
|
||||
import net.sf.openrocket.simulation.SimulationStatus;
|
||||
@ -48,7 +49,7 @@ public class IndexExpression extends CustomExpression {
|
||||
return new Variable(hash(), interp.getValue( tvalue ) );
|
||||
}
|
||||
catch (java.util.EmptyStackException e){
|
||||
log.user("Unable to calculate time index for indexed expression "+getExpressionString()+" due to empty stack exception");
|
||||
log.info(Markers.USER_MARKER, "Unable to calculate time index for indexed expression "+getExpressionString()+" due to empty stack exception");
|
||||
return new Variable("Unknown");
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ import de.congrace.exp4j.ExpressionBuilder;
|
||||
import de.congrace.exp4j.Variable;
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.logging.LogHelper;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.simulation.customexpression.CustomExpression;
|
||||
import net.sf.openrocket.simulation.FlightDataType;
|
||||
import net.sf.openrocket.simulation.SimulationStatus;
|
||||
@ -91,7 +92,7 @@ public class RangeExpression extends CustomExpression {
|
||||
endTime = MathUtil.clamp(endTime, 0, time.get(time.size()-1));
|
||||
}
|
||||
catch (java.util.EmptyStackException e){
|
||||
log.user("Unable to calculate time index for range expression "+getSymbol()+" due to empty stack exception");
|
||||
log.info(Markers.USER_MARKER, "Unable to calculate time index for range expression "+getSymbol()+" due to empty stack exception");
|
||||
return new Variable("Unknown");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user