Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
04564c9a
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
04564c9a
编写于
4月 17, 2009
作者:
A
amenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4672194: FloatControl should provide consistent policy for the floats
Reviewed-by: alexp
上级
c5779d6b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
39 addition
and
4 deletion
+39
-4
src/share/classes/javax/sound/sampled/FloatControl.java
src/share/classes/javax/sound/sampled/FloatControl.java
+39
-4
未找到文件。
src/share/classes/javax/sound/sampled/FloatControl.java
浏览文件 @
04564c9a
...
@@ -131,6 +131,10 @@ public abstract class FloatControl extends Control {
...
@@ -131,6 +131,10 @@ public abstract class FloatControl extends Control {
* @param minLabel the label for the minimum value, such as "Left" or "Off"
* @param minLabel the label for the minimum value, such as "Left" or "Off"
* @param midLabel the label for the midpoint value, such as "Center" or "Default"
* @param midLabel the label for the midpoint value, such as "Center" or "Default"
* @param maxLabel the label for the maximum value, such as "Right" or "Full"
* @param maxLabel the label for the maximum value, such as "Right" or "Full"
*
* @throws IllegalArgumentException if {@code minimum} is greater
* than {@code maximum} or {@code initialValue} does not fall
* within the allowable range
*/
*/
protected
FloatControl
(
Type
type
,
float
minimum
,
float
maximum
,
protected
FloatControl
(
Type
type
,
float
minimum
,
float
maximum
,
float
precision
,
int
updatePeriod
,
float
initialValue
,
float
precision
,
int
updatePeriod
,
float
initialValue
,
...
@@ -138,6 +142,20 @@ public abstract class FloatControl extends Control {
...
@@ -138,6 +142,20 @@ public abstract class FloatControl extends Control {
super
(
type
);
super
(
type
);
if
(
minimum
>
maximum
)
{
throw
new
IllegalArgumentException
(
"Minimum value "
+
minimum
+
" exceeds maximum value "
+
maximum
+
"."
);
}
if
(
initialValue
<
minimum
)
{
throw
new
IllegalArgumentException
(
"Initial value "
+
initialValue
+
" smaller than allowable minimum value "
+
minimum
+
"."
);
}
if
(
initialValue
>
maximum
)
{
throw
new
IllegalArgumentException
(
"Initial value "
+
initialValue
+
" exceeds allowable maximum value "
+
maximum
+
"."
);
}
this
.
minimum
=
minimum
;
this
.
minimum
=
minimum
;
this
.
maximum
=
maximum
;
this
.
maximum
=
maximum
;
...
@@ -167,10 +185,15 @@ public abstract class FloatControl extends Control {
...
@@ -167,10 +185,15 @@ public abstract class FloatControl extends Control {
* @param initialValue the value that the control starts with when constructed
* @param initialValue the value that the control starts with when constructed
* @param units the label for the units in which the control's values are expressed,
* @param units the label for the units in which the control's values are expressed,
* such as "dB" or "frames per second"
* such as "dB" or "frames per second"
*
* @throws IllegalArgumentException if {@code minimum} is greater
* than {@code maximum} or {@code initialValue} does not fall
* within the allowable range
*/
*/
protected
FloatControl
(
Type
type
,
float
minimum
,
float
maximum
,
protected
FloatControl
(
Type
type
,
float
minimum
,
float
maximum
,
float
precision
,
int
updatePeriod
,
float
initialValue
,
String
units
)
{
float
precision
,
int
updatePeriod
,
float
initialValue
,
String
units
)
{
this
(
type
,
minimum
,
maximum
,
precision
,
updatePeriod
,
initialValue
,
units
,
""
,
""
,
""
);
this
(
type
,
minimum
,
maximum
,
precision
,
updatePeriod
,
initialValue
,
units
,
""
,
""
,
""
);
}
}
...
@@ -306,9 +329,21 @@ public abstract class FloatControl extends Control {
...
@@ -306,9 +329,21 @@ public abstract class FloatControl extends Control {
* @param to final value after the shift
* @param to final value after the shift
* @param microseconds maximum duration of the shift in microseconds
* @param microseconds maximum duration of the shift in microseconds
*
*
* @throws IllegalArgumentException if either {@code from} or {@code to}
* value does not fall within the allowable range
*
* @see #getUpdatePeriod
* @see #getUpdatePeriod
*/
*/
public
void
shift
(
float
from
,
float
to
,
int
microseconds
)
{
public
void
shift
(
float
from
,
float
to
,
int
microseconds
)
{
// test "from" value, "to" value will be tested by setValue()
if
(
from
<
minimum
)
{
throw
new
IllegalArgumentException
(
"Requested value "
+
from
+
" smaller than allowable minimum value "
+
minimum
+
"."
);
}
if
(
from
>
maximum
)
{
throw
new
IllegalArgumentException
(
"Requested value "
+
from
+
" exceeds allowable maximum value "
+
maximum
+
"."
);
}
setValue
(
to
);
setValue
(
to
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录