本文整理汇总了Java中org.eclipse.gef.requests.DirectEditRequest.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java DirectEditRequest.getLocation方法的具体用法?Java DirectEditRequest.getLocation怎么用?Java DirectEditRequest.getLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.DirectEditRequest
的用法示例。
在下文中一共展示了DirectEditRequest.getLocation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(final DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();
Column column = (Column) columnEditPart.getModel();
final TableView newTableView = (TableView) getHost().getParent().getModel();
final List<Column> columns = newTableView.getColumns();
if (column.getColumnHolder() instanceof ColumnGroup) {
column = (ColumnGroup) column.getColumnHolder();
}
int index = columns.indexOf(column);
final Rectangle columnRectangle = getColumnRectangle();
final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
if (editRequest.getLocation().y >= center) {
index++;
}
return index;
}
示例2: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
.getHost().getRoot()).getZoomManager();
double zoom = zoomManager.getZoom();
IFigure figure = ((TableViewEditPart) this.getHost()).getFigure();
int center = (int) (figure.getBounds().y + (figure.getBounds().height / 2)
* zoom);
int index = 0;
if (editRequest.getLocation().y >= center) {
TableView newTableView = (TableView) this.getHost().getModel();
index = newTableView.getColumns().size();
}
return index;
}
示例3: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();
ERColumn column = (ERColumn) columnEditPart.getModel();
final TableView newTableView = (TableView) getHost().getParent().getModel();
final List<ERColumn> columns = newTableView.getColumns();
if (column.getColumnHolder() instanceof ColumnGroup) {
column = (ColumnGroup) column.getColumnHolder();
}
int index = columns.indexOf(column);
final Rectangle columnRectangle = getColumnRectangle();
final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
if (editRequest.getLocation().y >= center) {
index++;
}
return index;
}
示例4: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
.getHost().getRoot()).getZoomManager();
double zoom = zoomManager.getZoom();
ColumnEditPart columnEditPart = (ColumnEditPart) this.getHost();
Column column = (Column) columnEditPart.getModel();
TableView newTableView = (TableView) this.getHost().getParent()
.getModel();
List<Column> columns = newTableView.getColumns();
if (column.getColumnHolder() instanceof ColumnGroup) {
column = (ColumnGroup) column.getColumnHolder();
}
int index = columns.indexOf(column);
Rectangle columnRectangle = this.getColumnRectangle();
int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
if (editRequest.getLocation().y >= center) {
index++;
}
return index;
}
示例5: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final IFigure figure = ((TableViewEditPart) getHost()).getFigure();
final int center = (int) (figure.getBounds().y + (figure.getBounds().height / 2) * zoom);
int index = 0;
if (editRequest.getLocation().y >= center) {
final TableView newTableView = (TableView) getHost().getModel();
index = newTableView.getColumns().size();
}
return index;
}
示例6: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
private int getColumnIndex(final DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final IFigure figure = ((TableViewEditPart) getHost()).getFigure();
final int center = (int) (figure.getBounds().y + (figure.getBounds().height / 2) * zoom);
int index = 0;
if (editRequest.getLocation().y >= center) {
final TableView newTableView = (TableView) getHost().getModel();
index = newTableView.getColumns().size();
}
return index;
}