Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b62e601e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
b62e601e
编写于
4月 10, 2008
作者:
P
prr
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
d1f2d3d4
e7d97dea
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
93 addition
and
55 deletion
+93
-55
src/share/classes/sun/print/ServiceDialog.java
src/share/classes/sun/print/ServiceDialog.java
+42
-35
src/solaris/classes/sun/print/AttributeClass.java
src/solaris/classes/sun/print/AttributeClass.java
+1
-0
src/solaris/classes/sun/print/IPPPrintService.java
src/solaris/classes/sun/print/IPPPrintService.java
+50
-20
未找到文件。
src/share/classes/sun/print/ServiceDialog.java
浏览文件 @
b62e601e
...
...
@@ -2149,48 +2149,55 @@ public class ServiceDialog extends JDialog implements ActionListener {
}
}
}
}
rbPortrait
.
setEnabled
(
pSupported
);
rbLandscape
.
setEnabled
(
lSupported
);
rbRevPortrait
.
setEnabled
(
rpSupported
);
rbRevLandscape
.
setEnabled
(
rlSupported
);
OrientationRequested
or
=
(
OrientationRequested
)
asCurrent
.
get
(
orCategory
);
if
(
or
==
null
||
!
psCurrent
.
isAttributeValueSupported
(
or
,
docFlavor
,
asCurrent
))
{
or
=
(
OrientationRequested
)
psCurrent
.
getDefaultAttributeValue
(
orCategory
);
// need to validate if default is not supported
if
(!
psCurrent
.
isAttributeValueSupported
(
or
,
docFlavor
,
asCurrent
))
{
or
=
null
;
Object
values
=
psCurrent
.
getSupportedAttributeValues
(
orCategory
,
docFlavor
,
asCurrent
);
if
(
values
instanceof
OrientationRequested
[])
{
OrientationRequested
[]
orValues
=
rbPortrait
.
setEnabled
(
pSupported
);
rbLandscape
.
setEnabled
(
lSupported
);
rbRevPortrait
.
setEnabled
(
rpSupported
);
rbRevLandscape
.
setEnabled
(
rlSupported
);
OrientationRequested
or
=
(
OrientationRequested
)
asCurrent
.
get
(
orCategory
);
if
(
or
==
null
||
!
psCurrent
.
isAttributeValueSupported
(
or
,
docFlavor
,
asCurrent
))
{
or
=
(
OrientationRequested
)
psCurrent
.
getDefaultAttributeValue
(
orCategory
);
// need to validate if default is not supported
if
(!
psCurrent
.
isAttributeValueSupported
(
or
,
docFlavor
,
asCurrent
))
{
or
=
null
;
values
=
psCurrent
.
getSupportedAttributeValues
(
orCategory
,
docFlavor
,
asCurrent
);
if
(
values
instanceof
OrientationRequested
[])
{
OrientationRequested
[]
orValues
=
(
OrientationRequested
[])
values
;
if
(
orValues
.
length
>
1
)
{
// get the first in the list
or
=
orValues
[
0
];
if
(
orValues
.
length
>
1
)
{
// get the first in the list
or
=
orValues
[
0
];
}
}
}
if
(
or
==
null
)
{
or
=
OrientationRequested
.
PORTRAIT
;
}
asCurrent
.
add
(
or
);
}
if
(
or
==
null
)
{
or
=
OrientationRequested
.
PORTRAIT
;
if
(
or
==
OrientationRequested
.
PORTRAIT
)
{
rbPortrait
.
setSelected
(
true
);
}
else
if
(
or
==
OrientationRequested
.
LANDSCAPE
)
{
rbLandscape
.
setSelected
(
true
);
}
else
if
(
or
==
OrientationRequested
.
REVERSE_PORTRAIT
)
{
rbRevPortrait
.
setSelected
(
true
);
}
else
{
// if (or == OrientationRequested.REVERSE_LANDSCAPE)
rbRevLandscape
.
setSelected
(
true
);
}
asCurrent
.
add
(
or
);
}
}
else
{
rbPortrait
.
setEnabled
(
pSupported
);
rbLandscape
.
setEnabled
(
lSupported
);
rbRevPortrait
.
setEnabled
(
rpSupported
);
rbRevLandscape
.
setEnabled
(
rlSupported
);
if
(
or
==
OrientationRequested
.
PORTRAIT
)
{
rbPortrait
.
setSelected
(
true
);
}
else
if
(
or
==
OrientationRequested
.
LANDSCAPE
)
{
rbLandscape
.
setSelected
(
true
);
}
else
if
(
or
==
OrientationRequested
.
REVERSE_PORTRAIT
)
{
rbRevPortrait
.
setSelected
(
true
);
}
else
{
// if (or == OrientationRequested.REVERSE_LANDSCAPE)
rbRevLandscape
.
setSelected
(
true
);
}
}
}
...
...
src/solaris/classes/sun/print/AttributeClass.java
浏览文件 @
b62e601e
...
...
@@ -32,6 +32,7 @@ public class AttributeClass {
private
int
nameLen
;
private
Object
myValue
;
public
static
final
int
TAG_UNSUPPORTED_VALUE
=
0x10
;
public
static
final
int
TAG_INT
=
0x21
;
public
static
final
int
TAG_BOOL
=
0x22
;
public
static
final
int
TAG_ENUM
=
0x23
;
...
...
src/solaris/classes/sun/print/IPPPrintService.java
浏览文件 @
b62e601e
...
...
@@ -621,17 +621,8 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
}
}
}
else
if
(
category
==
OrientationRequested
.
class
)
{
if
(
flavor
==
null
||
flavor
.
equals
(
DocFlavor
.
SERVICE_FORMATTED
.
PAGEABLE
)
||
flavor
.
equals
(
DocFlavor
.
SERVICE_FORMATTED
.
PRINTABLE
))
{
// Orientation is emulated in Pageable/Printable flavors
// so we report the 3 orientations as supported.
OrientationRequested
[]
orientSup
=
new
OrientationRequested
[
3
];
orientSup
[
0
]
=
OrientationRequested
.
PORTRAIT
;
orientSup
[
1
]
=
OrientationRequested
.
LANDSCAPE
;
orientSup
[
2
]
=
OrientationRequested
.
REVERSE_LANDSCAPE
;
return
orientSup
;
}
boolean
revPort
=
false
;
OrientationRequested
[]
orientSup
=
null
;
AttributeClass
attribClass
=
(
getAttMap
!=
null
)
?
(
AttributeClass
)
getAttMap
.
get
(
"orientation-requested-supported"
)
...
...
@@ -639,7 +630,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
if
(
attribClass
!=
null
)
{
int
[]
orientArray
=
attribClass
.
getArrayOfIntValues
();
if
((
orientArray
!=
null
)
&&
(
orientArray
.
length
>
0
))
{
OrientationRequested
[]
orientSup
=
orientSup
=
new
OrientationRequested
[
orientArray
.
length
];
for
(
int
i
=
0
;
i
<
orientArray
.
length
;
i
++)
{
switch
(
orientArray
[
i
])
{
...
...
@@ -657,12 +648,33 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
case
6
:
orientSup
[
i
]
=
OrientationRequested
.
REVERSE_PORTRAIT
;
revPort
=
true
;
break
;
}
}
return
orientSup
;
}
}
if
(
flavor
==
null
||
flavor
.
equals
(
DocFlavor
.
SERVICE_FORMATTED
.
PAGEABLE
)
||
flavor
.
equals
(
DocFlavor
.
SERVICE_FORMATTED
.
PRINTABLE
))
{
if
(
revPort
&&
flavor
==
null
)
{
OrientationRequested
[]
orSup
=
new
OrientationRequested
[
4
];
orSup
[
0
]
=
OrientationRequested
.
PORTRAIT
;
orSup
[
1
]
=
OrientationRequested
.
LANDSCAPE
;
orSup
[
2
]
=
OrientationRequested
.
REVERSE_LANDSCAPE
;
orSup
[
3
]
=
OrientationRequested
.
REVERSE_PORTRAIT
;
return
orSup
;
}
else
{
OrientationRequested
[]
orSup
=
new
OrientationRequested
[
3
];
orSup
[
0
]
=
OrientationRequested
.
PORTRAIT
;
orSup
[
1
]
=
OrientationRequested
.
LANDSCAPE
;
orSup
[
2
]
=
OrientationRequested
.
REVERSE_LANDSCAPE
;
return
orSup
;
}
}
else
{
return
orientSup
;
}
}
else
if
(
category
==
PageRanges
.
class
)
{
if
(
flavor
==
null
||
flavor
.
equals
(
DocFlavor
.
SERVICE_FORMATTED
.
PAGEABLE
)
||
...
...
@@ -991,6 +1003,14 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
getSupportedAttributeCategories
();
}
// It is safe to assume that Orientation is always supported
// and even if CUPS or an IPP device reports it as not,
// our renderer can do portrait, landscape and
// reverse landscape.
if
(
category
==
OrientationRequested
.
class
)
{
return
true
;
}
for
(
int
i
=
0
;
i
<
supportedCats
.
length
;
i
++)
{
if
(
category
==
supportedCats
[
i
])
{
return
true
;
...
...
@@ -1602,7 +1622,13 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
public
static
boolean
writeIPPRequest
(
OutputStream
os
,
String
operCode
,
AttributeClass
[]
attCl
)
{
OutputStreamWriter
osw
=
new
OutputStreamWriter
(
os
);
OutputStreamWriter
osw
;
try
{
osw
=
new
OutputStreamWriter
(
os
,
"UTF-8"
);
}
catch
(
java
.
io
.
UnsupportedEncodingException
exc
)
{
debug_println
(
"UTF-8 not supported? Exception: "
+
exc
);
return
false
;
}
char
[]
opCode
=
new
char
[
2
];
opCode
[
0
]
=
(
char
)
Byte
.
parseByte
(
operCode
.
substring
(
0
,
2
),
16
);
opCode
[
1
]
=
(
char
)
Byte
.
parseByte
(
operCode
.
substring
(
2
,
4
),
16
);
...
...
@@ -1690,7 +1716,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
// read value tag
response
[
0
]
=
ois
.
readByte
();
while
(
response
[
0
]
>=
AttributeClass
.
TAG_
INT
&&
while
(
response
[
0
]
>=
AttributeClass
.
TAG_
UNSUPPORTED_VALUE
&&
response
[
0
]
<=
AttributeClass
.
TAG_MEMBER_ATTRNAME
)
{
// read name length
len
=
ois
.
readShort
();
...
...
@@ -1710,12 +1736,16 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
respList
.
add
(
responseMap
);
responseMap
=
new
HashMap
();
}
AttributeClass
ac
=
new
AttributeClass
(
attribStr
,
valTagByte
,
outArray
);
responseMap
.
put
(
ac
.
getName
(),
ac
);
// exclude those that are unknown
if
(
valTagByte
>=
AttributeClass
.
TAG_INT
)
{
AttributeClass
ac
=
new
AttributeClass
(
attribStr
,
valTagByte
,
outArray
);
responseMap
.
put
(
ac
.
getName
(),
ac
);
}
outObj
=
new
ByteArrayOutputStream
();
counter
=
0
;
//reset counter
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录