提交 db5e9226 编写于 作者: D denis

7021001: Default implementation of Toolkit.loadSystemColors(int[]) and many...

7021001: Default implementation of Toolkit.loadSystemColors(int[]) and many others doesn't throw HE in hl env
Reviewed-by: dcherepanov
上级 2cc670ea
......@@ -466,6 +466,10 @@ public abstract class Toolkit {
*/
protected void loadSystemColors(int[] systemColors)
throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
}
/**
......@@ -500,6 +504,10 @@ public abstract class Toolkit {
*/
public void setDynamicLayout(boolean dynamic)
throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
}
/**
......@@ -523,6 +531,9 @@ public abstract class Toolkit {
*/
protected boolean isDynamicLayoutSet()
throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().isDynamicLayoutSet();
} else {
......@@ -558,6 +569,9 @@ public abstract class Toolkit {
*/
public boolean isDynamicLayoutActive()
throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().isDynamicLayoutActive();
} else {
......@@ -601,6 +615,9 @@ public abstract class Toolkit {
*/
public Insets getScreenInsets(GraphicsConfiguration gc)
throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getScreenInsets(gc);
} else {
......@@ -1342,6 +1359,9 @@ public abstract class Toolkit {
* @since 1.4
*/
public Clipboard getSystemSelection() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getSystemSelection();
} else {
......@@ -1371,6 +1391,10 @@ public abstract class Toolkit {
* @since JDK1.1
*/
public int getMenuShortcutKeyMask() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
return Event.CTRL_MASK;
}
......@@ -1499,6 +1523,9 @@ public abstract class Toolkit {
*/
public Dimension getBestCursorSize(int preferredWidth,
int preferredHeight) throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
// Override to implement custom cursor support.
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().
......@@ -1526,6 +1553,9 @@ public abstract class Toolkit {
* @since 1.2
*/
public int getMaximumCursorColors() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
// Override to implement custom cursor support.
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getMaximumCursorColors();
......@@ -2572,6 +2602,9 @@ public abstract class Toolkit {
* @since 1.7
*/
public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册