/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/DelegateColorScheme.java

https://bitbucket.org/nbargnesi/idea · Java · 182 lines · 130 code · 34 blank · 18 comment · 0 complexity · 248cb2f5760192879d6c85f279440c20 MD5 · raw file

  1. /*
  2. * Copyright 2000-2010 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.intellij.openapi.editor.colors.impl;
  17. import com.intellij.openapi.editor.colors.ColorKey;
  18. import com.intellij.openapi.editor.colors.EditorColorsScheme;
  19. import com.intellij.openapi.editor.colors.EditorFontType;
  20. import com.intellij.openapi.editor.colors.TextAttributesKey;
  21. import com.intellij.openapi.editor.markup.TextAttributes;
  22. import com.intellij.openapi.options.FontSize;
  23. import com.intellij.openapi.util.InvalidDataException;
  24. import com.intellij.openapi.util.WriteExternalException;
  25. import org.jdom.Element;
  26. import org.jetbrains.annotations.NotNull;
  27. import org.jetbrains.annotations.Nullable;
  28. import java.awt.*;
  29. /**
  30. * User: spLeaner
  31. */
  32. public abstract class DelegateColorScheme implements EditorColorsScheme {
  33. private EditorColorsScheme myDelegate;
  34. public DelegateColorScheme(@NotNull final EditorColorsScheme delegate) {
  35. myDelegate = delegate;
  36. }
  37. public EditorColorsScheme getDelegate() {
  38. return myDelegate;
  39. }
  40. @Override
  41. public void setName(String name) {
  42. myDelegate.setName(name);
  43. }
  44. @Override
  45. public TextAttributes getAttributes(TextAttributesKey key) {
  46. return myDelegate.getAttributes(key);
  47. }
  48. @Override
  49. public void setAttributes(TextAttributesKey key, TextAttributes attributes) {
  50. myDelegate.setAttributes(key, attributes);
  51. }
  52. @NotNull
  53. @Override
  54. public Color getDefaultBackground() {
  55. return myDelegate.getDefaultBackground();
  56. }
  57. @NotNull
  58. @Override
  59. public Color getDefaultForeground() {
  60. return myDelegate.getDefaultForeground();
  61. }
  62. @Override
  63. public Color getColor(ColorKey key) {
  64. return myDelegate.getColor(key);
  65. }
  66. @Override
  67. public void setColor(ColorKey key, @Nullable Color color) {
  68. myDelegate.setColor(key, color);
  69. }
  70. @Override
  71. public int getEditorFontSize() {
  72. return myDelegate.getEditorFontSize();
  73. }
  74. @Override
  75. public void setEditorFontSize(int fontSize) {
  76. myDelegate.setEditorFontSize(fontSize);
  77. }
  78. @Override
  79. public FontSize getQuickDocFontSize() {
  80. return myDelegate.getQuickDocFontSize();
  81. }
  82. @Override
  83. public void setQuickDocFontSize(@NotNull FontSize fontSize) {
  84. myDelegate.setQuickDocFontSize(fontSize);
  85. }
  86. @Override
  87. public String getEditorFontName() {
  88. return myDelegate.getEditorFontName();
  89. }
  90. @Override
  91. public void setEditorFontName(String fontName) {
  92. myDelegate.setEditorFontName(fontName);
  93. }
  94. @Override
  95. public Font getFont(EditorFontType key) {
  96. return myDelegate.getFont(key);
  97. }
  98. @Override
  99. public void setFont(EditorFontType key, Font font) {
  100. myDelegate.setFont(key, font);
  101. }
  102. @Override
  103. public float getLineSpacing() {
  104. return myDelegate.getLineSpacing();
  105. }
  106. @Override
  107. public void setLineSpacing(float lineSpacing) {
  108. myDelegate.setLineSpacing(lineSpacing);
  109. }
  110. @Override
  111. public void readExternal(Element element) throws InvalidDataException {
  112. }
  113. @Override
  114. public void writeExternal(Element element) throws WriteExternalException {
  115. }
  116. @Override
  117. public String getName() {
  118. return myDelegate.getName();
  119. }
  120. @Override
  121. public Object clone() {
  122. return myDelegate.clone();
  123. }
  124. @Override
  125. public String getConsoleFontName() {
  126. return myDelegate.getConsoleFontName();
  127. }
  128. @Override
  129. public void setConsoleFontName(String fontName) {
  130. myDelegate.setConsoleFontName(fontName);
  131. }
  132. @Override
  133. public int getConsoleFontSize() {
  134. return myDelegate.getConsoleFontSize();
  135. }
  136. @Override
  137. public void setConsoleFontSize(int fontSize) {
  138. myDelegate.setConsoleFontSize(fontSize);
  139. }
  140. @Override
  141. public float getConsoleLineSpacing() {
  142. return myDelegate.getConsoleLineSpacing();
  143. }
  144. @Override
  145. public void setConsoleLineSpacing(float lineSpacing) {
  146. myDelegate.setConsoleLineSpacing(lineSpacing);
  147. }
  148. }