|
|
|
@ -48,7 +48,6 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
private static final int ANIMATE_START_TIME = 1000; |
|
|
|
|
private static final int ANIMATE_TIME = 2000; |
|
|
|
|
private AnimatePopupDialog animatePopupDialog; |
|
|
|
|
|
|
|
|
|
private AWTEventListener awtEventListener; |
|
|
|
|
|
|
|
|
|
private static final double[] ANIMATE_CONTROL_VALUE = {0.23, 1, 0.32, 1}; |
|
|
|
@ -104,7 +103,7 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
|
|
|
|
|
private void showPreviewPane() { |
|
|
|
|
synchronized (this) { |
|
|
|
|
CarouselStateManger.getInstance().suspend(); |
|
|
|
|
CarouselStateManger.getInstance().suspend(CarouselStateManger.MOUSE_HOVER); |
|
|
|
|
if (!showing) { |
|
|
|
|
showPreview(widget); |
|
|
|
|
showing = true; |
|
|
|
@ -119,7 +118,6 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
protected abstract void hidePreview(); |
|
|
|
|
|
|
|
|
|
private void hidePreviewPane() { |
|
|
|
|
CarouselStateManger.getInstance().start(); |
|
|
|
|
if (showing) { |
|
|
|
|
hidePreview(); |
|
|
|
|
showing = false; |
|
|
|
@ -176,7 +174,7 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void animate(ScheduledExecutorService service) { |
|
|
|
|
CarouselStateManger.getInstance().suspend(); |
|
|
|
|
CarouselStateManger.getInstance().suspend(CarouselStateManger.FIRST_DRAG_ANIMATE); |
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0); |
|
|
|
|
BezierCubic cubic = new BezierCubic(ANIMATE_CONTROL_VALUE[0], ANIMATE_CONTROL_VALUE[1], ANIMATE_CONTROL_VALUE[2], ANIMATE_CONTROL_VALUE[3]); |
|
|
|
|
Point startPoint = new Point(this.getLocationOnScreen().x - 5, this.getLocationOnScreen().y - 5); |
|
|
|
@ -193,7 +191,7 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
ComponentReuseNotificationInfo.getInstance().setFirstDragEndTime(System.currentTimeMillis()); |
|
|
|
|
DesignerEnvManager.getEnvManager().saveXMLFile(); |
|
|
|
|
java.awt.Toolkit.getDefaultToolkit().removeAWTEventListener(awtEventListener); |
|
|
|
|
CarouselStateManger.getInstance().start(); |
|
|
|
|
CarouselStateManger.getInstance().start(CarouselStateManger.FIRST_DRAG_ANIMATE); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
double progress = calXProgress(atomicInteger.getAndIncrement() * 20, cubic); |
|
|
|
@ -220,7 +218,9 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
hover = false; |
|
|
|
|
this.hidePreviewPane(); |
|
|
|
|
|
|
|
|
|
if(!FirstDragAnimateStateManager.getInstance().animating()){ |
|
|
|
|
CarouselStateManger.getInstance().start(CarouselStateManger.MOUSE_HOVER); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|