本文整理汇总了Java中org.pushingpixels.trident.Timeline类的典型用法代码示例。如果您正苦于以下问题:Java Timeline类的具体用法?Java Timeline怎么用?Java Timeline使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Timeline类属于org.pushingpixels.trident包,在下文中一共展示了Timeline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MercuryLoading
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
public MercuryLoading() {
this.setValue(0);
this.setMaximum(3000);
this.setForeground(AppThemeColor.TEXT_NICKNAME);
this.setBackground(AppThemeColor.ADR_FOOTER_BG);
this.setUI(new MercuryLoadingUi(this));
this.progressTl = new Timeline(this);
this.progressTl.setDuration(2400);
this.progressTl.addPropertyToInterpolate("value", this.getMaximum(), 0);
this.progressTl.setEase(new Spline(1));
this.progressTl.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
swapColors();
}
});
}
示例2: onViewInit
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
@Override
public void onViewInit() {
this.setLayout(new GridLayout(1, 1));
this.setPreferredSize(this.descriptor.getSize());
this.captureLabel = new JLabel();
this.setBackground(AppThemeColor.ADR_CAPTURE_BG);
this.setBorder(BorderFactory.createLineBorder(AppThemeColor.BORDER, 1));
this.progressTl = new Timeline(this);
this.progressTl.addPropertyToInterpolate("captureCount", 0, this.descriptor.getFps());
this.captureLabel.setIcon(new ImageIcon(Scalr.resize(getCapture(), descriptor.getSize().width, descriptor.getSize().height)));
this.progressTl.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
captureLabel.setIcon(new ImageIcon(Scalr.resize(getCapture(), descriptor.getSize().width, descriptor.getSize().height)));
}
});
this.progressTl.setDuration(1000 / this.descriptor.getFps());
this.add(this.captureLabel);
MercuryStoreUI.adrRepaintSubject.onNext(true);
}
示例3: onViewInit
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
@Override
public void onViewInit() {
this.setLayout(new GridLayout(1, 1));
this.setPreferredSize(this.descriptor.getSize());
this.tracker = new MercuryTracker(this.descriptor);
this.add(this.tracker);
this.tracker.addTimelineCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
if (newState.equals(Timeline.TimelineState.IDLE) && !inSettings) {
if (!descriptor.isAlwaysVisible()) {
setVisible(false);
} else {
tracker.setStringPainted(!descriptor.isAlwaysVisible());
tracker.setMaskPainted(!descriptor.isAlwaysVisible());
}
MercuryStoreUI.adrRepaintSubject.onNext(true);
} else if (newState.equals(Timeline.TimelineState.PLAYING_FORWARD)) {
setVisible(true);
JFrame parent = (JFrame) SwingUtilities.getWindowAncestor(AdrDurationCellPanel.this);
parent.pack();
}
}
});
MercuryStoreUI.adrRepaintSubject.onNext(true);
}
示例4: AbstractRadial
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
public AbstractRadial() {
super();
lcdTimeline = new Timeline(this);
lcdValue = 0;
lcdUnitString = getUnitString();
ledPosition = new Point2D.Double(0.6, 0.4);
userLedPosition = new Point2D.Double(0.3, 0.4);
INNER_BOUNDS = new Rectangle(200, 200);
GAUGE_BOUNDS = new Rectangle(200, 200);
FRAMELESS_BOUNDS = new Rectangle(200, 200);
FRAMELESS_OFFSET = new Point2D.Double(0, 0);
transparentSectionsEnabled = false;
transparentAreasEnabled = false;
expandedSectionsEnabled = false;
tickmarkDirection = Direction.CLOCKWISE;
timeline = new Timeline(this);
STANDARD_EASING = new Spline(0.5f);
RETURN_TO_ZERO_EASING = new Sine();
horizontalAlignment = SwingConstants.CENTER;
verticalAlignment = SwingConstants.CENTER;
lcdTextVisible = true;
LCD_BLINKING_TIMER = new Timer(500, this);
addComponentListener(this);
}
示例5: AbstractLinear
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
public AbstractLinear() {
super();
INNER_BOUNDS = new Rectangle(120, 300);
startingFromZero = false;
transparentSectionsEnabled = false;
transparentAreasEnabled = false;
ledPosition = new Point2D.Double((getInnerBounds().width - 18.0 - 16.0) / getInnerBounds().width, 0.453271028);
userLedPosition = new Point2D.Double(18.0 / getInnerBounds().width, 0.453271028);
lcdValue = 0;
lcdTimeline = new Timeline(this);
lcdUnitString = getUnitString();
lcdInfoString = "";
timeline = new Timeline(this);
STANDARD_EASING = new Spline(0.5f);
RETURN_TO_ZERO_EASING = new Sine();
lcdTextVisible = true;
LCD_BLINKING_TIMER = new Timer(500, this);
addComponentListener(this);
}
示例6: 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();
}
示例7: 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();
}
示例8: showPopup
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
private void showPopup() {
if (MagicAnimations.isOn(AnimationFx.CARD_FADEIN)) {
if (opacity == 0f) {
fadeInTimeline = new Timeline();
fadeInTimeline.setDuration(200);
fadeInTimeline.setEase(new Spline(0.8f));
fadeInTimeline.addPropertyToInterpolate(
Timeline.property("opacity")
.on(this)
.from(0.0f)
.to(1.0f));
fadeInTimeline.play();
} else {
opacity = 1.0f;
}
} else {
opacity = 1.0f;
}
setVisible(true);
}
示例9: setVisible
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
@Override
public void setVisible(boolean aFlag) {
super.setVisible(aFlag);
if (ImageHelper.isWindowTranslucencySupported()) {
if (aFlag == false) {
setOpacity(0f);
} else {
fadeInTimeline = new Timeline();
fadeInTimeline.setDuration(200);
fadeInTimeline.setEase(new Spline(0.8f));
fadeInTimeline.addPropertyToInterpolate(
Timeline.property("opacity")
.on(this)
.from(0.0f)
.to(1.0f));
fadeInTimeline.play();
}
}
}
示例10: componentRemoved
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
@Override
public void componentRemoved(ContainerEvent e) {
// fix for defect 135 - memory leaks on tabbed panes
final Component tabComponent = e.getChild();
if (tabComponent == null)
return;
// System.err.println(this.hashCode() + " removing for " +
// tabComponent.hashCode());
if (tabComponent instanceof UIResource)
return;
for (PropertyChangeListener pcl : this.listeners.get(tabComponent))
tabComponent.removePropertyChangeListener(pcl);
this.listeners.get(tabComponent).clear();
this.listeners.remove(tabComponent);
// has running timeline?
Timeline timeline = modifiedTimelines.get(tabComponent);
if (timeline != null) {
timeline.cancel();
modifiedTimelines.remove(tabComponent);
}
// this.cleanListeners(tabComponent);
}
示例11: onUpdate
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
@Override
protected void onUpdate() {
this.setVisible(this.descriptor.isVisible());
this.progressTl.abort();
this.progressTl.setDuration(1000 / this.descriptor.getFps());
this.progressTl.playLoop(Timeline.RepeatBehavior.LOOP);
}
示例12: initAnimationTimers
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
private void initAnimationTimers() {
this.showAnimation = new Timeline(this);
this.showAnimation.setDuration(SHOW_TIME);
this.showAnimation.addPropertyToInterpolate("opacity", this.minOpacity, this.maxOpacity);
this.hideAnimation = new Timeline(this);
this.hideAnimation.setDuration(HIDE_TIME);
this.hideAnimation.addPropertyToInterpolate("opacity", this.maxOpacity, this.minOpacity);
}
示例13: initCollapseAnimations
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
private void initCollapseAnimations(String state) {
collapseAnimation = new Timeline(this);
switch (state) {
case "expand": {
collapseAnimation.addPropertyToInterpolate("width", this.getWidth(), MAX_WIDTH);
break;
}
case "collapse": {
collapseAnimation.addPropertyToInterpolate("width", this.getWidth(), MIN_WIDTH);
}
}
collapseAnimation.setEase(new Spline(1f));
collapseAnimation.setDuration(150);
}
示例14: AirCompass
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
public AirCompass() {
super();
rotateTickmarks = true;
value = 0;
rotationAngle = 0;
CENTER = new Point2D.Double();
timeline = new Timeline(this);
init(getInnerBounds().width, getInnerBounds().height);
setLcdVisible(true);
}
示例15: DisplayMulti
import org.pushingpixels.trident.Timeline; //导入依赖的package包/类
public DisplayMulti() {
super();
lcdValue = 0.0;
oldValue = 0.0;
lcdThreshold = 0.0;
lcdThresholdVisible = false;
lcdThresholdBehaviourInverted = false;
lcdBackgroundVisible = true;
lcdTextVisible = true;
lcdBlinking = false;
LCD_BLINKING_TIMER = new Timer(500, this);
lcdDecimals = 1;
lcdUnitString = "unit";
lcdUnitStringVisible = true;
lcdScientificFormat = false;
digitalFont = false;
useCustomLcdUnitFont = false;
customLcdUnitFont = new Font("Verdana", 0, 24);
LCD_STANDARD_FONT = new Font("Verdana", 0, 30);
LCD_DIGITAL_FONT = Util.INSTANCE.getDigitalFont().deriveFont(24).deriveFont(Font.PLAIN);
lcdInfoFont = new Font("Verdana", 0, 24);
lcdInfoString = "";
numberSystem = NumberSystem.DEC;
DISABLED_COLOR = new Color(102, 102, 102, 178);
timeline = new Timeline(this);
EASING = new Linear();
glowVisible = false;
glowColor = new Color(51, 255, 255);
glowing = false;
init(128, 64);
addComponentListener(COMPONENT_LISTENER);
}