mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Revert "Debugger: Image/Icon viewer based on standard image viewer"
This reverts commit 0852a82d9f.
This commit is contained in:
@@ -25,9 +25,13 @@ import com.intellij.debugger.ui.tree.ValueDescriptor;
|
||||
import com.intellij.debugger.ui.tree.render.CompoundReferenceRenderer;
|
||||
import com.intellij.debugger.ui.tree.render.DescriptorLabelListener;
|
||||
import com.intellij.rt.debugger.ImageSerializer;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.xdebugger.frame.XFullValueEvaluator;
|
||||
import com.sun.jdi.*;
|
||||
import org.intellij.images.editor.impl.ImageEditorManagerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -67,15 +71,24 @@ class ImageObjectRenderer extends CompoundReferenceRenderer implements FullValue
|
||||
}
|
||||
|
||||
static JComponent createIconViewer(Icon icon) {
|
||||
final int w = icon.getIconWidth();
|
||||
final int h = icon.getIconHeight();
|
||||
final BufferedImage image = GraphicsEnvironment.getLocalGraphicsEnvironment()
|
||||
.getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(w, h, Transparency.TRANSLUCENT);
|
||||
final Graphics2D g = image.createGraphics();
|
||||
icon.paintIcon(null, g, 0, 0);
|
||||
g.dispose();
|
||||
return new JBScrollPane(new JBLabel(icon){
|
||||
private BufferedImage myBackgroundImage = UIUtil.createImage(16, 16, BufferedImage.TYPE_INT_ARGB);
|
||||
{
|
||||
Graphics2D g = myBackgroundImage.createGraphics();
|
||||
g.setColor(new JBColor(Gray._255, Gray._135));
|
||||
g.fillRect(0, 0, 17, 17);
|
||||
g.setColor(new JBColor(Gray._191, Gray._83));
|
||||
g.fillRect(0, 0, 8, 8);
|
||||
g.fillRect(8, 8, 8, 8);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
((Graphics2D)g).setPaint(new TexturePaint(myBackgroundImage, new Rectangle(0, 0, 16, 16)));
|
||||
g.fillRect(0, 0, getWidth()+1, getHeight() + 1);
|
||||
super.paint(g);
|
||||
}
|
||||
});
|
||||
|
||||
return ImageEditorManagerImpl.createImageEditorUI(image);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user