X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fdialog%2FComponentSelectionDialog.java;h=35e761ccfa6eb436071352e6721b192e67255f76;hb=9029e681fb0c47e9041c5527b966a247b23029b3;hp=720d88cec826729ba748870ace5a4acb7472b02a;hpb=24771e19204e33f6701321f63f57a751e022197a;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java b/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java index 720d88ce..35e761cc 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java @@ -53,6 +53,8 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange private static final String DIALOG = "ComponentSelectionDialog"; //$NON-NLS-1$ private IDialogSettings dialogSettings; + + private double lengthFactor = 1.0; private ResourceManager resourceManager; @@ -126,6 +128,10 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange if (dialogSettings == null) dialogSettings = settings.addNewSection(DIALOG); } + + public void setLengthFactor(double lengthFactor) { + this.lengthFactor = lengthFactor; + } @Override protected IDialogSettings getDialogBoundsSettings() { @@ -317,7 +323,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange @Override public void keyReleased(KeyEvent e) { try { - length = Double.parseDouble(lengthText.getText()); + length = Double.parseDouble(lengthText.getText()) / lengthFactor; } catch (NumberFormatException err) { length = null; } @@ -353,7 +359,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange @Override public void keyReleased(KeyEvent e) { try { - diameter = Double.parseDouble(diameterText.getText()); + diameter = Double.parseDouble(diameterText.getText()) / lengthFactor; } catch (NumberFormatException err) { diameter = null; } @@ -365,7 +371,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange @Override public void keyReleased(KeyEvent e) { try { - turnRadius = Double.parseDouble(turnRadiusText.getText()); + turnRadius = Double.parseDouble(turnRadiusText.getText()) / lengthFactor; } catch (NumberFormatException err) { turnRadius = null; }