Search in sources :

Example 1 with XMLRectangle

use of com.twinsoft.convertigo.beans.common.XMLRectangle in project convertigo by convertigo.

the class ZoneEditorComposite method getValue.

public Object getValue() {
    int top, left, width, height;
    XMLRectangle zone = null;
    try {
        top = Integer.parseInt(textTop.getText());
        left = Integer.parseInt(textLeft.getText());
        width = Integer.parseInt(textWidth.getText());
        height = Integer.parseInt(textHeight.getText());
        zone = new XMLRectangle(left, top, width, height);
    } catch (Exception e) {
        ;
    }
    return zone;
}
Also used : XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle)

Example 2 with XMLRectangle

use of com.twinsoft.convertigo.beans.common.XMLRectangle in project convertigo by convertigo.

the class ZoneEditor 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) || (zone.height < 1))
        return null;
    return zone;
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle)

Example 3 with XMLRectangle

use of com.twinsoft.convertigo.beans.common.XMLRectangle in project convertigo by convertigo.

the class ZoneEditor 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) || (zone.height < 1))
        return;
    try {
        propertySetter.invoke(databaseObject, new Object[] { zone });
    } 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 4 with XMLRectangle

use of com.twinsoft.convertigo.beans.common.XMLRectangle in project convertigo by convertigo.

the class ColumnEditor method addPropertyElementFromSelectionZone.

/**
 * Add a column to the property according to the current selected zone.
 * @param databaseObject
 * @param connector
 * @param setter
 */
public static void addPropertyElementFromSelectionZone(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 JavelinConnector");
    }
    XMLRectangle zone = jTmp.getSelectionZone();
    if ((zone.width < 1) || (zone.height < 1))
        return;
    XMLVector<XMLVector<Object>> vTmp = null;
    if (Table.class.isAssignableFrom(databaseObject.getClass())) {
        vTmp = ((Table) databaseObject).getColumns();
    } else // not a table => no columns
    {
    }
    XMLVector<Object> v = new XMLVector<Object>();
    v.add(jTmp.javelin.getString(zone.x, zone.y, zone.width).trim());
    v.add(Integer.valueOf(zone.x));
    v.add(Integer.valueOf(zone.x + zone.width - 1));
    v.add(Integer.valueOf(0));
    vTmp.add(v);
    try {
        propertySetter.invoke(databaseObject, new Object[] { vTmp });
    } catch (Throwable e) {
        String message = "Error : " + e.getMessage();
        ConvertigoPlugin.logException(e, message);
    }
    jTmp.javelin.setSelectionZone(new XMLRectangle(zone.x, 0, zone.width, jTmp.javelin.getScreenHeight()));
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) XMLVector(com.twinsoft.convertigo.beans.common.XMLVector) XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject)

Example 5 with XMLRectangle

use of com.twinsoft.convertigo.beans.common.XMLRectangle in project convertigo by convertigo.

the class ZoneEditor method displayPropertyValueFromSelectionZone.

/**
 * Displays the value of the selected property if it is a screen zone.
 * @param databaseObject
 * @param connector
 * @param getter
 */
public static void displayPropertyValueFromSelectionZone(DatabaseObject databaseObject, Connector connector, Method propertyGetter) {
    if (connector == null) {
        throw new IllegalArgumentException("The connector object is null");
    }
    XMLRectangle zone = null;
    try {
        zone = (XMLRectangle) propertyGetter.invoke(databaseObject, (Object[]) null);
    } catch (Throwable e) {
        String message = "Error : " + e.getMessage();
        ConvertigoPlugin.logException(e, message);
    }
    JavelinConnector jTmp = null;
    try {
        jTmp = (JavelinConnector) connector;
    } catch (ClassCastException e) {
        throw new IllegalArgumentException("The connector object is not a iJavelin");
    }
    jTmp.javelin.setSelectionZone(zone);
}
Also used : JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) XMLRectangle(com.twinsoft.convertigo.beans.common.XMLRectangle) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject)

Aggregations

XMLRectangle (com.twinsoft.convertigo.beans.common.XMLRectangle)11 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)7 Block (com.twinsoft.convertigo.beans.core.Block)3 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)2 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)2 JavelinExtractionRuleResult (com.twinsoft.convertigo.beans.extractionrules.JavelinExtractionRuleResult)2 EngineEvent (com.twinsoft.convertigo.engine.EngineEvent)2 PanelBlockFactory (com.twinsoft.convertigo.beans.common.PanelBlockFactory)1 TabBox (com.twinsoft.convertigo.beans.common.TabBox)1 TagName (com.twinsoft.convertigo.beans.common.TagName)1 ExtractionRule (com.twinsoft.convertigo.beans.core.ExtractionRule)1 ScreenClass (com.twinsoft.convertigo.beans.core.ScreenClass)1 JavelinExtractionRule (com.twinsoft.convertigo.beans.extractionrules.JavelinExtractionRule)1 Nptui (com.twinsoft.convertigo.beans.sna.Nptui)1 AbstractConnectorComposite (com.twinsoft.convertigo.eclipse.editors.connector.AbstractConnectorComposite)1 ConnectorEditor (com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor)1 ConnectorEditorPart (com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditorPart)1 JavelinConnectorComposite (com.twinsoft.convertigo.eclipse.editors.connector.JavelinConnectorComposite)1 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)1 ScreenClassTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject)1