public class KahinaControlAgent extends KahinaObject implements KahinaListener
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected KahinaControlActuator |
actuator |
protected LogicProgrammingInstance<?,?,?,?> |
kahina |
protected java.lang.String |
name |
protected KahinaStepPropertySensor |
sensor |
protected java.awt.Color |
signalColor |
needsUpdate
Constructor and Description |
---|
KahinaControlAgent(LogicProgrammingInstance<?,?,?,?> kahina)
Class constructor for control points.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates this control point, causing the messaging system to announce its matches.
|
KahinaControlAgent |
copy() |
void |
deactivate()
Deactivates this control point, preventing the messaging system from announcing its matches.
|
void |
deregister() |
java.lang.String |
exportXML(boolean asFile)
Generates an XML representation of this control point, optionally featuring an XML header.
|
org.w3c.dom.Element |
exportXML(org.w3c.dom.Document dom) |
KahinaControlActuator |
getActuator() |
KahinaInstance<?,?,?,?> |
getKahina() |
java.lang.String |
getName()
Gets the name of the control point as used by various GUI components.
|
KahinaStepPropertySensor |
getSensor() |
java.awt.Color |
getSignalColor()
Gets the signal color used for highlighting matches of this control point.
|
KahinaTree |
getStepTree() |
static KahinaControlAgent |
importXML(org.w3c.dom.Element controlAgentNode,
LogicProgrammingInstance<?,?,?,?> instance)
Constructs a control point from an XML representation as produced by
exportXML . |
boolean |
isActive()
Checks whether this control point is active.
|
void |
processEvent(KahinaEvent event) |
void |
register() |
void |
setActuator(KahinaControlActuator actuator) |
void |
setName(java.lang.String name)
Sets the name of the control point that will be used by various GUI components.
|
void |
setSensor(KahinaStepPropertySensor sensor) |
void |
setSignalColor(java.awt.Color signalColor)
Sets the signal color used for highlighting matches of this control point.
|
java.lang.String |
toString()
Returns the breakpoint's name, prefixed by '#' if it is inactive.
|
needsUpdate, requireUpdate
protected LogicProgrammingInstance<?,?,?,?> kahina
protected java.lang.String name
protected boolean active
protected java.awt.Color signalColor
protected KahinaStepPropertySensor sensor
protected KahinaControlActuator actuator
public KahinaControlAgent(LogicProgrammingInstance<?,?,?,?> kahina)
The breakpoint starts out with the following default values:
name
- "Breakpoint " + a number
signalColor
- a random RGB color
active
- true (= activated)
pattern
- the empty pattern
a
- backpointer to the relevant KahinaControllerpublic void register()
public void deregister()
public KahinaControlAgent copy()
public KahinaInstance<?,?,?,?> getKahina()
public KahinaControlActuator getActuator()
public void setActuator(KahinaControlActuator actuator)
public KahinaStepPropertySensor getSensor()
public void setSensor(KahinaStepPropertySensor sensor)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- a user-readable name for this control pointpublic boolean isActive()
public void activate()
public void deactivate()
public java.awt.Color getSignalColor()
public void setSignalColor(java.awt.Color signalColor)
signalColor
- the signal color to be associated with this control pointpublic KahinaTree getStepTree()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String exportXML(boolean asFile)
asFile
- determines whether the result features an XML headerpublic org.w3c.dom.Element exportXML(org.w3c.dom.Document dom)
public static KahinaControlAgent importXML(org.w3c.dom.Element controlAgentNode, LogicProgrammingInstance<?,?,?,?> instance)
exportXML
.controlAgentNode
- an XML DOM element with name "controlPoint" as produced when parsing the result of exportXML
public void processEvent(KahinaEvent event)
processEvent
in interface KahinaListener