2026-03-17 13:31:18 -07:00

216 lines
6.6 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package javax.baja.virtual;
import javax.baja.agent.AgentList;
import javax.baja.log.Log;
import javax.baja.naming.BOrd;
import javax.baja.naming.SlotPath;
import javax.baja.nav.BINavNode;
import javax.baja.space.BComponentSpace;
import javax.baja.spy.SpyWriter;
import javax.baja.sys.BComponent;
import javax.baja.sys.BIcon;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Slot;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
import javax.baja.virtual.BVirtualComponent;
import javax.baja.virtual.BVirtualComponentSpace;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BVirtualGateway
extends BComponent {
public static final Type TYPE;
private static final BIcon icon;
static final Log log;
BComponentSpace space;
static /* synthetic */ Class class$javax$baja$virtual$BVirtualGateway;
public Type getType() {
return TYPE;
}
public final BComponentSpace getVirtualSpace() {
return this.space;
}
protected BVirtualComponentSpace makeVirtualSpace() {
BVirtualComponentSpace bVirtualComponentSpace = new BVirtualComponentSpace("virtual", LexiconText.make("baja", "nav.virtual"), BOrd.make("virtual:"), this);
BVirtualComponent bVirtualComponent = this.makeVirtualRoot();
if (bVirtualComponent == null) {
throw new IllegalStateException("makeVirtualRoot() returned null. Must return a valid root component for the virtual space.");
}
bVirtualComponentSpace.setRootComponent(bVirtualComponent);
return bVirtualComponentSpace;
}
protected BVirtualComponent makeVirtualRoot() {
return new BVirtualComponent();
}
public Slot loadVirtualSlot(BVirtualComponent bVirtualComponent, String string) {
String string2;
String string3;
if (bVirtualComponent == null) {
return null;
}
Slot slot = null;
if (string != null && (slot = bVirtualComponent.getSlot(string3 = SlotPath.escape(string))) == null && (slot = this.addVirtualSlot(bVirtualComponent, string)) != null && !(string2 = slot.getName()).equals(string3)) {
log.warning("Name of virtual slot added is inconsistent: \"" + string2 + "\" was expected to be \"" + string3 + '\"');
}
return slot;
}
protected abstract Property addVirtualSlot(BVirtualComponent var1, String var2);
public abstract void loadVirtualSlots(BVirtualComponent var1);
public void ensureVirtualsLoaded(BOrd[] bOrdArray) {
}
public final BOrd getNavOrd() {
BOrd bOrd = super.getNavOrd();
if (bOrd != null) {
bOrd = BOrd.make(bOrd, "virtual:/");
}
return bOrd;
}
public boolean hasNavChildren() {
if (this.space != null) {
return this.space.hasNavChildren();
}
return super.hasNavChildren();
}
public BINavNode getNavChild(String string) {
if (this.space != null) {
return this.space.getNavChild(string);
}
return super.getNavChild(string);
}
public BINavNode resolveNavChild(String string) {
if (this.space != null) {
return this.space.resolveNavChild(string);
}
return super.resolveNavChild(string);
}
public BINavNode[] getNavChildren() {
if (this.space != null) {
return this.space.getNavChildren();
}
return super.getNavChildren();
}
public AgentList getAgents(Context context) {
AgentList agentList = super.getAgents(context);
agentList.remove("pxEditor:PxEditor");
agentList.remove("wiresheet:WireSheet");
agentList.remove("workbench:LinkSheet");
return agentList;
}
public BIcon getIcon() {
return icon;
}
public void spy(SpyWriter spyWriter) throws Exception {
spyWriter.startProps();
spyWriter.trTitle("VirtualSpace", 2);
spyWriter.prop((Object)"virtualSpaceType", this.space != null ? this.space.getType() : null);
spyWriter.endProps();
if (this.space != null) {
this.space.spy(spyWriter);
}
spyWriter.startProps();
spyWriter.trTitle("VirtualGateway", 2);
spyWriter.endProps();
super.spy(spyWriter);
}
public Object fw(int n, Object object, Object object2, Object object3, Object object4) {
switch (n) {
case 11: {
this.fwStarted();
break;
}
case 12: {
this.fwStopped();
break;
}
case 108: {
this.setSpace((BComponentSpace)object);
break;
}
}
return super.fw(n, object, object2, object3, object4);
}
void fwStarted() {
BVirtualComponentSpace bVirtualComponentSpace = this.makeVirtualSpace();
this.setSpace(bVirtualComponentSpace);
bVirtualComponentSpace.start();
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
void fwStopped() {
if (this.space == null) return;
try {
if (this.space instanceof BVirtualComponentSpace) {
((BVirtualComponentSpace)this.space).stop();
}
}
catch (Throwable throwable) {
Object var2_2 = null;
this.space = null;
throw throwable;
}
{
Object var2_3 = null;
this.space = null;
return;
}
}
void setSpace(BComponentSpace bComponentSpace) {
this.space = bComponentSpace;
}
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());
}
}
static {
Class clazz = class$javax$baja$virtual$BVirtualGateway;
if (clazz == null) {
clazz = class$javax$baja$virtual$BVirtualGateway = BVirtualGateway.class("[Ljavax.baja.virtual.BVirtualGateway;", false);
}
TYPE = Sys.loadType(clazz);
icon = BIcon.std("ghost.png");
log = Log.getLog("virtual.gateway");
}
}