public Location setOther(Location element) { element.setOtherScreen(this); return element; }
@Override public Location setOther(Location element) { return element.setOtherScreen(this); }
@Override public Location setOther(Location element) { return element.setOtherScreen(this); }
/** * creates a point at the given offset below, might be negative <br>might create a point outside * of any screen, not checked * * @param dy y offset * @return new location */ public Location below(int dy) { return new Location(x, y + dy).setOtherScreen(this); }
public Location newLocation(int x, int y) { Location loc = new Location(x, y); loc.setOtherScreen(this); return loc; }
private Location checkAndSetRemote(Location loc) { if (!isOtherScreen()) { return loc; } return loc.setOtherScreen(scr); }
@Override protected <PSIMRL> Location getLocationFromTarget(PSIMRL target) throws FindFailed { Location location = super.getLocationFromTarget(target); if (location != null) { location.setOtherScreen(this); } return location; }
/** * creates a point at the given offset to the left, might be negative <br>might create a point * outside of any screen, not checked * * @param dx x offset * @return new location */ public Location left(int dx) { return new Location(x - dx, y).setOtherScreen(this); }
@Override public Location newLocation(int x, int y) { return new Location(x, y).setOtherScreen(this); } }
@Override public Location newLocation(Location loc) { return new Location(loc).setOtherScreen(this); } }
/** * creates a point at the given offset to the right, might be negative <br>might create a point * outside of any screen, not checked * * @param dx x offset * @return new location */ public Location right(int dx) { return new Location(x + dx, y).setOtherScreen(this); }
/** * creates a point at the given offset above, might be negative <br>might create a point outside * of any screen, not checked * * @param dy y offset * @return new location */ public Location above(int dy) { return new Location(x, y - dy).setOtherScreen(this); }
@Override public Location newLocation(int _x, int _y) { return new Location(_x, _y).setOtherScreen(this); }
/** * INTERNAL USE * identifies the point as being on a non-desktop-screen * if this is true for the given location * @return this */ private Location setOtherScreen(Location loc) { if (loc.isOtherScreen()) { setOtherScreen(loc.getScreen()); } return this; }
protected <PSIMRL> Location getLocationFromTarget(PSIMRL target) throws FindFailed { if (target instanceof Pattern || target instanceof String || target instanceof Image) { Match m = find(target); if (m != null) { if (isOtherScreen()) { return m.getTarget().setOtherScreen(scr); } else { return m.getTarget(); } } return null; } if (target instanceof Match) { return ((Match) target).getTarget(); } if (target instanceof Region) { return ((Region) target).getCenter(); } if (target instanceof Location) { return new Location((Location) target); } return null; } //</editor-fold>