use of net.sf.latexdraw.model.api.shape.BorderPos in project latexdraw by arnobl.
the class TestPencilLineStyle method testSelectBorderPosPencil.
@Test
public void testSelectBorderPosPencil() {
Cmds.of(activatePencil, pencilCreatesRec, updateIns).execute();
final BorderPos style = bordersPosCB.getSelectionModel().getSelectedItem();
Cmds.of(selectBorderPos).execute();
assertEquals(bordersPosCB.getSelectionModel().getSelectedItem(), editing.createShapeInstance().getBordersPosition());
assertNotEquals(style, bordersPosCB.getSelectionModel().getSelectedItem());
}
use of net.sf.latexdraw.model.api.shape.BorderPos in project latexdraw by arnobl.
the class TestHandLineStyle method testSelectBorderPosSelection.
@Test
public void testSelectBorderPosSelection() {
Cmds.of(activateHand, selectionAddRec, selectionAddRec, updateIns).execute();
final BorderPos style = bordersPosCB.getSelectionModel().getSelectedItem();
Cmds.of(selectBorderPos).execute();
final BorderPos newStyle = bordersPosCB.getSelectionModel().getSelectedItem();
assertEquals(newStyle, drawing.getSelection().getShapeAt(0).orElseThrow().getBordersPosition());
assertEquals(newStyle, drawing.getSelection().getShapeAt(1).orElseThrow().getBordersPosition());
assertNotEquals(style, newStyle);
}
use of net.sf.latexdraw.model.api.shape.BorderPos in project latexdraw by arnobl.
the class ShapeBorderCustomiser method initialize.
@Override
public void initialize(final URL location, final ResourceBundle resources) {
super.initialize(location, resources);
thicknessPic.managedProperty().bind(thicknessPic.visibleProperty());
thicknessField.managedProperty().bind(thicknessField.visibleProperty());
lineCB.managedProperty().bind(lineCB.visibleProperty());
lineColButton.managedProperty().bind(lineColButton.visibleProperty());
bordersPosCB.managedProperty().bind(bordersPosCB.visibleProperty());
frameArcField.managedProperty().bind(frameArcField.visibleProperty());
frameArcPic.managedProperty().bind(frameArcPic.visibleProperty());
showPoints.managedProperty().bind(showPoints.visibleProperty());
opened.managedProperty().bind(opened.visibleProperty());
linePane.managedProperty().bind(linePane.visibleProperty());
linePane.visibleProperty().bind(thicknessField.visibleProperty().or(lineCB.visibleProperty()).or(lineColButton.visibleProperty()).or(bordersPosCB.visibleProperty()).or(frameArcField.visibleProperty()).or(showPoints.visibleProperty()));
final Map<BorderPos, Image> cachePos = new EnumMap<>(BorderPos.class);
// NON-NLS
cachePos.put(BorderPos.INTO, new Image("/res/doubleBoundary/double.boundary.into.png"));
// NON-NLS
cachePos.put(BorderPos.MID, new Image("/res/doubleBoundary/double.boundary.middle.png"));
// NON-NLS
cachePos.put(BorderPos.OUT, new Image("/res/doubleBoundary/double.boundary.out.png"));
initComboBox(bordersPosCB, cachePos, BorderPos.values());
final Map<LineStyle, Image> cacheStyle = new EnumMap<>(LineStyle.class);
// NON-NLS
cacheStyle.put(LineStyle.SOLID, new Image("/res/lineStyles/lineStyle.none.png"));
// NON-NLS
cacheStyle.put(LineStyle.DASHED, new Image("/res/lineStyles/lineStyle.dashed.png"));
// NON-NLS
cacheStyle.put(LineStyle.DOTTED, new Image("/res/lineStyles/lineStyle.dotted.png"));
initComboBox(lineCB, cacheStyle, LineStyle.values());
}