Make it possible to access the color of a color icon (for rdserver)

This commit is contained in:
Dmitry Jemerov
2018-06-25 18:53:04 +02:00
parent 5974b4f256
commit 8115a2e050
@@ -1,21 +1,6 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.xml.util;
import java.util.HashMap;
import com.intellij.util.containers.SoftFactoryMap;
import com.intellij.util.ui.EmptyIcon;
import org.jetbrains.annotations.NotNull;
@@ -23,6 +8,7 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
@@ -74,6 +60,14 @@ public class ColorIconCache {
return new ColorIcon(this);
}
public Color getColor() {
return myColor;
}
public Color[] getColours() {
return myColours;
}
@Override
public void paintIcon(final Component component, final Graphics g, final int i, final int j) {
final int iconWidth = getIconWidth();