Kaydet (Commit) fed2f069 authored tarafından Alexander Wilms's avatar Alexander Wilms Kaydeden (comit) David Tardon

Remove trailing whitespace from nlpsolver

Change-Id: I8ee2aff2c18adaf5582ed6eeb174e88313d8c8a2
Reviewed-on: https://gerrit.libreoffice.org/8283Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst ca884aab
...@@ -229,7 +229,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver { ...@@ -229,7 +229,7 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
ArrayList<ExtSolverConstraint> constraints = new ArrayList<ExtSolverConstraint>(); ArrayList<ExtSolverConstraint> constraints = new ArrayList<ExtSolverConstraint>();
for (int i = 0; i < m_constraintCount; i++) { for (int i = 0; i < m_constraintCount; i++) {
Double doubleValue; Double doubleValue;
if (m_extConstraints[i].Right != null) if (m_extConstraints[i].Right != null)
doubleValue = null; doubleValue = null;
else else
......
...@@ -94,5 +94,5 @@ public class ResourceManager { ...@@ -94,5 +94,5 @@ public class ResourceManager {
return defaultValue; return defaultValue;
} }
} }
} }
...@@ -119,7 +119,7 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver ...@@ -119,7 +119,7 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver
if (m_solverStatusDialog.getUserState() == IEvolutionarySolverStatusDialog.CONTINUE) if (m_solverStatusDialog.getUserState() == IEvolutionarySolverStatusDialog.CONTINUE)
lockDocument(); lockDocument();
m_toleratedCount = 0; m_toleratedCount = 0;
m_toleratedMin = -1.0 * m_tolerance.getValue(); m_toleratedMin = -1.0 * m_tolerance.getValue();
m_toleratedMax = m_tolerance.getValue(); m_toleratedMax = m_tolerance.getValue();
......
...@@ -55,7 +55,7 @@ import java.util.logging.Logger; ...@@ -55,7 +55,7 @@ import java.util.logging.Logger;
* It automatically loads the necessary interfaces to access OpenOffice.org dialogs. * It automatically loads the necessary interfaces to access OpenOffice.org dialogs.
*/ */
public abstract class BaseDialog extends BaseControl { public abstract class BaseDialog extends BaseControl {
private XMultiComponentFactory xMCF; private XMultiComponentFactory xMCF;
private Object toolkit; private Object toolkit;
private XMultiServiceFactory xMSF; private XMultiServiceFactory xMSF;
...@@ -63,12 +63,12 @@ public abstract class BaseDialog extends BaseControl { ...@@ -63,12 +63,12 @@ public abstract class BaseDialog extends BaseControl {
protected XDialog xDialog; protected XDialog xDialog;
protected XWindowPeer xWindowPeer; protected XWindowPeer xWindowPeer;
protected ModalState modalState; protected ModalState modalState;
@Override @Override
public String getName() { public String getName() {
return null; return null;
} }
public XMultiServiceFactory getMultiServiceFactory() { public XMultiServiceFactory getMultiServiceFactory() {
return xMSF; return xMSF;
} }
...@@ -89,7 +89,7 @@ public abstract class BaseDialog extends BaseControl { ...@@ -89,7 +89,7 @@ public abstract class BaseDialog extends BaseControl {
public Rectangle getWorkspaceDimensions() { public Rectangle getWorkspaceDimensions() {
return getCurrentFrame().getComponentWindow().getPosSize(); return getCurrentFrame().getComponentWindow().getPosSize();
} }
public BaseDialog(XComponentContext context, String title, int x, int y, int width, int height) { public BaseDialog(XComponentContext context, String title, int x, int y, int width, int height) {
super(context); super(context);
modalState = ModalState.Exit; modalState = ModalState.Exit;
...@@ -97,7 +97,7 @@ public abstract class BaseDialog extends BaseControl { ...@@ -97,7 +97,7 @@ public abstract class BaseDialog extends BaseControl {
xMCF = context.getServiceManager(); xMCF = context.getServiceManager();
setUnoModel(xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", context)); setUnoModel(xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", context));
xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, getUnoModel()); xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, getUnoModel());
setProperty("Title", title); setProperty("Title", title);
setPosition(x, y); setPosition(x, y);
setSize(width, height); setSize(width, height);
...@@ -106,7 +106,7 @@ public abstract class BaseDialog extends BaseControl { ...@@ -106,7 +106,7 @@ public abstract class BaseDialog extends BaseControl {
XControl xControl = UnoRuntime.queryInterface(XControl.class, unoControl); XControl xControl = UnoRuntime.queryInterface(XControl.class, unoControl);
XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, getUnoModel()); XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, getUnoModel());
xControl.setModel(xControlModel); xControl.setModel(xControlModel);
toolkit = xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", context); toolkit = xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", context);
XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, toolkit); XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, toolkit);
xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl); xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl);
...@@ -114,9 +114,9 @@ public abstract class BaseDialog extends BaseControl { ...@@ -114,9 +114,9 @@ public abstract class BaseDialog extends BaseControl {
XWindowPeer xParentWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, getCurrentFrame().getComponentWindow()); XWindowPeer xParentWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, getCurrentFrame().getComponentWindow());
xControl.createPeer(xToolkit, xParentWindowPeer); xControl.createPeer(xToolkit, xParentWindowPeer);
xWindowPeer = xControl.getPeer(); xWindowPeer = xControl.getPeer();
xDialog = UnoRuntime.queryInterface(XDialog.class, unoControl); xDialog = UnoRuntime.queryInterface(XDialog.class, unoControl);
//center if necessary //center if necessary
if (x < 0 || y < 0) { if (x < 0 || y < 0) {
Rectangle workspacePosSize = getWorkspaceDimensions(); Rectangle workspacePosSize = getWorkspaceDimensions();
...@@ -125,11 +125,11 @@ public abstract class BaseDialog extends BaseControl { ...@@ -125,11 +125,11 @@ public abstract class BaseDialog extends BaseControl {
dialogPosSize.X = workspacePosSize.X + (workspacePosSize.Width / 2) - (dialogPosSize.Width / 2); dialogPosSize.X = workspacePosSize.X + (workspacePosSize.Width / 2) - (dialogPosSize.Width / 2);
if (y < 0) if (y < 0)
dialogPosSize.Y = workspacePosSize.Y + (workspacePosSize.Height / 2) - (dialogPosSize.Height / 2); dialogPosSize.Y = workspacePosSize.Y + (workspacePosSize.Height / 2) - (dialogPosSize.Height / 2);
xWindow.setPosSize(dialogPosSize.X, dialogPosSize.Y, xWindow.setPosSize(dialogPosSize.X, dialogPosSize.Y,
dialogPosSize.Width, dialogPosSize.Height, PosSize.POS); dialogPosSize.Width, dialogPosSize.Height, PosSize.POS);
} }
} catch (Exception ex) { } catch (Exception ex) {
Logger.getLogger(BaseDialog.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(BaseDialog.class.getName()).log(Level.SEVERE, null, ex);
} }
...@@ -141,13 +141,13 @@ public abstract class BaseDialog extends BaseControl { ...@@ -141,13 +141,13 @@ public abstract class BaseDialog extends BaseControl {
xComponent.dispose(); xComponent.dispose();
super.finalize(); super.finalize();
} }
public ModalState showModal() { public ModalState showModal() {
xWindow.setVisible(true); xWindow.setVisible(true);
xDialog.execute(); xDialog.execute();
return modalState; return modalState;
} }
public void close() { public void close() {
xDialog.endExecute(); xDialog.endExecute();
xWindow.setVisible(false); xWindow.setVisible(false);
...@@ -161,5 +161,5 @@ public abstract class BaseDialog extends BaseControl { ...@@ -161,5 +161,5 @@ public abstract class BaseDialog extends BaseControl {
xWindowPeer.invalidate((short)(InvalidateStyle.CHILDREN /*| InvalidateStyle.NOERASE*/ | xWindowPeer.invalidate((short)(InvalidateStyle.CHILDREN /*| InvalidateStyle.NOERASE*/ |
InvalidateStyle.UPDATE | InvalidateStyle.TRANSPARENT)); InvalidateStyle.UPDATE | InvalidateStyle.TRANSPARENT));
} }
} }
...@@ -35,23 +35,23 @@ public class DummyEvolutionarySolverStatusDialog ...@@ -35,23 +35,23 @@ public class DummyEvolutionarySolverStatusDialog
} }
public void setBestSolution(double solution, boolean feasible) { public void setBestSolution(double solution, boolean feasible) {
} }
public void setMaxIterations(int maxIterations) { public void setMaxIterations(int maxIterations) {
} }
public void setMaxStagnation(int maxStagnation) { public void setMaxStagnation(int maxStagnation) {
} }
public void setIteration(int iteration) { public void setIteration(int iteration) {
} }
public void setStagnation(int stagnation) { public void setStagnation(int stagnation) {
} }
public void setRuntime(long runtime) { public void setRuntime(long runtime) {
...@@ -67,7 +67,7 @@ public class DummyEvolutionarySolverStatusDialog ...@@ -67,7 +67,7 @@ public class DummyEvolutionarySolverStatusDialog
} }
public void dispose() { public void dispose() {
} }
} }
...@@ -225,7 +225,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog ...@@ -225,7 +225,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
resourceManager.getLocalizedString("Message.StopIteration", resourceManager.getLocalizedString("Message.StopIteration",
"Maximum iterations reached.")); "Maximum iterations reached."));
} }
if (pbStagnation.getValue() >= maxStagnation) { if (pbStagnation.getValue() >= maxStagnation) {
lblStagnation.setTextColor(COLOR_RED); lblStagnation.setTextColor(COLOR_RED);
if (userState != IEvolutionarySolverStatusDialog.CANCEL) if (userState != IEvolutionarySolverStatusDialog.CANCEL)
...@@ -247,7 +247,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog ...@@ -247,7 +247,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
pbStagnation.setVisible(false); pbStagnation.setVisible(false);
lblIterationValue.setVisible(true); lblIterationValue.setVisible(true);
lblStagnationValue.setVisible(true); lblStagnationValue.setVisible(true);
repaint(); repaint();
userState = IEvolutionarySolverStatusDialog.WAITING; userState = IEvolutionarySolverStatusDialog.WAITING;
...@@ -293,7 +293,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog ...@@ -293,7 +293,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
} }
public void disposing(EventObject eventObject) { public void disposing(EventObject eventObject) {
} }
} }
...@@ -42,19 +42,19 @@ import java.util.logging.Level; ...@@ -42,19 +42,19 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
public abstract class BaseControl { public abstract class BaseControl {
protected XComponentContext context; protected XComponentContext context;
private Object unoModel; private Object unoModel;
protected Object unoControl; protected Object unoControl;
protected XPropertySet properties; protected XPropertySet properties;
protected BaseControl parentControl; protected BaseControl parentControl;
public abstract String getName(); public abstract String getName();
public Object getUnoModel() { public Object getUnoModel() {
return unoModel; return unoModel;
} }
/** /**
* This is used <b>internally</b> to update the UnoModel and refresh the * This is used <b>internally</b> to update the UnoModel and refresh the
* associated PropertySet. * associated PropertySet.
...@@ -64,21 +64,21 @@ public abstract class BaseControl { ...@@ -64,21 +64,21 @@ public abstract class BaseControl {
this.unoModel = unoModel; this.unoModel = unoModel;
properties = UnoRuntime.queryInterface(XPropertySet.class, unoModel); properties = UnoRuntime.queryInterface(XPropertySet.class, unoModel);
} }
public Object getUnoControl() { public Object getUnoControl() {
return unoControl; return unoControl;
} }
public void setParentControl(BaseControl parentControl) { public void setParentControl(BaseControl parentControl) {
//TODO : remove from existing parentControl //TODO : remove from existing parentControl
try { try {
String name = getName(); String name = getName();
XNameContainer nameContainer = UnoRuntime.queryInterface(XNameContainer.class, parentControl.unoModel); XNameContainer nameContainer = UnoRuntime.queryInterface(XNameContainer.class, parentControl.unoModel);
nameContainer.insertByName(name, unoModel); nameContainer.insertByName(name, unoModel);
XControlContainer controlContainer = UnoRuntime.queryInterface(XControlContainer.class, parentControl.unoControl); XControlContainer controlContainer = UnoRuntime.queryInterface(XControlContainer.class, parentControl.unoControl);
unoControl = controlContainer.getControl(name); unoControl = controlContainer.getControl(name);
this.parentControl = parentControl; this.parentControl = parentControl;
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex);
...@@ -88,14 +88,14 @@ public abstract class BaseControl { ...@@ -88,14 +88,14 @@ public abstract class BaseControl {
Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex);
} }
} }
public BaseControl(XComponentContext context) { public BaseControl(XComponentContext context) {
this.context = context; this.context = context;
unoModel = null; unoModel = null;
unoControl = null; unoControl = null;
parentControl = null; parentControl = null;
} }
protected void setProperty(String name, Object value) { protected void setProperty(String name, Object value) {
try { try {
properties.setPropertyValue(name, value); properties.setPropertyValue(name, value);
...@@ -109,7 +109,7 @@ public abstract class BaseControl { ...@@ -109,7 +109,7 @@ public abstract class BaseControl {
Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(BaseControl.class.getName()).log(Level.SEVERE, null, ex);
} }
} }
protected Object getProperty(String name) { protected Object getProperty(String name) {
try { try {
return properties.getPropertyValue(name); return properties.getPropertyValue(name);
...@@ -120,19 +120,19 @@ public abstract class BaseControl { ...@@ -120,19 +120,19 @@ public abstract class BaseControl {
} }
return null; return null;
} }
// <editor-fold defaultstate="collapsed" desc="Uno Properties"> // <editor-fold defaultstate="collapsed" desc="Uno Properties">
public void setPosition(int x, int y) { public void setPosition(int x, int y) {
setProperty("PositionX", new Integer(x)); setProperty("PositionX", new Integer(x));
setProperty("PositionY", new Integer(y)); setProperty("PositionY", new Integer(y));
} }
public void setSize(int width, int height) { public void setSize(int width, int height) {
setProperty("Width", new Integer(width)); setProperty("Width", new Integer(width));
setProperty("Height", new Integer(height)); setProperty("Height", new Integer(height));
} }
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {
setProperty("Enabled", new Boolean(enabled)); setProperty("Enabled", new Boolean(enabled));
} }
...@@ -141,7 +141,7 @@ public abstract class BaseControl { ...@@ -141,7 +141,7 @@ public abstract class BaseControl {
XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl);
xWindow.setVisible(visible); xWindow.setVisible(visible);
} }
// </editor-fold> // </editor-fold>
} }
...@@ -36,10 +36,10 @@ import java.util.logging.Logger; ...@@ -36,10 +36,10 @@ import java.util.logging.Logger;
import com.sun.star.comp.Calc.NLPSolver.dialogs.BaseDialog; import com.sun.star.comp.Calc.NLPSolver.dialogs.BaseDialog;
public class Button extends LabeledControl { public class Button extends LabeledControl {
private String name; private String name;
private XButton xButton; private XButton xButton;
public Button(BaseDialog owner, String name) { public Button(BaseDialog owner, String name) {
super(owner.context); super(owner.context);
try { try {
...@@ -61,11 +61,11 @@ public class Button extends LabeledControl { ...@@ -61,11 +61,11 @@ public class Button extends LabeledControl {
super.setParentControl(parentControl); super.setParentControl(parentControl);
xButton = UnoRuntime.queryInterface(XButton.class, unoControl); xButton = UnoRuntime.queryInterface(XButton.class, unoControl);
} }
public void addActionListener(XActionListener actionListener) { public void addActionListener(XActionListener actionListener) {
xButton.addActionListener(actionListener); xButton.addActionListener(actionListener);
} }
public void setActionCommand(String actionCommand) { public void setActionCommand(String actionCommand) {
xButton.setActionCommand(actionCommand); xButton.setActionCommand(actionCommand);
} }
......
...@@ -36,7 +36,7 @@ import java.util.logging.Logger; ...@@ -36,7 +36,7 @@ import java.util.logging.Logger;
import com.sun.star.comp.Calc.NLPSolver.dialogs.BaseDialog; import com.sun.star.comp.Calc.NLPSolver.dialogs.BaseDialog;
public class Label extends LabeledControl { public class Label extends LabeledControl {
private String name; private String name;
public Label(BaseDialog owner, String name) { public Label(BaseDialog owner, String name) {
...@@ -74,5 +74,5 @@ public class Label extends LabeledControl { ...@@ -74,5 +74,5 @@ public class Label extends LabeledControl {
} }
return 0; return 0;
} }
} }
...@@ -34,17 +34,17 @@ public abstract class LabeledControl extends BaseControl { ...@@ -34,17 +34,17 @@ public abstract class LabeledControl extends BaseControl {
public LabeledControl(XComponentContext context) { public LabeledControl(XComponentContext context) {
super(context); super(context);
} }
public void setLabel(String label) { public void setLabel(String label) {
setProperty("Label", label); setProperty("Label", label);
} }
public void setAlign(TextAlign align) { public void setAlign(TextAlign align) {
setProperty("Align", new Short(align.getUnoValue())); setProperty("Align", new Short(align.getUnoValue()));
} }
public void setMultiLine(boolean multiLine) { public void setMultiLine(boolean multiLine) {
setProperty("MultiLine", new Boolean(multiLine)); setProperty("MultiLine", new Boolean(multiLine));
} }
} }
...@@ -31,13 +31,13 @@ public enum TextAlign { ...@@ -31,13 +31,13 @@ public enum TextAlign {
Left(0), Left(0),
Center(1), Center(1),
Right(2); Right(2);
private short unoValue; private short unoValue;
private TextAlign(int unoValue) { private TextAlign(int unoValue) {
this.unoValue = (short)unoValue; this.unoValue = (short)unoValue;
} }
public short getUnoValue() { public short getUnoValue() {
return unoValue; return unoValue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment