org.malai.picking
Interface Picker
- All Known Subinterfaces:
- ICanvas
- All Known Implementing Classes:
- Border, LCanvas, LCodePanel, MLayeredPane, MMenu, MMenuBar, MPanel, MPopupMenu, MScrollPane, MToolBar, WidgetMiniToolbar
public interface Picker
Defines an interface for objects that contains pickable and picker objects.
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN
Malai is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
05/10/2010
- Since:
- 0.1
- Version:
- 0.1
- Author:
- Arnaud BLOUIN
getPickableAt
Pickable getPickableAt(double x,
double y)
- Parameters:
x
- The x-coordinate of the position used to get the pickable object.y
- The y-coordinate of the position used to get the pickable object.
- Returns:
- The pickable object at the given position.
- Since:
- 0.1
getPickerAt
Picker getPickerAt(double x,
double y)
- Parameters:
x
- The x-coordinate of the position used to get the picker object.y
- The y-coordinate of the position used to get the picker object.
- Returns:
- The pickable object at the given position.
- Since:
- 0.1
getRelativePoint
java.awt.geom.Point2D getRelativePoint(double x,
double y,
java.lang.Object o)
- Parameters:
x
- The x-coordinate of the position to convert.y
- The y-coordinate of the position to convert.o
- An object contained by the calling picker. This function will computed the real position of the given
point in o
.
- Returns:
- Converts the given point in to fit the coordinates of the given object contained by the picker.
For instance, given an object
o1
that contains an other object o2
at position (10, 10)
. o1.getRelativePoint(30, 30, o2)
will return (20, 20)
. - Since:
- 0.1
contains
boolean contains(java.lang.Object obj)
- Tests if the given object is contained by the calling picker.
- Parameters:
obj
- The object to test.
- Returns:
- True: the given object is contained by the calling picker.
- Since:
- 0.1