diff options
| author | 2014-08-04 00:26:48 -0400 | |
|---|---|---|
| committer | 2014-08-04 00:26:48 -0400 | |
| commit | 57f45b0409d5363782052183bb090175c469f89a (patch) | |
| tree | 672b32876b420445630e58e16b67d671e45c07b6 /src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java | |
| parent | fixed bugs with saving mappings (diff) | |
| download | enigma-fork-57f45b0409d5363782052183bb090175c469f89a.tar.gz enigma-fork-57f45b0409d5363782052183bb090175c469f89a.tar.xz enigma-fork-57f45b0409d5363782052183bb090175c469f89a.zip | |
added stable save order for mappings to hopefully help with merging
added color-coding for source identifiers
redesigned rename GUI
customized editor pane, added popup menu
finished name validation
added last-chance save on window close
Diffstat (limited to 'src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java')
| -rw-r--r-- | src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java b/src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java new file mode 100644 index 0000000..d46e1ae --- /dev/null +++ b/src/cuchaz/enigma/gui/ObfuscatedClassListCellRenderer.java | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2014 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Public License v3.0 | ||
| 5 | * which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/gpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.gui; | ||
| 12 | |||
| 13 | import java.awt.Component; | ||
| 14 | |||
| 15 | import javassist.bytecode.Descriptor; | ||
| 16 | |||
| 17 | import javax.swing.DefaultListCellRenderer; | ||
| 18 | import javax.swing.JLabel; | ||
| 19 | import javax.swing.JList; | ||
| 20 | import javax.swing.ListCellRenderer; | ||
| 21 | |||
| 22 | import cuchaz.enigma.ClassFile; | ||
| 23 | |||
| 24 | public class ObfuscatedClassListCellRenderer implements ListCellRenderer<ClassFile> | ||
| 25 | { | ||
| 26 | private DefaultListCellRenderer m_defaultRenderer; | ||
| 27 | |||
| 28 | public ObfuscatedClassListCellRenderer( ) | ||
| 29 | { | ||
| 30 | m_defaultRenderer = new DefaultListCellRenderer(); | ||
| 31 | } | ||
| 32 | |||
| 33 | @Override | ||
| 34 | public Component getListCellRendererComponent( JList<? extends ClassFile> list, ClassFile classFile, int index, boolean isSelected, boolean hasFocus ) | ||
| 35 | { | ||
| 36 | JLabel label = (JLabel)m_defaultRenderer.getListCellRendererComponent( list, classFile, index, isSelected, hasFocus ); | ||
| 37 | |||
| 38 | label.setText( Descriptor.toJavaName( classFile.getName() ) ); | ||
| 39 | |||
| 40 | return label; | ||
| 41 | } | ||
| 42 | } | ||