TransitionUtils { public static void initTransitionMotion(PdfPageTransition from, PDTransition to) { switch (from.getStyle()) { case BOX_INWARD: case SPLIT_HORIZONTAL_INWARD: case SPLIT_VERTICAL_INWARD: to.setMotion(PDTransitionMotion.I); break; case BOX_OUTWARD: case SPLIT_HORIZONTAL_OUTWARD: case SPLIT_VERTICAL_OUTWARD: to.setMotion(PDTransitionMotion.O); break; } } private  TransitionUtils(); static PDTransitionStyle getTransition(PdfPageTransitionStyle transition); static void initTransitionDimension(PdfPageTransition from, PDTransition to); static void initTransitionMotion(PdfPageTransition from, PDTransition to); static void initTransitionDirection(PdfPageTransition from, PDTransition to);  }
@Test public void testInitTransitionMotionBoxInward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion(PdfPageTransition.newInstance(PdfPageTransitionStyle.BOX_INWARD, 2, 2), to); assertEquals("I", to.getMotion()); }
@Test public void testInitTransitionMotionSplitHorizontalInward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion( PdfPageTransition.newInstance(PdfPageTransitionStyle.SPLIT_HORIZONTAL_INWARD, 2, 2), to); assertEquals("I", to.getMotion()); }
@Test public void testInitTransitionMotionSplitVerticalInward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion( PdfPageTransition.newInstance(PdfPageTransitionStyle.SPLIT_VERTICAL_INWARD, 2, 2), to); assertEquals("I", to.getMotion()); }
@Test public void testInitTransitionMotionBoxOnward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion(PdfPageTransition.newInstance(PdfPageTransitionStyle.BOX_OUTWARD, 2, 2), to); assertEquals("O", to.getMotion()); }
@Test public void testInitTransitionMotionSplitHorizontalOnward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion( PdfPageTransition.newInstance(PdfPageTransitionStyle.SPLIT_HORIZONTAL_OUTWARD, 2, 2), to); assertEquals("O", to.getMotion()); }
@Test public void testInitTransitionMotionSplitVerticalOnward() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion( PdfPageTransition.newInstance(PdfPageTransitionStyle.SPLIT_VERTICAL_OUTWARD, 2, 2), to); assertEquals("O", to.getMotion()); }
@Test public void testInitTransitionDefault() { PDTransition to = new PDTransition(); TransitionUtils.initTransitionMotion(PdfPageTransition.newInstance(PdfPageTransitionStyle.FADE, 2, 2), to); assertEquals("I", to.getMotion()); }