149 lines
4.0 KiB
Java
149 lines
4.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.sys;
|
|
|
|
import java.io.DataInput;
|
|
import java.io.DataOutput;
|
|
import java.io.IOException;
|
|
import java.util.HashMap;
|
|
import javax.baja.naming.BOrd;
|
|
import javax.baja.naming.BOrdList;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BSimple;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public final class BIcon
|
|
extends BSimple {
|
|
public static final BIcon DEFAULT = new BIcon(BOrdList.NULL);
|
|
public static final Type TYPE;
|
|
private static HashMap cache;
|
|
private BOrdList ordList;
|
|
Object image;
|
|
static /* synthetic */ Class class$javax$baja$sys$BIcon;
|
|
|
|
public static final BIcon make(String string) {
|
|
return BIcon.make(BOrdList.make(string));
|
|
}
|
|
|
|
public static final BIcon make(BOrd bOrd) {
|
|
return BIcon.make(BOrdList.make(bOrd));
|
|
}
|
|
|
|
public static final BIcon make(BOrdList bOrdList) {
|
|
BIcon bIcon = (BIcon)cache.get(bOrdList.encodeToString());
|
|
if (bIcon == null) {
|
|
bIcon = new BIcon(bOrdList);
|
|
cache.put(bOrdList.encodeToString(), bIcon);
|
|
}
|
|
return bIcon;
|
|
}
|
|
|
|
public static final BIcon std(String string) {
|
|
return BIcon.make("module://icons/x16/" + string);
|
|
}
|
|
|
|
public static final BIcon make(BIcon bIcon, BIcon bIcon2) {
|
|
BOrdList bOrdList = bIcon.ordList;
|
|
BOrdList bOrdList2 = bIcon2.ordList;
|
|
int n = bOrdList.size();
|
|
int n2 = bOrdList2.size();
|
|
BOrd[] bOrdArray = new BOrd[n + n2];
|
|
int n3 = 0;
|
|
while (n3 < n) {
|
|
bOrdArray[n3] = bOrdList.get(n3);
|
|
++n3;
|
|
}
|
|
n3 = 0;
|
|
while (n3 < n2) {
|
|
bOrdArray[n3 + n] = bOrdList2.get(n3);
|
|
++n3;
|
|
}
|
|
return BIcon.make(BOrdList.make(bOrdArray));
|
|
}
|
|
|
|
public final BOrdList getOrdList() {
|
|
return this.ordList;
|
|
}
|
|
|
|
public final String toString(Context context) {
|
|
return this.ordList.toString(context);
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.ordList.hashCode();
|
|
}
|
|
|
|
public final boolean equals(Object object) {
|
|
if (object instanceof BIcon) {
|
|
return this.ordList.equals(((BIcon)object).ordList);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final void encode(DataOutput dataOutput) throws IOException {
|
|
dataOutput.writeUTF(this.ordList.encodeToString());
|
|
}
|
|
|
|
public final BObject decode(DataInput dataInput) throws IOException {
|
|
return BIcon.make(dataInput.readUTF());
|
|
}
|
|
|
|
public final String encodeToString() throws IOException {
|
|
return this.ordList.encodeToString();
|
|
}
|
|
|
|
public final BObject decodeFromString(String string) throws IOException {
|
|
return BIcon.make(string);
|
|
}
|
|
|
|
public final Object fw(int n, Object object, Object object2, Object object3, Object object4) {
|
|
switch (n) {
|
|
case 203: {
|
|
return this.image;
|
|
}
|
|
case 204: {
|
|
this.image = object;
|
|
return null;
|
|
}
|
|
}
|
|
return super.fw(n, object, object2, object3, object4);
|
|
}
|
|
|
|
public final Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private BIcon(BOrdList bOrdList) {
|
|
this.ordList = bOrdList;
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$sys$BIcon;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$sys$BIcon = BIcon.class("[Ljavax.baja.sys.BIcon;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
cache = new HashMap();
|
|
}
|
|
}
|
|
|