private boolean isInAdd( Point screen ) { if ( size_add == null || screen == null ) { return false; } return size_add.contains( screen ); }
private boolean isInRightValue( Point screen ) { if ( size_rightval == null ) { return false; } return Real2Screen( size_rightval ).contains( screen ); }
private boolean isInNot( Point screen ) { if ( size_not == null ) { return false; } return Real2Screen( size_not ).contains( screen ); }
private boolean isInUp( Point screen ) { if ( size_up == null || parents.isEmpty() ) { return false; // not displayed! } return Real2Screen( size_up ).contains( screen ); }
private int getNrSubcondition( Point screen ) { if ( size_cond == null ) { return -1; } for ( int i = 0; i < size_cond.length; i++ ) { if ( size_cond[i] != null && Screen2Real( size_cond[i] ).contains( screen ) ) { return i; } } return -1; }
private boolean isInFunction( Point screen ) { if ( size_fn == null ) { return false; } return Real2Screen( size_fn ).contains( screen ); }
private boolean isInLeft( Point screen ) { if ( size_left == null ) { return false; } return Real2Screen( size_left ).contains( screen ); }
private boolean isInWidget( Point screen ) { if ( size_widget == null ) { return false; } return Real2Screen( size_widget ).contains( screen ); }
private boolean isInRightExact( Point screen ) { if ( size_rightex == null ) { return false; } return Real2Screen( size_rightex ).contains( screen ); }
private int getNrOperator( Point screen ) { if ( size_oper == null ) { return -1; } for ( int i = 0; i < size_oper.length; i++ ) { if ( size_oper[i] != null && Screen2Real( size_oper[i] ).contains( screen ) ) { return i; } } return -1; }
/** * This method is needed in the case where the display has multiple monitors, but they do not form a uniform * rectangle. In this case, it is possible for Geometry.moveInside() to not detect that the window is partially or * completely clipped. We check to make sure at least the upper left portion of the rectangle is visible to give the * user the ability to reposition the dialog in this rare case. * * @param constrainee * @param display * @return */ private boolean isClippedByUnalignedMonitors( Rectangle constrainee, Display display ) { boolean isClipped; Monitor[] monitors = display.getMonitors(); if ( monitors.length > 0 ) { // Loop searches for a monitor proving false isClipped = true; for ( Monitor monitor : monitors ) { if ( monitor.getClientArea().contains( constrainee.x + 10, constrainee.y + 10 ) ) { isClipped = false; break; } } } else { isClipped = false; } return isClipped; }
protected TreeItem searchMouseOverTreeItem( TreeItem[] treeItems, int x, int y ) { for ( TreeItem treeItem : treeItems ) { if ( treeItem.getBounds().contains( x, y ) ) { return treeItem; } if ( treeItem.getItemCount() > 0 ) { treeItem = searchMouseOverTreeItem( treeItem.getItems(), x, y ); if ( treeItem != null ) { return treeItem; } } } return null; }
@Override public void handleEvent(Event event) { Rectangle clientArea = table.getClientArea(); Point pt = new Point(event.x, event.y); int index = table.getTopIndex(); int count = table.getItemCount(); while (index < count) { boolean visible = false; TableItem item = table.getItem(index); for (int i = 0; i < table.getColumnCount(); i++) { Rectangle rect = item.getBounds(i); if (rect.contains(pt)) { beforeEdit(); clickRow(item, i); return; } if (!visible && rect.intersects(clientArea)) { visible = true; } } if (!visible) return; index++; } } protected void beforeEdit() {
for ( int i = 0; i < table.getColumnCount(); i++ ) { Rectangle rect = item.getBounds( i ); if ( rect.contains( pt ) ) { activeTableItem = item; activeTableColumn = i;
@Override public void getChildAtPoint(AccessibleControlEvent e) { Point pt = toControl(new Point(e.x, e.y)); e.childID = (getBounds().contains(pt)) ? ACC.CHILDID_SELF : ACC.CHILDID_NONE; }
protected boolean allowMouseEvent( T control, int x, int y ) { Point size = control.getSize(); int borderWidth = control.getBorderWidth(); Rectangle outerBounds = new Rectangle( - borderWidth, - borderWidth, size.x, size.y ); Rectangle innerBounds = new Rectangle( 0, 0, size.x - 2 * borderWidth, size.y - 2 * borderWidth ); return !outerBounds.contains( x, y ) || innerBounds.contains( x, y ); }
@Override public void mouseDoubleClick(MouseEvent e) { Control content= getContent(); if (content != null && content.getBounds().contains(e.x, e.y)) return; Control parent= getParent(); if (parent instanceof Splitter) ((Splitter)parent).setMaximizedControl(CompareViewerPane.this); } };
@Override public void mouseMove(MouseEvent event) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) { if (!fSubjectArea.contains(event.x, event.y)) deactivate(); } else { if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, false)) deactivate(); } }
@Override public void mouseMove(MouseEvent event) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) { if (!fSubjectArea.contains(event.x, event.y)) deactivate(); } else { if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, false)) deactivate(); } }
@Override public void mouseMove(MouseEvent event) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) { if (!fSubjectArea.contains(event.x, event.y)) { hideInformationControl(); } } else if (getCurrentInformationControl() != null && !getCurrentInformationControl().isFocusControl()) { if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, true)) { hideInformationControl(); } } }