use of net.sf.latexdraw.ui.TextAreaAutoSize in project latexdraw by arnobl.
the class TestCanvasCreation method setUp.
@Override
@Before
public void setUp() {
super.setUp();
setter = (TextSetter) injectorFactory.call(TextSetter.class);
when(hand.isActivated()).thenReturn(false);
when(setter.isActivated()).thenReturn(false);
textAutoSize = new TextAreaAutoSize();
when(setter.getTextField()).thenReturn(textAutoSize);
pencil.setActivated(true);
drawing = canvas.getDrawing();
canvas.getMagneticGrid().setMagnetic(false);
WaitForAsyncUtils.waitForFxEvents(100);
canvas.toFront();
}
use of net.sf.latexdraw.ui.TextAreaAutoSize in project latexdraw by arnobl.
the class TestEditingSelector method testClickTextCreatesText.
@Test
public void testClickTextCreatesText() {
final TextAreaAutoSize textfield = Mockito.mock(TextAreaAutoSize.class);
Mockito.when(textSetter.getTextField()).thenReturn(textfield);
Mockito.when(textSetter.isActivated()).thenReturn(true);
Mockito.when(textfield.getText()).thenReturn("foo");
clickOn(selector.handB);
waitFXEvents.execute();
assertEquals(1, drawing.size());
assertTrue(drawing.getShapeAt(0) instanceof IText);
assertEquals("foo", ((IText) drawing.getShapeAt(0)).getText());
}
use of net.sf.latexdraw.ui.TextAreaAutoSize in project latexdraw by arnobl.
the class TestEditingSelector method testClickTextNoTextCauseNotActivated.
@Test
public void testClickTextNoTextCauseNotActivated() {
final TextAreaAutoSize textfield = Mockito.mock(TextAreaAutoSize.class);
Mockito.when(textSetter.getTextField()).thenReturn(textfield);
Mockito.when(textSetter.isActivated()).thenReturn(false);
clickOn(selector.handB);
waitFXEvents.execute();
assertTrue(drawing.isEmpty());
}
use of net.sf.latexdraw.ui.TextAreaAutoSize in project latexdraw by arnobl.
the class TestEditingSelector method testClickTextNoTextCauseNoText.
@Test
public void testClickTextNoTextCauseNoText() {
final TextAreaAutoSize textfield = Mockito.mock(TextAreaAutoSize.class);
Mockito.when(textSetter.getTextField()).thenReturn(textfield);
Mockito.when(textSetter.isActivated()).thenReturn(true);
Mockito.when(textfield.getText()).thenReturn("");
clickOn(selector.handB);
waitFXEvents.execute();
assertTrue(drawing.isEmpty());
}
Aggregations