4 package com
.intellij
.openapi
.editor
.colors
.impl
;
6 import com
.intellij
.openapi
.editor
.colors
.ColorKey
;
7 import com
.intellij
.openapi
.editor
.colors
.EditorFontType
;
8 import com
.intellij
.openapi
.editor
.colors
.TextAttributesKey
;
9 import com
.intellij
.openapi
.editor
.colors
.ex
.DefaultColorSchemesManager
;
10 import com
.intellij
.openapi
.editor
.markup
.TextAttributes
;
11 import com
.intellij
.openapi
.util
.InvalidDataException
;
12 import org
.jdom
.Element
;
16 public class DefaultColorsScheme
extends AbstractColorsScheme
{
17 private String myName
;
19 public DefaultColorsScheme(DefaultColorSchemesManager defaultColorSchemesManager
) {
20 super(null, defaultColorSchemesManager
);
23 public TextAttributes
getAttributes(TextAttributesKey key
) {
24 if (key
== null) return null;
25 TextAttributes attrs
= myAttributesMap
.get(key
);
26 return attrs
!= null ? attrs
: key
.getDefaultAttributes();
29 public Color
getColor(ColorKey key
) {
30 if (key
== null) return null;
31 Color color
= myColorsMap
.get(key
);
32 return color
!= null ? color
: key
.getDefaultColor();
35 public void readExternal(Element parentNode
) throws InvalidDataException
{
36 super.readExternal(parentNode
);
37 myName
= parentNode
.getAttributeValue(NAME_ATTR
);
40 public String
getName() {
44 public void setAttributes(TextAttributesKey key
, TextAttributes attributes
) {
47 public void setColor(ColorKey key
, Color color
) {
50 public void setFont(EditorFontType key
, Font font
) {
53 public Object
clone() {
54 EditorColorsSchemeImpl newScheme
= new EditorColorsSchemeImpl(this, myDefaultColorSchemesManager
);
56 newScheme
.setName(DEFAULT_SCHEME_NAME
);