KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > view > ui > slides > DefaultSlidingFx


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.core.windows.view.ui.slides;
21
22 import java.awt.Color JavaDoc;
23 import java.awt.Component JavaDoc;
24 import java.awt.Graphics2D JavaDoc;
25 import java.awt.Rectangle JavaDoc;
26 import javax.swing.JLayeredPane JavaDoc;
27 import javax.swing.event.ChangeListener JavaDoc;
28
29 /**
30  * default impl of SlidingFX.
31  * Acts as command interface
32  * for desktop part of winsys to be able to request slide operation.
33  *
34  * @author Milos Kleint
35  */

36 public class DefaultSlidingFx implements SlidingFx {
37
38
39     public void showEffect(JLayeredPane JavaDoc pane, Integer JavaDoc layer, SlideOperation operation) {
40 // Component comp = operation.getComponent();
41
// Graphics2D gr2d = (Graphics2D)pane.getGraphics();
42
// Color original = gr2d.getColor();
43
// gr2d.setColor(Color.BLUE.darker().darker());
44
// Rectangle start = operation.getStartBounds();
45
// Rectangle finish = operation.getFinishBounds();
46
// Rectangle current = start;
47
// for (int i = 0; i < 6 /** magic constant **/; i++) {
48
// Rectangle newRect;
49
// if (i > 0) {
50
// // wipe out old
51
// }
52
// newRect = new Rectangle();
53
// newRect.x = Math.abs((current.x + finish.x) / 2);
54
// newRect.y = Math.abs((current.y + finish.y) / 2);
55
// newRect.height = Math.abs((current.height + finish.height) / 2);
56
// newRect.width = Math.abs((current.width + finish.width) / 2);
57
// gr2d.drawRect(newRect.x, newRect.y, newRect.width, newRect.height);
58
// gr2d.setColor(gr2d.getColor().brighter());
59
// current = newRect;
60
// }
61
// gr2d.setColor(original);
62
//// try {
63
//// Thread.sleep(5000);
64
//// } catch (Throwable th) {
65
////
66
//// }
67

68     }
69      
70     public void prepareEffect(SlideOperation operation) {
71         // no preparation needed
72
}
73     
74     public void setFinishListener(ChangeListener JavaDoc finishL) {
75         // no noperation, operation don't need to wait
76
}
77     
78     public boolean shouldOperationWait() {
79         return false;
80     }
81     
82 }
Popular Tags