class PartWrapper {

        private static final NumberFormat FORMATTER = NumberFormat.getPercentInstance();
        private final Object part;
        private final float percentage;
        private final PaletteIcon icon;
        private final PaletteIcon disabledIcon;
        private boolean enabled = false;
        private boolean flattened = false;

        public PartWrapper(Object part, float percentage, Color color) {
            this.part = part;
            this.percentage = percentage;
            this.icon = new PaletteIcon(color);
            this.disabledIcon = new PaletteIcon();
            FORMATTER.setMaximumFractionDigits(2);
        }

        public PaletteIcon getIcon() {
            return icon;
        }

        public Object getPart() {
            return part;
        }

        @Override
        public String toString() {<FILL_FUNCTION_BODY>}

        public boolean isEnabled() {
            return enabled;
        }

        public boolean isFlattened() {
            return flattened;
        }

        public void setFlattened(boolean flattened) {
            this.flattened = flattened;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }

            String displayName = part == null ? "null" :
                part.getClass().isArray() ? AttributeUtils.printArray(part) : part.toString();
            if (flattened) {
                return displayName;
            }
            String percentageStr = FORMATTER.format(percentage / 100f);
            return displayName + " (" + percentageStr + ")";
        
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID