Search in sources :

Example 1 with BorderPos

use of net.sf.latexdraw.models.interfaces.shape.BorderPos in project latexdraw by arnobl.

the class TestHandLineStyle method testSelectBorderPosSelection.

@Test
public void testSelectBorderPosSelection() {
    new CompositeGUIVoidCommand(activateHand, selectionAddRec, selectionAddRec, updateIns).execute();
    final BorderPos style = bordersPosCB.getSelectionModel().getSelectedItem();
    selectBorderPos.execute();
    final BorderPos newStyle = bordersPosCB.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, drawing.getSelection().getShapeAt(0).getBordersPosition());
    assertEquals(newStyle, drawing.getSelection().getShapeAt(1).getBordersPosition());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) BorderPos(net.sf.latexdraw.models.interfaces.shape.BorderPos) Test(org.junit.Test)

Example 2 with BorderPos

use of net.sf.latexdraw.models.interfaces.shape.BorderPos in project latexdraw by arnobl.

the class TestPencilLineStyle method testSelectBorderPosPencil.

@Test
public void testSelectBorderPosPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesRec, updateIns).execute();
    final BorderPos style = bordersPosCB.getSelectionModel().getSelectedItem();
    selectBorderPos.execute();
    assertEquals(bordersPosCB.getSelectionModel().getSelectedItem(), pencil.createShapeInstance().getBordersPosition());
    assertNotEquals(style, bordersPosCB.getSelectionModel().getSelectedItem());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) BorderPos(net.sf.latexdraw.models.interfaces.shape.BorderPos) Test(org.junit.Test)

Example 3 with BorderPos

use of net.sf.latexdraw.models.interfaces.shape.BorderPos in project latexdraw by arnobl.

the class ShapeBorderCustomiser method initialize.

@Override
public void initialize(final URL location, final ResourceBundle 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());
    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.models.interfaces.shape.LineStyle) Image(javafx.scene.image.Image) EnumMap(java.util.EnumMap) BorderPos(net.sf.latexdraw.models.interfaces.shape.BorderPos)

Aggregations

BorderPos (net.sf.latexdraw.models.interfaces.shape.BorderPos)3 CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)2 Test (org.junit.Test)2 EnumMap (java.util.EnumMap)1 Image (javafx.scene.image.Image)1 LineStyle (net.sf.latexdraw.models.interfaces.shape.LineStyle)1