Search in sources :

Example 1 with LineStyle

use of net.sf.latexdraw.model.api.shape.LineStyle in project latexdraw by arnobl.

the class TestHandLineStyle method testSelectLineStyleSelection.

@Test
public void testSelectLineStyleSelection() {
    Cmds.of(activateHand, selectionAddRec, selectionAddRec, updateIns).execute();
    final LineStyle style = lineCB.getSelectionModel().getSelectedItem();
    Cmds.of(selectLineStyle).execute();
    final LineStyle newStyle = lineCB.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, drawing.getSelection().getShapeAt(0).orElseThrow().getLineStyle());
    assertEquals(newStyle, drawing.getSelection().getShapeAt(1).orElseThrow().getLineStyle());
    assertNotEquals(style, newStyle);
}
Also used : LineStyle(net.sf.latexdraw.model.api.shape.LineStyle) Test(org.junit.Test)

Example 2 with LineStyle

use of net.sf.latexdraw.model.api.shape.LineStyle 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());
}
Also used : LineStyle(net.sf.latexdraw.model.api.shape.LineStyle) Image(javafx.scene.image.Image) EnumMap(java.util.EnumMap) BorderPos(net.sf.latexdraw.model.api.shape.BorderPos)

Example 3 with LineStyle

use of net.sf.latexdraw.model.api.shape.LineStyle in project latexdraw by arnobl.

the class TestPencilLineStyle method testSelectLineStylePencil.

@Test
public void testSelectLineStylePencil() {
    Cmds.of(activatePencil, pencilCreatesRec, updateIns).execute();
    final LineStyle style = lineCB.getSelectionModel().getSelectedItem();
    Cmds.of(selectLineStyle).execute();
    assertEquals(lineCB.getSelectionModel().getSelectedItem(), editing.createShapeInstance().getLineStyle());
    assertNotEquals(style, lineCB.getSelectionModel().getSelectedItem());
}
Also used : LineStyle(net.sf.latexdraw.model.api.shape.LineStyle) Test(org.junit.Test)

Aggregations

LineStyle (net.sf.latexdraw.model.api.shape.LineStyle)3 Test (org.junit.Test)2 EnumMap (java.util.EnumMap)1 Image (javafx.scene.image.Image)1 BorderPos (net.sf.latexdraw.model.api.shape.BorderPos)1