use of org.talend.designer.dbmap.ui.visualmap.TableEntryProperties in project tdi-studio-se by Talend.
the class UIManager method getTableEntryPosition.
/**
* DOC amaumont Comment method "getTableEntryPosition".
*
* @param manager TODO
* @param tableEntry
* @param forceRecalculate TODO
* @return
*/
public Point getTableEntryPosition(ITableEntry tableEntry, boolean forceRecalculate) {
TableEntryProperties tableEntryProperties = mapperManager.getTableEntryProperties(tableEntry);
Point returnedPoint = tableEntryProperties.position;
if (forceRecalculate || returnedPoint == null) {
TableItem tableItem = mapperManager.retrieveTableItem(tableEntry);
DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(tableEntry);
Rectangle tableViewBounds = dataMapTableView.getBounds();
Table table = tableItem.getParent();
// FIX for issue 1225 ("1" parameter added)
Rectangle boundsTableItem = tableItem.getBounds(1);
int x = 0;
int y = boundsTableItem.y + table.getItemHeight() / 2 + dataMapTableView.getBorderWidth();
if (y < 0) {
y = 0;
}
Point point = new Point(x, y);
Display display = dataMapTableView.getDisplay();
Point pointFromTableViewOrigin = display.map(tableItem.getParent(), dataMapTableView, point);
if (pointFromTableViewOrigin.y > tableViewBounds.height - TableEntriesManager.HEIGHT_REACTION) {
pointFromTableViewOrigin.y = tableViewBounds.height - TableEntriesManager.HEIGHT_REACTION;
}
returnedPoint = convertPointToReferenceOrigin(getReferenceComposite(), pointFromTableViewOrigin, dataMapTableView);
tableEntryProperties.position = returnedPoint;
}
return returnedPoint;
}
use of org.talend.designer.dbmap.ui.visualmap.TableEntryProperties in project tdi-studio-se by Talend.
the class TableEntriesManager method getTableEntryProperties.
/**
* DOC amaumont Comment method "getTableEntryProperties".
*
* @param dataMapTableEntry
* @return
*/
TableEntryProperties getTableEntryProperties(ITableEntry dataMapTableEntry) {
TableEntryProperties tableEntryProperties = dataMapTableEntryToProperties.get(dataMapTableEntry);
if (tableEntryProperties == null) {
tableEntryProperties = new TableEntryProperties();
dataMapTableEntryToProperties.put(dataMapTableEntry, tableEntryProperties);
}
return tableEntryProperties;
}
Aggregations