本文整理汇总了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()));
}
示例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()));
}
示例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));
}
示例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;
}
}
示例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);
}
示例6: getItem
import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit getItem(int index) {
return unitsList.get(index);
}
示例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);
}
示例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);
}
示例9: boxTargetValue
import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit boxTargetValue(double speedInMph) {
return FactorySpeed.mph(speedInMph);
}
示例10: fromBaseToTarget
import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit fromBaseToTarget(MeterPerSecond base) {
return base;
}
示例11: boxTargetValue
import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
@Override
public SpeedUnit boxTargetValue(double speedInMps) {
return FactorySpeed.mps(speedInMps);
}
示例12: boxBaseValueToTarget
import org.beyene.sius.unit.composition.speed.SpeedUnit; //导入依赖的package包/类
public SpeedUnit boxBaseValueToTarget(double valueInMps){
MeterPerSecond base = boxBaseValue(valueInMps);
return fromBaseToTarget(base);
}
示例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);
}
示例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);
}
示例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);
}