sys::Obj sys::Virtual sys::Component
public class Component
Component is the base class for all Sedona component classes.
public static const define int ADDED
public static const define int REMOVED
public static const define int REORDERED
public short children
First child id in linked list of children (do not modify directly)
public short id
Identifier in application (do not modify directly)
public Link linksFrom
Linked list of Links where this is the "from" component
public Link linksTo
Linked list of Links where this is the "to" component
public property int meta [config]
Metadata common to all components is packed into 32-bits:
00-03: nibble for security groups 16-23: byte logical x coordinate on wiresheet 23-31: byte logical y coordinate on wiresheet
public inline Str name
public static const define int nameLen
Human name for this component which is unique within its parent (do not modify directly)
public short nextSibling
Next sibling id for linked list of components under a given parent (do not modify directly)
public static const define int nullId
This value represents a null two byte id as 0xffff
public short parent
Parent id or nullId if root App or unmounted (do not modify directly)
public const Type type
Reference to the Type instance which describes this Component.
public inline byte[] watchFlags
Bitmask for each watch's subscriptions and events
public virtual bool allowChildExecute()
allowChildExecute returns false if child components of this should not have execute() called this app cycle.
public virtual void changed(Slot slot)
The changed method must be called when a slot is modified. It is automatically called whenever setting a property field with a primitive type (bool, byte, short, int, and float). However it must be manually called after updating the contents of a Buf property. If you override this method, you MUST call super!
public virtual int childEvent(int eType, Component child)
Called on parent when a child event occurs. Only called if app is running.
Defined event types are:
REMOVED - notification that child has been removed from component.
Should always return 0. Called after stop() on child.
ADDED - notification that child has been added to component.
Should always return 0. Called prior to loaded() / start() on child.
REORDERED - notification that component's children have been reordered.
Should always return 0. Called after the reordering is complete. Only called once per reorder event; child arg is always null.
Future event types may make use of return code.
public virtual void execute()
Execute is called once every scan using the simple round-robin scan engine.
public void fireLinksChanged()
Fire the links changed event on this component by marking the link event bit for each watch's bitmask.
public void fireTreeChanged()
Fire a tree changed event on this component by marking the tree event bit for each watch's bitmask.
public native bool getBool(Slot slot)
Get a bool property using reflection.
public native Buf getBuf(Slot slot)
Get a Buf property using reflection.
public native double getDouble(Slot slot)
Get a double property using reflection.
public native float getFloat(Slot slot)
Get a float property using reflection.
public native int getInt(Slot slot)
Get an integer (byte, short, or int) property using reflection.
public native long getLong(Slot slot)
Get a long property using reflection.
public void invokeAction(InStream in, Slot slot)
Decode a value from the input stream and invoke for the specified action.
public native void invokeBool(Slot slot, bool arg)
Invoke an action which takes a boolean argument.
public native void invokeBuf(Slot slot, Buf arg)
Invoke an action which takes a Buf argument.
public native void invokeDouble(Slot slot, double arg)
Invoke an action which takes a double argument.
public native void invokeFloat(Slot slot, float arg)
Invoke an action which takes a float argument.
public native void invokeInt(Slot slot, int arg)
Invoke an action which takes an int argument.
public native void invokeLong(Slot slot, long arg)
Invoke an action which takes a long argument.
public native void invokeVoid(Slot slot)
Invoke an action which takes no arguments.
public virtual int linkEvent(int eType, Link link)
Called on a component when a link event occurs. Only called if app is running.
Defined event types are:
REMOVED - link has been removed from the component.
Should always return 0
ADDED - link has been added to the component.
Should always return 0.
Future event types may make use of return code.
public int loadAppComp(InStream in)
Load the component's configuration from a binary format input stream - see saveAppComp() for format. We assume component id and type id have already been read. Return 0 on success or non-zero on error.
public void loadProp(InStream in, Slot slot)
Decode a value from the input stream and set for the specified property.
public void loadProps(InStream in, int filter)
Load the property values to the output stream. Filter:
0 = all 'c' = config only 'r' = runtime only
public virtual void loaded()
Callback when component is loaded into an app. This occurs before the start phase. Only called if app is running.
public Component lookupByName(Str name)
Lookup a child by name or return null.
public virtual int parentEvent(int eType, Component parent)
Called on a child when a parent event occurs. Only called if app is running.
Defined event types are:
REMOVED - notification that child has been removed/unparented.
Should always return 0. Called after stop() on child.
ADDED - notification this child has been parented.
Should always return 0. Called prior to loaded() / start() on child.
Future event types may make use of return code.
public Component[] path()
Get the path of this component from the root App. The end of the path is denoted by null. The list is a shared static buffer. Return null on error or if not mounted under an Sys.app.
public void saveAppComp(OutStream out)
Save the component's application information in binary format to the output stream:
appComp { u2 id u1 kitId u1 typeId str name u2 parent u2 children u2 nextSibling val[] configProps u1 ';' end marker }
public void saveProp(OutStream out, Slot prop)
Save a property value to the output stream.
public void saveProps(OutStream out, int filter)
Save the property values to the output stream. Filter:
0 = all 'c' = config only 'r' = runtime only
public void setBool(Slot slot, bool val)
Set a bool property using reflection.
public void setDouble(Slot slot, double val)
Set a double property using reflection.
public void setFloat(Slot slot, float val)
Set a float property using reflection.
public void setInt(Slot slot, int val)
Set an integer (byte, short, or int) property using reflection.
public void setLong(Slot slot, long val)
Set a long property using reflection.
public virtual void setToDefault(Slot slot)
Set property to a default value. Called when a link is removed from an input slot.
public virtual void start()
Callback when component is first started in an app. This occurs only after all components have had their loaded callback invoked. Only called if app is running
public virtual void stop()
Callback when component is first stopped in an app. Only called if app is running.