当前位置: 首页>>代码示例>>Java>>正文


Java Timeline.addCallback方法代码示例

本文整理汇总了Java中org.pushingpixels.trident.Timeline.addCallback方法的典型用法代码示例。如果您正苦于以下问题:Java Timeline.addCallback方法的具体用法?Java Timeline.addCallback怎么用?Java Timeline.addCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pushingpixels.trident.Timeline的用法示例。


在下文中一共展示了Timeline.addCallback方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fadeOutAndEnd

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
/**
     * @param window
     * @param fadeOutDuration
     */
    private static void fadeOutAndEnd(final Window window, int fadeOutDuration, 
            final boolean exit) {
        Timeline dispose = new Timeline(new WindowFader(window));
        dispose.addPropertyToInterpolate("opacity", 1.0f,
//                AWTUtilitiesWrapper.getWindowOpacity(window), 
                0.0f);
        dispose.addCallback(new UIThreadTimelineCallbackAdapter() {
            @Override
            public void onTimelineStateChanged(TimelineState oldState,
                    TimelineState newState, float durationFraction,
                    float timelinePosition) {
                if (newState == TimelineState.DONE) {
                    if (exit) {
                        Runtime.getRuntime().exit(0);
                    } else {
                        window.dispose();
                    }
                }
            }
        });
        dispose.setDuration(fadeOutDuration);
        dispose.play();
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:DemoUtils.java

示例2: fadeOutAndEnd

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
/**
   * @param window
   * @param fadeOutDuration
   */
  private static void fadeOutAndEnd(final Window window, int fadeOutDuration, 
          final boolean exit) {
      Timeline dispose = new Timeline(new WindowFader(window));
      dispose.addPropertyToInterpolate("opacity", 1.0f,
//              AWTUtilitiesWrapper.getWindowOpacity(window), 
              0.0f);
      dispose.addCallback(new UIThreadTimelineCallbackAdapter() {
          @Override
          public void onTimelineStateChanged(TimelineState oldState,
                  TimelineState newState, float durationFraction,
                  float timelinePosition) {
              if (newState == TimelineState.DONE) {
                  if (exit) {
                      Runtime.getRuntime().exit(0);
                  } else {
                      window.dispose();
                  }
              }
          }
      });
      dispose.setDuration(fadeOutDuration);
      dispose.play();
  }
 
开发者ID:wangqi,项目名称:gameserver,代码行数:28,代码来源:MyWindowUtil.java

示例3: configure

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
/**
 * Configures the achievement.
 */
private void configure() {

	// create a new achievement
	if(view == null) {
		window = new AchievementWindow(title, description, config);
	} else {
		window = new AchievementWindow(context, view, config);
	}

	// set the window height and width
	config.setWindowHeight(window.getHeight());
	config.setWindowWidth(window.getWidth());

	// create the three timelines
	timelineIntro = new Timeline(window);
	timelineStay = new Timeline(window);
	timelineAway = new Timeline(window);

	// configure the intro animation, when the window enters
	timelineIntro.addPropertyToInterpolate("position",
			config.getInitialCoordinates(), config.getFinalCoordinates());
	timelineIntro.addCallback(new AudioCallback(this, timelineStay));
	timelineIntro.setDuration(config.getInDuration());

	// configure the time the window should wait in the screen
	timelineStay.setDuration(config.getDuration());
	timelineStay.addCallback(new SimpleCallback(timelineAway));

	// configure the end animation, when the window goes away
	timelineAway.addPropertyToInterpolate("position",
			config.getFinalCoordinates(), config.getInitialCoordinates());
	timelineAway.setDuration(config.getOutDuration());
	timelineAway.addCallback(new EndCallback(window));
}
 
开发者ID:thahn0720,项目名称:agui_framework,代码行数:38,代码来源:Achievement.java

示例4: done

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
@Override
protected void done() {
	final LoginDialog dialog = LoginDialog.getInstance();
	if ( !loginResult ) {
		dialog.getResultLabel().setText("登陆失败");
		dialog.getOKButton().setEnabled(true);
		dialog.getOKButton().setText("确定");
	} else {
		ConfigManager.saveConfigKeyValue(ConfigKey.adminUsername, username);
		ConfigManager.saveConfigKeyValue(ConfigKey.adminPassword, password);
		ConfigManager.saveConfigKeyValue(ConfigKey.adminDatabaseServer, mongoServer);
		
		Point to = dialog.getLocation();
		to.y = MainFrame.screenHeight;
		Timeline timeline = MyWindowUtil.createLocationTimeline(dialog, to, 200);
		timeline.addCallback(new TimelineCallbackAdapter() {

			/* (non-Javadoc)
			 * @see org.pushingpixels.trident.callback.TimelineCallbackAdapter#onTimelineStateChanged(org.pushingpixels.trident.Timeline.TimelineState, org.pushingpixels.trident.Timeline.TimelineState, float, float)
			 */
			@Override
			public void onTimelineStateChanged(TimelineState oldState,
					TimelineState newState, float durationFraction,
					float timelinePosition) {
				if ( newState == TimelineState.DONE ) {
					dialog.dispose();
				}
			}
			
		});
		timeline.play();
	}
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:34,代码来源:LoginService.java

示例5: doDropAnimation

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
private void doDropAnimation() {
    dropTimeline = new Timeline(this);
    dropTimeline.addCallback(this);
    dropTimeline.addPropertyToInterpolate("ImageScale", 6f, 1f);
    dropTimeline.setDuration(500);
    dropTimeline.play();
}
 
开发者ID:magarena,项目名称:magarena,代码行数:8,代码来源:AboutContentPanel.java

示例6: getShrinkTimeline

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
private Timeline getShrinkTimeline() {
    final Timeline timeline = new Timeline(this);
    timeline.addPropertyToInterpolate("ShrinkRectangle", getPreviewRectangle(), getEnd());
    timeline.setDuration(SHRINK_DURATION);
    timeline.setEase(new Spline(0.8f));
    timeline.addCallback(new TimelineCallbackAdapter() {
        @Override
        public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
            if (newState == Timeline.TimelineState.DONE) {
                scenario.cancel();
            }
        }
    });
    return timeline;
}
 
开发者ID:magarena,项目名称:magarena,代码行数:16,代码来源:CardAnimation.java

示例7: getViewTimeline

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
private Timeline getViewTimeline() {
    final Timeline timeline = new Timeline();
    timeline.setDuration(getViewDuration());
    timeline.addCallback(new TimelineCallbackAdapter() {
        @Override
        public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
            if (newState == Timeline.TimelineState.PLAYING_FORWARD) {
                // ensures arrow is painted correctly.
                getCanvas().repaint();
            }
        }
    });
    return timeline;
}
 
开发者ID:magarena,项目名称:magarena,代码行数:15,代码来源:CardAnimation.java

示例8: trackTabModification

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
private void trackTabModification(int tabIndex, Component tabComponent) {
	Timeline modifiedTimeline = new Timeline(tabPane);
	AnimationConfigurationManager.getInstance().configureModifiedTimeline(
			modifiedTimeline);
	modifiedTimeline.addCallback(new TabRepaintCallback(tabPane, tabIndex));
	modifiedTimeline.playLoop(RepeatBehavior.REVERSE);
	modifiedTimelines.put(tabComponent, modifiedTimeline);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:9,代码来源:SubstanceTabbedPaneUI.java

示例9: nextCall

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
private void nextCall(){
	if( isBusy || queue.isEmpty() )
		return;
	
	synchronized( notifs ){
		if( notifs.size() >= CAPACITY )
			return;
	}
	
	isBusy = true;
	final JHolla n = queue.poll();
	
	if( !n.hasBeenBuilt() )
		n.build();
	
	//n.setLocation(new Point(screenDimension.width - n.getPreferredSize().width - 10, screenDimension.height));
	if( alignment == Alignment.LEFT )
		n.setLocation(new Point(insetsLeft + 20, screenDimension.height));
	else
		n.setLocation(new Point(screenDimension.width - n.getPreferredSize().width - insetsRight - 20, screenDimension.height));
	n.setVisible(true);
	
	SwingUtilities.invokeLater(new Runnable(){
		public void run(){
			n.pack();
			n.revalidate();
			n.repaint();
			((BorderLayout) n.getContentPane().getLayout()).invalidateLayout(n.getContentPane());
			n.pack();
			
		}
	});
	
	Timeline t = new Timeline(n);
	t.setDuration(500);
	t.addPropertyToInterpolate("location", n.getLocation(), new Point(n.getLocation().x, screenDimension.height - n.getHeight() - 10));
	t.addCallback(new TimelineCallbackAdapter() {				
		@Override
		public void onTimelineStateChanged(TimelineState state1, TimelineState state2,
				float arg2, float arg3) {
			if( state2 == TimelineState.DONE ){
				n.setAsFullyVisible();
				notifs.add(n);
				executor.execute(n);//start timeout thread
				repaint();
				
				isBusy = false;
				
				SwingUtilities.invokeLater(new Runnable(){
					public void run(){
						nextCall();
					}
				});
			}
		}
	});
	t.play();
}
 
开发者ID:ominibyte,项目名称:jHolla,代码行数:59,代码来源:JHollaManager.java

示例10: removeNotification

import org.pushingpixels.trident.Timeline; //导入方法依赖的package包/类
public void removeNotification(final JHolla n){
	synchronized( queue ){
		if( queue.contains(n) ){
			queue.remove();
			return;
		}
	}
	
	synchronized( queue ){
		if( !notifs.contains(n) )
			return;
	}
	
	
	Timeline t = new Timeline(n);
	t.setDuration(500);
	//t.addPropertyToInterpolate("opacity", n.getOpacity(), 0.0f);
	t.addPropertyToInterpolate("location", n.getLocation(), new Point(n.getLocation().x, screenDimension.height));
	t.addCallback(new TimelineCallbackAdapter() {				
		@Override
		public void onTimelineStateChanged(TimelineState state1, TimelineState state2,
				float arg2, float arg3) {
			if( state2 == TimelineState.DONE ){
				JHolla.JHollaListener[] listeners = n.getListeners();
				
				n.setVisible(false);
				n.dispose();
				notifs.remove(n);
				
				for( int i = 0 ; i < listeners.length; i++ )
					listeners[i].removed();
				
				repaint();
				
				SwingUtilities.invokeLater(new Runnable(){
					public void run(){
						nextCall();
					}
				});
			}
		}
	});
	t.play();
}
 
开发者ID:ominibyte,项目名称:jHolla,代码行数:45,代码来源:JHollaManager.java


注:本文中的org.pushingpixels.trident.Timeline.addCallback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。