Search in sources :

Example 31 with JavelinConnector

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();
        }
    }
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) ScreenClass(com.twinsoft.convertigo.beans.core.ScreenClass) CompositeEvent(com.twinsoft.convertigo.eclipse.editors.CompositeEvent)

Example 32 with JavelinConnector

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();
                }
            }
        }
    }
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) ScreenClass(com.twinsoft.convertigo.beans.core.ScreenClass)

Example 33 with JavelinConnector

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() + ");");
        }
    }
}
Also used : JavelinTransaction(com.twinsoft.convertigo.beans.transactions.JavelinTransaction) JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) Javelin(com.twinsoft.twinj.Javelin)

Example 34 with JavelinConnector

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);
    }
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle)

Example 35 with JavelinConnector

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);
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle)

Aggregations

JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)51 ScreenClass (com.twinsoft.convertigo.beans.core.ScreenClass)17 Javelin (com.twinsoft.twinj.Javelin)12 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)11 Connector (com.twinsoft.convertigo.beans.core.Connector)11 EngineException (com.twinsoft.convertigo.engine.EngineException)11 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)9 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)8 SiteClipperConnector (com.twinsoft.convertigo.beans.connectors.SiteClipperConnector)8 SqlConnector (com.twinsoft.convertigo.beans.connectors.SqlConnector)8 Transaction (com.twinsoft.convertigo.beans.core.Transaction)8 JavelinTransaction (com.twinsoft.convertigo.beans.transactions.JavelinTransaction)8 XMLRectangle (com.twinsoft.convertigo.beans.common.XMLRectangle)7 CicsConnector (com.twinsoft.convertigo.beans.connectors.CicsConnector)7 Project (com.twinsoft.convertigo.beans.core.Project)6 com.twinsoft.twinj.iJavelin (com.twinsoft.twinj.iJavelin)6 ScHandlerStatement (com.twinsoft.convertigo.beans.statements.ScHandlerStatement)5 HtmlTransaction (com.twinsoft.convertigo.beans.transactions.HtmlTransaction)5 AbstractConnectorComposite (com.twinsoft.convertigo.eclipse.editors.connector.AbstractConnectorComposite)5 ConnectorEditor (com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor)5