package org.JWrapper;
public abstract class UserFunction implements function0
{
String title = "";
String id = "";
private W_t wrp;
public UserFunction(String _title, W_t _wrp)
{
title=_title;
wrp=_wrp;
}
public UserFunction(String _id, String _title, W_t _wrp)
{
title=_title;
id = _id;
wrp=_wrp;
}
public String getTitle()
{ return title; }
public String getID()
{ return id; }
public void setID(String _id)
{ id=_id; }
public final Void Op() throws Exception
{
act();
return null;
}
public abstract void act() throws Exception;
public W_t getWrapper() {return wrp;}
//?
public static UserFunction createUF(String _id, String _title, function0 _f)
{
final function0 f = _f;
return new UserFunction(_id,_title,null)
{function0 F = f; public void act() throws Exception{ F.Op(); } };
}
boolean is_enabled = true;
public Boolean getIsEnabled()
{ return is_enabled; }
public void setIsEnabled(Boolean _is_enabled) throws Exception
{
is_enabled = _is_enabled.booleanValue();
enabled_signal.Op(_is_enabled);
}
Signal1 enabled_signal = new Signal1();
public Signal1 getEnabledSignal()
{ return enabled_signal; }
public void setEnabledSignal(Signal1 _enabled_signal)
{ enabled_signal = _enabled_signal; }
}
|