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;
}
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;
}
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);
}
}
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()));
}
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);
}
Aggregations