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