1 19 20 package org.netbeans.core.windows.view.ui.slides; 21 22 import java.awt.Component ; 23 import java.awt.Rectangle ; 24 25 32 public final class SlideOperationFactory { 33 34 private static final SlidingFx slideInFx = new ScaleFx(0.1f, 0.9f, true); 35 private static final SlidingFx slideOutFx = new ScaleFx(0.9f, 0.1f, false); 36 private static final SlidingFx slideIntoEdgeFx = new ScaleFx(0.9f, 0.1f, false); 37 private static final SlidingFx slideIntoDesktopFx = new ScaleFx(1.0f, 1.0f, true); 38 39 40 static final boolean EFFECTS_ENABLED = Boolean.getBoolean("nb.winsys.sliding.effects"); 42 private SlideOperationFactory() { 43 } 45 46 public static SlideOperation createSlideIn(Component component, 47 int orientation, boolean useEffect, boolean requestActivation) { 48 49 SlideOperation result = new SlideOperationImpl(SlideOperation.SLIDE_IN, 50 component, orientation, useEffect && EFFECTS_ENABLED ? slideInFx : null, 51 requestActivation); 52 53 return result; 54 } 55 56 public static SlideOperation createSlideOut(Component component, 57 int orientation, boolean useEffect, boolean requestActivation) { 58 59 SlideOperation result = new SlideOperationImpl(SlideOperation.SLIDE_OUT, 60 component, orientation, useEffect && EFFECTS_ENABLED ? slideOutFx : null, 61 requestActivation); 62 63 return result; 64 } 65 66 public static SlideOperation createSlideIntoEdge(Component component, 67 String side, boolean useEffect) { 68 69 SlideOperation result = new SlideOperationImpl(SlideOperation.SLIDE_INTO_EDGE, 70 component, side, useEffect && EFFECTS_ENABLED ? slideIntoEdgeFx : null, false); 71 72 return result; 73 } 74 75 public static SlideOperation createSlideIntoDesktop(Component component, 76 int orientation, boolean useEffect) { 77 78 SlideOperation result = new SlideOperationImpl(SlideOperation.SLIDE_INTO_DESKTOP, 79 component, orientation, useEffect && EFFECTS_ENABLED ? slideIntoDesktopFx : null, false); 80 81 return result; 82 } 83 84 public static SlideOperation createSlideResize(Component component, int orientation) { 85 SlideOperation result = new SlideOperationImpl(SlideOperation.SLIDE_RESIZE, 86 component, orientation, null, false); 87 88 return result; 89 } 90 91 public static SlideOperation createSlideResize(Component component, String side) { 92 return createSlideResize( component, SlideOperationImpl.side2Orientation( side ) ); 93 } 94 } | Popular Tags |