@Test public void click() { Button button = (Button) getPrimaryStage().getScene().getRoot().lookup(".button"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { RFXButtonBase rfxButtonBase = new RFXButtonBase(button, null, null, lr); Point2D sceneXY = button.localToScene(new Point2D(3, 3)); PickResult pickResult = new PickResult(button, sceneXY.getX(), sceneXY.getY()); Point2D screenXY = button.localToScreen(new Point2D(3, 3)); MouseEvent me = new MouseEvent(button, button, MouseEvent.MOUSE_PRESSED, 3, 3, sceneXY.getX(), screenXY.getY(), MouseButton.PRIMARY, 1, false, false, false, false, true, false, false, false, false, false, pickResult); rfxButtonBase.mouseButton1Pressed(me); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording select = recordings.get(0); AssertJUnit.assertEquals("click", select.getCall()); AssertJUnit.assertEquals("", select.getParameters()[0]); }
@Override protected void mouseButton1Pressed(MouseEvent me) { if (!node.isDisabled()) { recorder.recordClick(this, me); } }
RFXButtonBase extends RFXComponent { @Override protected void mouseButton1Pressed(MouseEvent me) { if (!node.isDisabled()) { recorder.recordClick(this, me); } } }
RFXButtonBase extends RFXComponent { @Override protected void mouseButton1Pressed(MouseEvent me) { if (!node.isDisabled()) { recorder.recordClick(this, me); } } RFXButtonBase(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXButtonBase extends RFXComponent { @Override protected void mouseButton1Pressed(MouseEvent me) { if (!node.isDisabled()) { recorder.recordClick(this, me); } } RFXButtonBase(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); }
RFXButtonBase extends RFXComponent { @Override protected void mouseButton1Pressed(MouseEvent me) { if (!node.isDisabled()) { recorder.recordClick(this, me); } } RFXButtonBase(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); static final Logger LOGGER; }