Skip to content

Commit

Permalink
Fixed issue #1072.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Jul 14, 2024
1 parent d7d22b1 commit 35166bf
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CoordinatesDesign extends Dialog {
final BigDecimalSpinner[] spnZPtr = new BigDecimalSpinner[1];
final NButton[] btnClipboardPtr = new NButton[1];
final NButton[] btnManipulatorPtr = new NButton[1];
final NButton[] btnSetManipulatorPtr = new NButton[1];

Vertex m = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Vertex c = new Vertex(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
Expand All @@ -85,7 +86,7 @@ class CoordinatesDesign extends Dialog {
} else {
c = new Vertex(clipboardVertex.xp, clipboardVertex.yp, clipboardVertex.zp);
}

}
}

Expand Down Expand Up @@ -206,6 +207,17 @@ protected Control createDialogArea(Composite parent) {
spnZ.setValue(v.zp);
}

{
Composite cmpTxt = new Composite(cmpContainer, SWT.NONE);
cmpTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
cmpTxt.setLayout(new GridLayout(1, true));
NButton btnSetManipulator = new NButton(cmpTxt, SWT.NONE);
this.btnSetManipulatorPtr[0] = btnSetManipulator;
btnSetManipulator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
btnSetManipulator.setImage(ResourceManager.getImage("icon8_local.png")); //$NON-NLS-1$
btnSetManipulator.setText(I18n.COORDINATESDIALOG_SET_MANIPULATOR);
}

cmpContainer.pack();
return cmpContainer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ public int open() {
}
updateXYZ();
});
widgetUtil(btnSetManipulatorPtr[0]).addSelectionListener(e -> {
mani.getPosition().set(vertex.x, vertex.y, vertex.z, 1f);
mani.setAccuratePosition(vertex.xp, vertex.yp, vertex.zp);
setReturnCode(CANCEL);
close();
});
widgetUtil(btnCopyPtr[0]).addSelectionListener(e -> {
creatingCopy = true;
setReturnCode(OK);
Expand Down
13 changes: 7 additions & 6 deletions src/org/nschmidt/ldparteditor/i18n/CoordinatesDialog.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CLIPBOARD = Set Coordinates to Clipboard Vertex Position
MANIPULATOR = Set Coordinates to Manipulator Position
SET_XYZ = Set X/Y/Z:
X = X
Y = Y
Z = Z
CLIPBOARD = Set Coordinates to Clipboard Vertex Position
MANIPULATOR = Set Coordinates to Manipulator Position
SET_MANIPULATOR = Set Manipulator Position to Coordinates (exit)
SET_XYZ = Set X/Y/Z:
X = X
Y = Y
Z = Z
2 changes: 1 addition & 1 deletion src/org/nschmidt/ldparteditor/i18n/Editor3D.properties
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ SELECT_VERTEX = Select Single Vertex
SELECTION = Selection:
SET_ACCURACY = Set accuracy:
SET_ICON_SIZE = Set Icon Size\u2026
SET_XYZ = Set X/Y/Z (for Selection)
SET_XYZ = Set X/Y/Z (for Selection / Manipulator)
SHOW_ALL = Show All
SHOW_ERROR_LOGS = Show Error Logs
SLANTING_MATRIX_PROJECTOR = SlantingMatrixProjector
Expand Down
1 change: 1 addition & 0 deletions src/org/nschmidt/ldparteditor/i18n/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private static void adjust() { // Calculate line offset
public static final String COMPOSITETAB_WARNINGS = COMPOSITETAB.getString(getProperty());
public static final String COORDINATESDIALOG_CLIPBOARD = COORDINATESDIALOG.getString(getProperty());
public static final String COORDINATESDIALOG_MANIPULATOR = COORDINATESDIALOG.getString(getProperty());
public static final String COORDINATESDIALOG_SET_MANIPULATOR = COORDINATESDIALOG.getString(getProperty());
public static final String COORDINATESDIALOG_SET_XYZ = COORDINATESDIALOG.getString(getProperty());
public static final String COORDINATESDIALOG_X = COORDINATESDIALOG.getString(getProperty());
public static final String COORDINATESDIALOG_Y = COORDINATESDIALOG.getString(getProperty());
Expand Down

0 comments on commit 35166bf

Please sign in to comment.