1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-07-19 23:16:49 -04:00
parent 794b5a232f
commit 8e041d6e06
834 changed files with 4749 additions and 4461 deletions

View File

@@ -46,7 +46,7 @@ public class IptArg_ {
: parse_(raw);
}
catch (Exception exc) { // as an "or" proc, handle errors; note that it may accept raw values from cfg files, so invalid input is possible; DATE:2014-06-04
Exc_.Noop(exc);
Err_.Noop(exc);
return IptKey_.None;
}
}
@@ -66,7 +66,7 @@ public class IptArg_ {
else if (type == IptMouseBtn.class) return IptEventType_.MouseUp; // changed from MouseDown; confirmed against Firefox, Eclipse; DATE:2014-05-16
else if (type == IptMouseWheel.class) return IptEventType_.MouseWheel;
else if (type == IptMouseMove.class) return IptEventType_.MouseMove;
else throw Exc_.new_unhandled(type);
else throw Err_.new_unhandled(type);
}
@gplx.Internal protected static boolean EventType_match(IptArg arg, IptEventType match) {
Class<?> type = arg.getClass();
@@ -75,7 +75,7 @@ public class IptArg_ {
else if (type == IptMouseBtn.class) return match == IptEventType_.MouseDown || match == IptEventType_.MouseUp || match == IptEventType_.MousePress;
else if (type == IptMouseWheel.class) return match == IptEventType_.MouseWheel;
else if (type == IptMouseMove.class) return match == IptEventType_.MouseMove;
else throw Exc_.new_unhandled(type);
else throw Err_.new_unhandled(type);
}
}
class IptMacro {
@@ -113,6 +113,6 @@ class IptMacro {
return rv;
}
Ordered_hash regy;
static Exc parse_err(String raw, String loc) {return Exc_.new_w_type("gfui", "could not parse IptArg", "raw", raw, "loc", loc).Stack_erase_1_();}
static Err parse_err(String raw, String loc) {return Err_.new_("gfui", "could not parse IptArg", "raw", raw, "loc", loc).Trace_ignore_add_1_();}
public static final IptMacro _ = new IptMacro(); IptMacro() {}
}

View File

@@ -166,7 +166,7 @@ public class IptBndMgr implements SrlAble {
else if (v == IptEventType_.MouseMove.Val()) return 5;
else if (v == IptEventType_.MouseWheel.Val()) return 6;
else if (v == IptEventType_.MousePress.Val()) return 7;
else throw Exc_.new_unhandled(v);
else throw Err_.new_unhandled(v);
}
}
class IptBndHash implements SrlAble {

View File

@@ -31,7 +31,7 @@ public class IptBnd_upDownRange implements InjectAble, GfoInvkAble, GfoEvObj {
if (ctx.Match(k, Invk_TxtBox_dec)) ExecCmd(cmd, curVal - 1);
else if (ctx.Match(k, Invk_TxtBox_inc)) ExecCmd(cmd, curVal + 1);
else if (ctx.Match(k, Invk_TxtBox_exec)) {
Object valObj = IntClassXtn._.ParseOrNull(txtBox.Text()); if (valObj == null) throw Exc_.new_("invalid int", "text", txtBox.Text());
Object valObj = IntClassXtn._.ParseOrNull(txtBox.Text()); if (valObj == null) throw Err_.new_wo_type("invalid int", "text", txtBox.Text());
ExecCmd(doIt, Int_.cast_(valObj));
}
else if (ctx.Match(k, evt)) WhenEvt(ctx, m);

View File

@@ -36,7 +36,7 @@ public class IptEventData {
}
public static IptEventData as_(Object obj) {return obj instanceof IptEventData ? (IptEventData)obj : null;}
public static IptEventData cast_(Object obj) {try {return (IptEventData)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, IptEventData.class, obj);}}
public static IptEventData cast_(Object obj) {try {return (IptEventData)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, IptEventData.class, obj);}}
@gplx.Internal protected static IptEventData new_(GfuiElem sender, IptEventType eventType, IptArg eventArg, IptEvtDataKey keyData, IptEvtDataMouse mouseData) {return new_(sender, eventType, eventArg, keyData, IptEvtDataKeyHeld.Null, mouseData);}
@gplx.Internal protected static IptEventData new_(GfuiElem sender, IptEventType eventType, IptArg eventArg, IptEvtDataKey keyData, IptEvtDataKeyHeld keyPressData, IptEvtDataMouse mouseData) {
IptEventData rv = new IptEventData();

View File

@@ -21,7 +21,7 @@ public class IptEvtDataKey {
public boolean Handled() {return handled;} public void Handled_set(boolean v) {handled = v;} private boolean handled;
public static IptEvtDataKey as_(Object obj) {return obj instanceof IptEvtDataKey ? (IptEvtDataKey)obj : null;}
public static IptEvtDataKey cast_(Object obj) {try {return (IptEvtDataKey)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, IptEvtDataKey.class, obj);}}
public static IptEvtDataKey cast_(Object obj) {try {return (IptEvtDataKey)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, IptEvtDataKey.class, obj);}}
@gplx.Internal protected static final IptEvtDataKey Null = new_(IptKey_.None);
@gplx.Internal protected static IptEvtDataKey test_(IptKey keyArg) {return new_(keyArg);}
@gplx.Internal protected static IptEvtDataKey int_(int val) {

View File

@@ -21,7 +21,7 @@ public class IptEvtDataKeyHeld {
public boolean Handled() {return handled;} public void Handled_set(boolean v) {handled = v;} private boolean handled;
public static IptEvtDataKeyHeld as_(Object obj) {return obj instanceof IptEvtDataKeyHeld ? (IptEvtDataKeyHeld)obj : null;}
public static IptEvtDataKeyHeld cast_(Object obj) {try {return (IptEvtDataKeyHeld)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, IptEvtDataKeyHeld.class, obj);}}
public static IptEvtDataKeyHeld cast_(Object obj) {try {return (IptEvtDataKeyHeld)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, IptEvtDataKeyHeld.class, obj);}}
@gplx.Internal protected static final IptEvtDataKeyHeld Null = char_((char)0);
@gplx.Internal protected static IptEvtDataKeyHeld char_(char c) {
IptEvtDataKeyHeld rv = new IptEvtDataKeyHeld();

View File

@@ -22,7 +22,7 @@ public class IptEvtDataMouse {
public PointAdp Pos() {return location;} PointAdp location;
public static IptEvtDataMouse as_(Object obj) {return obj instanceof IptEvtDataMouse ? (IptEvtDataMouse)obj : null;}
public static IptEvtDataMouse cast_(Object obj) {try {return (IptEvtDataMouse)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, IptEvtDataMouse.class, obj);}}
public static IptEvtDataMouse cast_(Object obj) {try {return (IptEvtDataMouse)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, IptEvtDataMouse.class, obj);}}
@gplx.Internal protected static final IptEvtDataMouse Null = IptEvtDataMouse.new_(IptMouseBtn_.None, IptMouseWheel_.None, 0, 0);
public static IptEvtDataMouse new_(IptMouseBtn button, IptMouseWheel wheel, int x, int y) {
IptEvtDataMouse rv = new IptEvtDataMouse();

View File

@@ -23,7 +23,7 @@ public class IptKey_ {
public static IptKey[] Ary(IptKey... ary) {return ary;}
public static final IptKey[] Ary_empty = new IptKey[0];
public static IptKey as_(Object obj) {return obj instanceof IptKey ? (IptKey)obj : null;}
public static IptKey cast_(Object obj) {try {return (IptKey)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, IptKey.class, obj);}}
public static IptKey cast_(Object obj) {try {return (IptKey)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, IptKey.class, obj);}}
public static IptKey add_(IptKey... ary) {
if (ary.length == 0) return IptKey_.None;
int newVal = ary[0].Val();

View File

@@ -40,7 +40,7 @@ public class IptMouseBtn_ {
else if (String_.Eq(raw, Middle.Key())) return Middle;
else if (String_.Eq(raw, X1.Key())) return X1;
else if (String_.Eq(raw, X2.Key())) return X2;
else throw Exc_.new_parse_type(IptMouseBtn.class, raw);
else throw Err_.new_parse_type(IptMouseBtn.class, raw);
}
@gplx.Internal protected static IptMouseBtn api_(int val) {
if (val == None.Val()) return None;
@@ -49,6 +49,6 @@ public class IptMouseBtn_ {
else if (val == Middle.Val()) return Middle;
else if (val == X1.Val()) return X1;
else if (val == X2.Val()) return X2;
else throw Exc_.new_unhandled(val);
else throw Err_.new_unhandled(val);
}
}

View File

@@ -25,7 +25,7 @@ public class IptMouseWheel_ {
if (String_.Eq(raw, None.Key())) return None;
else if (String_.Eq(raw, Up.Key())) return Up;
else if (String_.Eq(raw, Down.Key())) return Down;
else throw Exc_.new_parse_type(IptMouseWheel.class, raw);
else throw Err_.new_parse_type(IptMouseWheel.class, raw);
}
@gplx.Internal protected static IptMouseWheel api_(Object obj) {
int delta = Int_.cast_(obj);