本文整理汇总了Java中com.sun.awt.AWTUtilities.setWindowOpacity方法的典型用法代码示例。如果您正苦于以下问题:Java AWTUtilities.setWindowOpacity方法的具体用法?Java AWTUtilities.setWindowOpacity怎么用?Java AWTUtilities.setWindowOpacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.awt.AWTUtilities
的用法示例。
在下文中一共展示了AWTUtilities.setWindowOpacity方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e)
{
// fade out
for(float i=1.0f; i>=0;i-=0.05f)
try{
AWTUtilities.setWindowOpacity(this, i);
Thread.sleep(50);
}
catch (Exception e2){
}
// dispose it
if(timer != null)
timer.stop();
this.dispose();
}
示例2: mouseReleased
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public void mouseReleased () {
if (isDrawRect) {
servoList.add (mouseX, mouseY);
isDrawRect = false;
}
servoList.removeOut ();
servoList.checkOut ();
servoList.checkClash ();
servoList.removeOut ();//////////////
servoList.fixInRange ();
servoList.CheckIdClash ();
timeLine.isBeginMove = false;
isMoveWindow = false;
AWTUtilities.setWindowOpacity(frame, 1.0f);
// for (int i=0; i < servoList.list.size (); i++) {
// Servo servo = servoList.list.get(i);
// println ("++"+servo.getPx1()+" "+servo.getPx2()+" "+servo.getPy1()+" "+ servo.getPy2());
// }
if (isMoveFace)
isMoveFace = false;
}
示例3: WelcomeDialog
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public WelcomeDialog() {
setSize(600, 450);
this.setLocationRelativeTo(null);// 窗口在屏幕中间显示
this.setLayout(new BorderLayout());
this.setUndecorated(true);
// 设置透明度
AWTUtilities.setWindowOpacity(this, 0.8f);
}
示例4: easeOpacity
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public void easeOpacity(float opacity) {
if (opacity <= 0) {
opacity = 0;
return;
} else if (opacity > 1) {
opacity = 1;
}
AWTUtilities.setWindowOpacity(loginDialog, opacity);
}
示例5: run
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public void run()
{
splash = new JWindow();
JPanel content = new JPanel();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
URL url=ClassLoader.getSystemResource("Data/splash.jpg");
JLabel label = new JLabel(new ImageIcon(url));
content.add(label,BorderLayout.CENTER);
content.setBorder(BorderFactory.createLineBorder(Color.black, 1));
splash.add(content);
splash.pack();
Dimension s=splash.getSize();
int x = (screen.width-s.width)/2;
int y = (screen.height-s.height)/2;
splash.setBounds(x,y,s.width,s.height);
AWTUtilities.setWindowOpacity(splash,Float.valueOf(0));
ii=0;
splash.setVisible(true);
alphaChanger = new Timer(60,new ActionListener() {
private float incrementer = .1f;
@Override
public void actionPerformed(ActionEvent e)
{
ii=ii+incrementer;
if(ii>((float)0.9))
{
alphaChanger.stop();
AWTUtilities.setWindowOpacity(splash,Float.valueOf(1));
try{
Thread.sleep(1500);
}catch(InterruptedException ex){}
splash.setVisible(false);
}
AWTUtilities.setWindowOpacity(splash,Float.valueOf(ii));
}
});
alphaChanger.start();
}
示例6: IntroScreen
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public IntroScreen(){
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds((int)(screenSize.getWidth()-640)/2,(int)(screenSize.getHeight()-480)/2,640,480);
setUndecorated(true);
setAlwaysOnTop(true);
try{if(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT))
AWTUtilities.setWindowOpaque(this, false);
else if(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT))
AWTUtilities.setWindowOpacity(this, 0.7f);}
catch(Exception e){e.printStackTrace();}
}
示例7: setFrameOpacity
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
private final void setFrameOpacity( float opacity ) {
// this could be validated on Java 7
// but prior to that, we only have the
// exception to know.
try {
AWTUtilities.setWindowOpacity(frame, opacity );
} catch( UnsupportedOperationException uoe ) {
System.err.println("Ignoring uoe: "+ uoe.getMessage());
}
}
示例8: fadein
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
/**
* Fades the window and sets it visible
* @param window
*/
private static void fadein(JWindow window)
{
AWTUtilities.setWindowOpacity(window, 0.3f);
AWTUtilities.setWindowOpacity(window, 0.5f);
AWTUtilities.setWindowOpacity(window, 0.9f);
window.setVisible(true);
}
示例9: applyProperty
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public void applyProperty(final CPlatformWindow c, final Object value) {
AWTUtilities.setWindowOpacity(c.target, value == null ? 1.0f : Float.parseFloat(value.toString()));
}
示例10: testCloseTime
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public static void testCloseTime() throws AWTException, IOException, InterruptedException
{
int sizeX = 1024;
int sizeY = 1024;
int sizeZ = 512;
byte[][][] dataA = new byte[sizeX][sizeY][sizeZ];
byte[][][] dataB = new byte[sizeX][sizeY][sizeZ];
byte[][][] liveData = new byte[sizeX][sizeY][sizeZ];
OCTVolumeDivider divide = new OCTVolumeDivider();
ArrayToolkit.fillRandom(dataA);
ArrayToolkit.fillRandom(dataB);
JFrame main = FrameFactroy.getFrame(divide);
ArrayToolkit.clone(dataA, liveData);
divide.setData(liveData);
JFrame block= new JFrame();
block.setBackground(Color.RED);
block.setUndecorated(true);
AWTUtilities.setWindowOpacity(block, 0.1f);
Robot robot = new Robot();
FrameWaitForClose.showWaitFrame();
final CompoentRecorder recorder = divide.getVolumeViewer().getViewPanel().getRecorder();
recorder.setPause(true);
recorder.startRecording("c:\\test\\", "movie.avi", 15);
main.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosed(WindowEvent e)
{
super.windowClosed(e);
try
{
recorder.stopRecording();
} catch (IOException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
for (int i = 0; i < 10; i++)
{
ArrayToolkit.clone(i%2==0?dataA:dataB,liveData);
//block.setBounds(main.getBounds());
//block.setVisible(true);
recorder.setPause(true);
divide.updateData();
Thread.sleep(500);
//block.setVisible(false);
recorder.setPause(false);
// FrameWaitForClose.showWaitFrame();
}
recorder.stopRecording();
}
示例11: mousePressed
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
/******************** start of mouseProcess.pde ********************/
//
public void mousePressed () {
//while mouse clicked the add button, then add a new Servo
if (!timeLine.isStart && inRectRange (add_x, add_y, add_x+add_w, add_y+add_h)) {
isDrawRect = true;
}
else //if mouse pressed in top of windows, then set move windows
if (inRectRange (0, 0, width-75, 30)) {
AWTUtilities.setWindowOpacity(frame, 0.9f);
isMoveWindow = true;
cx = mouseX;
cy = mouseY;
}
//show the Time line
servoList.showTimeLine ();
boolean isInRange = servoList.isOneInRange ();
if (!isInRange) { //if none of Servos is in mouse Range
servoList.currentServo = null;
//if mouse left dragged and mouse is the space area in the rect,then set move face
if (mouseButton == LEFT && inRectRange (minX, minY, maxX, maxY)) {
isMoveFace = true;
moveOldX = mouseX;
}
}
//if mouse center button is pressed, then set move face
if (mouseButton == CENTER) {
isMoveFace = true;
moveOldX = mouseX;
}
if (mouseButton == LEFT) {
if (!isInRange && inRectRange (minX, minY, maxX-100, maxY) && !timeLine.isStart) {
;//servoList.add (mouseX, mouseY);
//servoList.list.get (servoList.list.size ()-1).isMove = true;
}
else if (timeLine.inRange ()) {
//if mouse left button is pressed and in timeline button range, then set move timeline
timeLine.isBeginMove = true;
}
}
else if (keyPressed && key == CODED && keyCode == CONTROL && mouseButton == RIGHT) {
// if control key pressed and mouse right button clicked, then delete a Servo which in mouse range
servoList.remove ();
}
//fix bug
if (isPlayModeOpen)
fileOpenButton.playModeButton.setOpen (false);
if (isPortSelectOpen)
serialOpen.serialList.setOpen (false);
if (isBaudSelectOpen)
serialOpen.baudSelect.setOpen (false);
if ( fileOpenButton.playModeButton.isOpen ())
isPlayModeOpen = true;
else
isPlayModeOpen = false;
if ( serialOpen.serialList.isOpen ())
isPortSelectOpen = true;
else
isPortSelectOpen = false;
if ( serialOpen.baudSelect.isOpen ())
isBaudSelectOpen = true;
else
isBaudSelectOpen = false;
//println (fileOpenButton.playModeButton.isOpen ());
}
示例12: createGUI
import com.sun.awt.AWTUtilities; //导入方法依赖的package包/类
public void createGUI() {
setBackground(AutoMacronUIHelper.BG_COLOR);
setAlwaysOnTop(true);
((JComponent) getContentPane()).setBorder(new LineBorder(AutoMacronUIHelper.LIGHT_GREY_COLOR, 2));
setPreferredSize(new Dimension(WIDTH, HEIGHT));
AWTUtilities.setWindowOpacity(this, .95f);
Box scoreContainer = Box.createVerticalBox();
scoreContainer.add(UIHelper.createLabel(" Score ", UIHelper.VER_12_BOLD, AutoMacronUIHelper.GREY_COLOR));
scoreContainer.add(Box.createVerticalStrut(20));
scoreContainer.add(new CircularScoreIndicator(macro.getMotif()));
scoreContainer.setBorder(new MatteBorder(0, 0, 0, 1, AutoMacronUIHelper.LIGHT_GREY_COLOR));
add(scoreContainer, BorderLayout.WEST);
// We wish to show e
ImageIcon icon = AutoMacronUIHelper.scaleImageIcon(macro.getGlyphGranularities().get(RenderingType.FULL).getAbsolutePath(), 250, 250);
ImageIcon abstractIcon = AutoMacronUIHelper.scaleImageIcon(macro.getGlyphGranularities().get(RenderingType.ABSTRACT).getAbsolutePath(), 70, 70);
ImageIcon mediumIcon = AutoMacronUIHelper.scaleImageIcon(macro.getGlyphGranularities().get(RenderingType.MEDIUM).getAbsolutePath(), 70, 70);
ImageIcon detailedIcon = AutoMacronUIHelper.scaleImageIcon(macro.getGlyphGranularities().get(RenderingType.DETAILED).getAbsolutePath(), 70, 70);
Box detailContainer = Box.createVerticalBox();
detailContainer.add(UIHelper.createLabel(" Detailed Rendering ", UIHelper.VER_12_BOLD, AutoMacronUIHelper.GREY_COLOR));
detailContainer.add(Box.createVerticalStrut(20));
detailContainer.add(UIHelper.wrapComponentInPanel(new JLabel(icon)));
detailContainer.setBorder(new MatteBorder(0, 0, 0, 1, AutoMacronUIHelper.LIGHT_GREY_COLOR));
add(detailContainer, BorderLayout.CENTER);
Box otherIconContainer = Box.createVerticalBox();
otherIconContainer.add(UIHelper.createLabel(" Macro Renderings ", UIHelper.VER_12_BOLD, AutoMacronUIHelper.GREY_COLOR));
otherIconContainer.add(Box.createVerticalStrut(30));
otherIconContainer.add(UIHelper.createLabel("Abstract Macro", UIHelper.VER_9_PLAIN, AutoMacronUIHelper.GREY_COLOR));
otherIconContainer.add(new JLabel(abstractIcon));
otherIconContainer.add(Box.createVerticalStrut(5));
otherIconContainer.add(UIHelper.createLabel("Medium Macro", UIHelper.VER_9_PLAIN, AutoMacronUIHelper.GREY_COLOR));
otherIconContainer.add(new JLabel(mediumIcon));
otherIconContainer.add(Box.createVerticalStrut(5));
otherIconContainer.add(UIHelper.createLabel("Detailed Macro", UIHelper.VER_9_PLAIN, AutoMacronUIHelper.GREY_COLOR));
otherIconContainer.add(new JLabel(detailedIcon));
add(otherIconContainer, BorderLayout.EAST);
pack();
}