use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class JavelinConnectorComposite method goToCurrentScreenClass.
/**
* Highlight the current screen class in tree view
*/
public void goToCurrentScreenClass() {
synchronized (connector) {
ScreenClass screenClass = ((JavelinConnector) connector).getCurrentScreenClass();
fireObjectSelected(new CompositeEvent(screenClass));
if (connector.isLearning()) {
if (bHandlerOpened) {
closeScreenClassHandler("redetect");
}
openScreenClassHandler(true);
getJavelin().requestFocus();
}
}
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class JavelinConnectorComposite method keyPressed.
public void keyPressed(java.awt.event.KeyEvent keyEvent) {
ScreenClass currentScreenClass = null;
JavelinConnector javelinConnector = (JavelinConnector) connector;
// Learning mode
if (javelinConnector.isLearning()) {
synchronized (javelinConnector) {
currentScreenClass = javelinConnector.getCurrentScreenClass();
}
synchronized (this) {
char c = keyEvent.getKeyChar();
// Avoiding handle null key char
if (c == 0x0)
return;
if (Character.isLetterOrDigit(c) || c == ' ') {
keysBuffer += c;
} else {
String doActionName = findActionName(javelinConnector.emulatorID, keyEvent);
if (doActionName != null) {
if (learnScreenClass == null) {
learnScreenClass = currentScreenClass;
} else if (!learnScreenClass.equals(currentScreenClass)) {
if (javelinConnector.isAccumulating()) {
closeScreenClassHandler();
openScreenClassHandler(false);
closeScreenClassHandler("accumulate");
} else {
closeScreenClassHandler("redetect");
}
// learnScreenClass =
// projectExplorerView.getLastDetectedScreenClass();
learnScreenClass = currentScreenClass;
openScreenClassHandler(true);
}
// videotex)
if (bDoAction && (javelinConnector.emulatorID == 1)) {
long rightNow = new java.util.Date().getTime();
writeLine("javelin.waitSync(" + (rightNow - doActionTime) + ");");
bDoAction = false;
}
// Flushing alphanumeric buffer
if (keysBuffer.length() != 0) {
writeLine("javelin.send(\"" + keysBuffer + "\");");
keysBuffer = "";
}
// Writing emulator action
writeLine("javelin.doAction(\"" + doActionName + "\");");
bDoAction = true;
doActionTime = new java.util.Date().getTime();
}
}
}
}
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class JavelinConnectorComposite method handleConnected.
public void handleConnected(twinxEvent0 arg0) {
toolBarSetEnable("Connect", false);
toolBarSetEnable("Disconnect", true);
JavelinConnector javelinConnector = (JavelinConnector) connector;
Javelin javelin = javelinConnector.javelin;
javelin.requestFocus();
// Learning mode
if (javelinConnector.isLearning()) {
JavelinTransaction learnTransaction = (JavelinTransaction) javelinConnector.getLearningTransaction();
synchronized (this) {
writeLine("javelin.connect(" + learnTransaction.getTimeoutForConnect() + ");");
}
}
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class JavelinAttributeEditor method setPropertyValueFromSelectionZone.
/**
* Sets the property according to the current selected zone.
* @param databaseObject
* @param connector
* @param setter
*/
public static void setPropertyValueFromSelectionZone(DatabaseObject databaseObject, Connector connector, Method propertySetter) {
if (connector == null) {
throw new IllegalArgumentException("The connector object is null");
}
JavelinConnector jTmp = null;
try {
jTmp = (JavelinConnector) connector;
} catch (ClassCastException e) {
throw new IllegalArgumentException("The connector object is not a iJavelin");
}
XMLRectangle zone = jTmp.getSelectionZone();
if (zone.width < 1)
return;
int att = jTmp.javelin.getCharAttribute(zone.x, zone.y);
try {
propertySetter.invoke(databaseObject, new Object[] { Integer.valueOf(att) });
} catch (Throwable e) {
String message = "Error : " + e.getMessage();
ConvertigoPlugin.logException(e, message);
}
}
use of com.twinsoft.convertigo.beans.connectors.JavelinConnector in project convertigo by convertigo.
the class JavelinAttributeEditor method getSelectionZoneValue.
/**
* Gets the value to put in the property according to the current selected zone.
* @param databaseObject
* @param connector
* @param setter
*/
public static Object getSelectionZoneValue(DatabaseObject databaseObject, Connector connector, Method propertySetter) {
if (connector == null) {
throw new IllegalArgumentException("The connector object is null");
}
JavelinConnector jTmp = null;
try {
jTmp = (JavelinConnector) connector;
} catch (ClassCastException e) {
throw new IllegalArgumentException("The connector object is not a iJavelin");
}
XMLRectangle zone = jTmp.getSelectionZone();
if (zone.width < 1)
return null;
int att = jTmp.javelin.getCharAttribute(zone.x, zone.y);
return Integer.valueOf(att);
}
Aggregations