|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gnu.glib.GObject | +--org.gnu.gtk.GtkObject | +--org.gnu.gtk.Widget | +--org.gnu.gtk.Container | +--org.gnu.gtk.Layout | +--org.gnu.gnome.Canvas
You can use the GnomeCanvas widget to draw figures, display graphics, position widgets, and more.
Constructor Summary | |
Canvas()
Constructs a new Canvas. |
|
Canvas(int handle)
Constructs a new Canvas object form a native resource. |
Method Summary | |
Color |
getColor(java.lang.String spec)
Takes a string specification for a color and allocates it into the specified GdkColor. |
long |
getColorPixel(int rgba)
Allocates a color from the RGB value passed into this function. |
CanvasItem |
getCurrentCanvasItem()
The item containing the mouse pointer, or NULL if none. |
RgbDither |
getDither()
Returns the dither mode of an antialiased canvas. |
CanvasItem |
getFocusedCanvasItem()
The currently focused item, or NULL if none. |
CanvasItem |
getGrabbedCanvasItem()
The item that holds a pointer grab, or NULL if none. |
CanvasItem |
getItemAt(double x,
double y)
Returns the item that is at the specified position in world coordinates, or NULL if no item is there. |
double |
getPixelsPerUnit()
Scaling factor to be used for display. |
CanvasGroup |
getRoot()
Returns the root canvas item group of the canvas |
double |
getScrollOffsetX()
Returns the horizontal scroll offset of the canvas in canvas pixel coordinates. |
double |
getScrollOffsetY()
Returns the vertical scroll offset of the canvas in canvas pixel coordinates. |
double |
getScrollX1()
The x1 coordinate of the scrolling region. |
double |
getScrollX2()
The x2 coordinate of the scrolling region. |
double |
getScrollY1()
The y1 coordinate of the scrolling region. |
double |
getScrollY2()
The y2 coordinate of the scrolling region. |
static Type |
getType()
Retrieve the runtime type used by the GLib library. |
void |
scrollTo(int cx,
int cy)
Scrolls the canvas to the specified offsets, given in canvas pixel coordinates. |
void |
setDither(RgbDither dither)
Controls the dithering used when the canvas renders. |
void |
setPixelsPerUnit(double n)
Sets the number of pixels that correspond to one unit in world coordinates. |
void |
setScrollRegion(double x1,
double y1,
double x2,
double y2)
Convenience method to set all 4 coordinates of the scroll region at once. |
void |
setScrollX1(double x1)
Set the scroll region's X1 coordinate. |
void |
setScrollX2(double x2)
Set the scroll region's X2 coordinate. |
void |
setScrollY1(double y1)
Set the scroll region's Y1 coordinate. |
void |
setScrollY2(double y2)
Set the scroll region's Y2 coordinate. |
void |
update()
Requests that the canvas be repainted immediately instead of during the idle loop. |
Methods inherited from class org.gnu.gtk.Layout |
addChild, getHorizontalAdjustment, getSize, getVerticalAdjustment, moveChild, setHorizontalAdjustment, setSize, setVerticalAdjustment |
Methods inherited from class org.gnu.gtk.Container |
add, addListener, getBorderWidth, getEventListenerClass, getEventType, getResizeMode, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode |
Methods inherited from class org.gnu.glib.GObject |
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Canvas()
public Canvas(int handle)
handle
- The handle to the native resource.Method Detail |
public Color getColor(java.lang.String spec)
spec
- The color to allocate.public long getColorPixel(int rgba)
rgba
- The RGB value.public CanvasItem getCurrentCanvasItem()
public RgbDither getDither()
public CanvasItem getFocusedCanvasItem()
public CanvasItem getGrabbedCanvasItem()
public CanvasItem getItemAt(double x, double y)
x
- The horizontal coordinate.y
- The vertical coordinate.public double getPixelsPerUnit()
public CanvasGroup getRoot()
public double getScrollOffsetX()
public double getScrollOffsetY()
public double getScrollX1()
public double getScrollX2()
public double getScrollY1()
public double getScrollY2()
public void scrollTo(int cx, int cy)
cx
- Horizontal coordinate.cy
- Vertical coordinate.public void setDither(RgbDither dither)
public void setPixelsPerUnit(double n)
n
- The number of pixelspublic void setScrollRegion(double x1, double y1, double x2, double y2)
x1
- First horizontal coordinate.y1
- First vertical coordinate.x2
- Second horizontal coordinate.y2
- Second vertical coordinate.public void setScrollX1(double x1)
x1
- public void setScrollY1(double y1)
y1
- public void setScrollX2(double x2)
x2
- public void setScrollY2(double y2)
y2
- public void update()
public static Type getType()
|
Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |