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


Java SpeedUnit类代码示例

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


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

示例1: onApiConnected

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public void onApiConnected() {
    super.onApiConnected();

    final View view = getView();
    typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.CHANGE_SPEED));

    final SpeedUnitProvider speedUnitProvider = getSpeedUnitProvider();
    final SpeedWheelAdapter adapter = new SpeedWheelAdapter(getContext(), R.layout.wheel_text_centered,
            speedUnitProvider.boxBaseValueToTarget(0), speedUnitProvider.boxBaseValueToTarget(20));
    CardWheelHorizontalView<SpeedUnit> cardAltitudePicker = (CardWheelHorizontalView<SpeedUnit>) view.findViewById
            (R.id.picker1);
    cardAltitudePicker.setViewAdapter(adapter);
    cardAltitudePicker.addScrollListener(this);

    ChangeSpeed item = (ChangeSpeed) getMissionItems().get(0);
    cardAltitudePicker.setCurrentValue(speedUnitProvider.boxBaseValueToTarget(item.getSpeed()));
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:19,代码来源:MissionChangeSpeedFragment.java

示例2: onApiConnected

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public void onApiConnected() {
    super.onApiConnected();

    final View view = getView();
    typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.CHANGE_SPEED));

    final SpeedUnitProvider speedUnitProvider = getSpeedUnitProvider();
    final SpeedWheelAdapter adapter = new SpeedWheelAdapter(getContext(), R.layout.wheel_text_centered,
            speedUnitProvider.boxBaseValueToTarget(1), speedUnitProvider.boxBaseValueToTarget(20));
    CardWheelHorizontalView<SpeedUnit> cardAltitudePicker = (CardWheelHorizontalView<SpeedUnit>) view.findViewById
            (R.id.picker1);
    cardAltitudePicker.setViewAdapter(adapter);
    cardAltitudePicker.addScrollListener(this);

    ChangeSpeed item = (ChangeSpeed) getMissionItems().get(0);
    cardAltitudePicker.setCurrentValue(speedUnitProvider.boxBaseValueToTarget(item.getSpeed()));
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:19,代码来源:MissionChangeSpeedFragment.java

示例3: parseItemText

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit parseItemText(CharSequence itemText) {
    String text = itemText.toString();
    if(TextUtils.isEmpty(text))
        return (SpeedUnit) unitsList.get(0).valueOf(0);

    return (SpeedUnit) unitsList.get(0).valueOf(Double.parseDouble(text));
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:9,代码来源:SpeedWheelAdapter.java

示例4: onScrollingEnded

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public void onScrollingEnded(CardWheelHorizontalView wheel, SpeedUnit startValue, SpeedUnit endValue) {
    switch (wheel.getId()) {
        case R.id.picker1:
            double baseValue = endValue.toBase().getValue();
            for (MissionItem missionItem : getMissionItems()) {
                ChangeSpeed item = (ChangeSpeed) missionItem;
                item.setSpeed(baseValue);
            }
            getMissionProxy().notifyMissionUpdate();
            break;
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:14,代码来源:MissionChangeSpeedFragment.java

示例5: SpeedWheelAdapter

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
public SpeedWheelAdapter(Context context, int itemResource, SpeedUnit startSpeed, SpeedUnit endSpeed){
    super(context, itemResource);
    generateUnits(startSpeed, endSpeed);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:SpeedWheelAdapter.java

示例6: getItem

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit getItem(int index) {
    return unitsList.get(index);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:SpeedWheelAdapter.java

示例7: getItemIndex

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public int getItemIndex(SpeedUnit item) {
    final double roundedValue = roundToClosestUnit(item.getValue());
    final SpeedUnit floorItem = (SpeedUnit) item.valueOf(roundedValue);
    return unitsList.indexOf(floorItem);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:7,代码来源:SpeedWheelAdapter.java

示例8: fromBaseToTarget

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit fromBaseToTarget(MeterPerSecond base) {
    return Operation.convert(base, UnitIdentifier.MILES_PER_HOUR);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:ImperialSpeedUnitProvider.java

示例9: boxTargetValue

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit boxTargetValue(double speedInMph) {
    return FactorySpeed.mph(speedInMph);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:ImperialSpeedUnitProvider.java

示例10: fromBaseToTarget

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit fromBaseToTarget(MeterPerSecond base) {
    return base;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:MetricSpeedUnitProvider.java

示例11: boxTargetValue

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit boxTargetValue(double speedInMps) {
    return FactorySpeed.mps(speedInMps);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:MetricSpeedUnitProvider.java

示例12: boxBaseValueToTarget

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
public SpeedUnit boxBaseValueToTarget(double valueInMps){
    MeterPerSecond base = boxBaseValue(valueInMps);
    return fromBaseToTarget(base);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:SpeedUnitProvider.java

示例13: fromTargetToBase

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
public MeterPerSecond fromTargetToBase(SpeedUnit target){
    if(target instanceof MeterPerSecond)
        return (MeterPerSecond) target;

    return Operation.convert(target, UnitIdentifier.METER_PER_SECOND);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:7,代码来源:SpeedUnitProvider.java

示例14: fromBaseToTarget

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit fromBaseToTarget(MeterPerSecond base) {
    return Operation.convert(base, UnitIdentifier.FOOT_PER_SECOND);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:5,代码来源:ImperialSpeedUnitProvider.java

示例15: getItemIndex

import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public int getItemIndex(SpeedUnit item) {
    SpeedUnit floorItem = (SpeedUnit) item.valueOf(Math.round(item.getValue()));
    return unitsList.indexOf(floorItem);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:6,代码来源:SpeedWheelAdapter.java


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