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


Java Sine类代码示例

本文整理汇总了Java中org.pushingpixels.trident.ease.Sine的典型用法代码示例。如果您正苦于以下问题:Java Sine类的具体用法?Java Sine怎么用?Java Sine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AbstractRadial

import org.pushingpixels.trident.ease.Sine; //导入依赖的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);
  }
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:25,代码来源:AbstractRadial.java

示例2: AbstractLinear

import org.pushingpixels.trident.ease.Sine; //导入依赖的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);
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:20,代码来源:AbstractLinear.java

示例3: createTimeLine

import org.pushingpixels.trident.ease.Sine; //导入依赖的package包/类
private void createTimeLine() {
  LogoIcon icon = new LogoIcon();
  this.setIcon(icon);

  timeLine = new SwingRepaintTimeline(this);
  timeLine.addPropertyToInterpolate("alpha", 0, 45);
  timeLine.setDuration(800);
  timeLine.setEase(new Sine());
}
 
开发者ID:otros-systems,项目名称:otroslogviewer,代码行数:10,代码来源:JAnimatedLogo.java

示例4: updateStatus

import org.pushingpixels.trident.ease.Sine; //导入依赖的package包/类
@Override
public void updateStatus(String text, int level) {
  label.setText(text);
  if (level == LEVEL_NORMAL) {
    label.setBackground(colorNormal);
  } else {
    Color blinkColor = (level == LEVEL_WARNING) ? colorWarning : colorError;
    Timeline timeline = new Timeline(label);
    timeline.setDuration(200);
    timeline.setEase(new Sine());
    timeline.addPropertyToInterpolate("background", colorNormal, blinkColor);
    timeline.playLoop(8, RepeatBehavior.REVERSE);
  }
}
 
开发者ID:otros-systems,项目名称:otroslogviewer,代码行数:15,代码来源:JLabelStatusObserver.java

示例5: run

import org.pushingpixels.trident.ease.Sine; //导入依赖的package包/类
@Override
public void run() {
  while (true) {
    long heapMaxSize = Runtime.getRuntime().maxMemory();
    long heapSize = Runtime.getRuntime().totalMemory();
    long free = Runtime.getRuntime().freeMemory();
    final float percentUsed = 100 * ((heapSize - free) / (float) heapSize);
    long percentOfTotalUsed = 100 * (heapSize - free) / heapMaxSize;
    Color newColor = Color.GREEN;
    if (percentOfTotalUsed > 93) {
      newColor = Color.RED;
    } else if (percentOfTotalUsed > 83) {
      newColor = Color.ORANGE;
    } else if (percentOfTotalUsed > 75) {
      newColor = Color.YELLOW;
    }
    final String message = String.format("Used %sMB of %sMB", nf.format((percentUsed * heapSize / (100 * 1024 * 1024))), nf.format(heapSize / (1024 * 1024)));
    final String toolTip = message
      + String.format(". Total available for VM %sMB. Double click to invoke System.gc()", nf.format(heapMaxSize / (1024 * 1024)));
    Timeline timeline = new Timeline(bar);
    timeline.addPropertyToInterpolate("value", bar.getValue(), (int) percentUsed);
    timeline.addPropertyToInterpolate("foreground", bar.getForeground(), newColor);
    timeline.setEase(new Sine());
    timeline.setDuration(1200);
    timeline.play();
    SwingUtilities.invokeLater(() -> {
      bar.setString(message);
      bar.setToolTipText(toolTip);
    });

    try {
      Thread.sleep(refreshTime);
    } catch (InterruptedException ignore) {
    }
  }
}
 
开发者ID:otros-systems,项目名称:otroslogviewer,代码行数:37,代码来源:MemoryUsedStatsUpdater.java

示例6: createLocationTimeline

import org.pushingpixels.trident.ease.Sine; //导入依赖的package包/类
/**
 * Create an animation JComponent.
 * @param comp
 * @param to
 * @return
 */
public static Timeline createLocationTimeline(Component comp, Point to, int duration) {
	Timeline timeline = new Timeline(LoginDialog.getInstance());
	to.y = MainFrame.screenHeight;
	timeline.addPropertyToInterpolate("location", comp.getLocation(), to);
	timeline.setDuration(duration);
	timeline.setEase(new Sine());
	return timeline;
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:15,代码来源:MyWindowUtil.java


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