frame.c File Reference

Implementation of the Frame functions. More...

#include "component.h"
#include "container.h"
#include "frame.h"

Include dependency graph for frame.c:

Go to the source code of this file.

Functions

void addFrameComponent (Frame *frame, jobject comp)
 Adds a Component to the Frame.
ComponentListener addFrameComponentListener (Frame *frame, void(*func)(jint, Component))
 Adds a ComponentListener for a Frame to call back the specified function.
void addFrameComponentWithConstraint (Frame *frame, jobject comp, jobject constraint)
 Adds a Component to the Frame at a position.
MouseListener addFrameMouseListener (Frame *frame, void(*func)(jint, Component, jint, jint, jint, jint))
 Adds a MouseListener for a Frame to call back the specified function.
WindowListener addFrameWindowListener (Frame *frame, void(*func)(jint, Window))
 Adds a WindowListener for a Frame to call back the specified function.
void clearFrameScreen (Frame *frame)
 Clears the screen of the Frame.
void closeFrame (Frame *frame)
 Closes the Frame and releases all resources.
void createFrame_ (Frame *frame)
 Creates the Frame by getting the Java Frame-Class, the method ids and createing a new Java Frame-Object.
void createFrameC (Frame_ *frame)
 Function is called when working with C and calling the function createFrame.
void createFrameCPP (FrameCPP_ *frame)
 Function is called when working with C++ and calling the function createFrame.
void deleteFrame_ (Frame *frame)
 Deletes the Frame by deleting the global references.
void deleteFrameC (Frame_ *frame)
 Function is called when working with C and calling the function deleteFrame.
void deleteFrameCPP (FrameCPP_ *frame)
 Function is called when working with C++ and calling the function deleteFrame.
void drawFrameEllipse (Frame *frame, jfloat x, jfloat y, jfloat width, jfloat height, jboolean filled, const Color *c)
 Draws an ellipse on the Frame.
void drawFrameLine (Frame *frame, jfloat x1, jfloat y1, jfloat x2, jfloat y2, const Color *c)
 Draws a line on the Frame.
void drawFrameRectangle (Frame *frame, jfloat x, jfloat y, jfloat width, jfloat height, jboolean filled, const Color *c)
 Draws a rectangle on the Frame.
void drawFrameShape (Frame *frame, const Shape *s)
 Draws a Shape on the Frame.
void drawFrameString (Frame *frame, const char *text, jfloat x, jfloat y, const Color *c)
 Draws a text on the Frame.
Color getFrameBackgroundColor (Frame *frame)
 Gets the background color of the Frame.
Color getFrameForegroundColor (Frame *frame)
 Gets the foreground color of the Frame.
jint getFrameHeight (Frame *frame)
 Gets the height of the Frame.
jint getFrameState (Frame *frame)
 Gets the state of the Frame.
char * getFrameTitle (Frame *frame)
 Gets the Title of the Frame.
jint getFrameWidth (Frame *frame)
 Gets the width of the Frame.
jint getFrameX (Frame *frame)
 Gets the X-Pos of the Frame.
jint getFrameY (Frame *frame)
 Gets the Y-Pos of the Frame.
void hideFrame (Frame *frame)
 Hides the Frame.
void initFrame_ (Frame_ *frame)
 Initializes the Frame_ structure by setting the function pointers.
jboolean isSameWindow (Frame *frame, Window window)
 Compares if the windows are the same.
void removeFrameComponentListener (Frame *frame, ComponentListener cl)
 Removes a ComponentListener from a Frame and deletes the global reference to the ComponentListener.
void removeFrameMouseListener (Frame *frame, MouseListener ml)
 Removes a MouseListener from a Frame and deletes the global reference to the MouseListener.
void removeFrameWindowListener (Frame *frame, WindowListener wl)
 Removes a WindowListener from a Frame and deletes the global reference to the WindowListener.
void setFrameBackgroundColor (Frame *frame, const Color c)
 Sets the background color of the Frame.
void setFrameForegroundColor (Frame *frame, const Color c)
 Sets the foreground color of the Frame.
void setFrameLayout (Frame *frame, jobject layoutmanager)
 Sets a LayoutManager to the Frame.
void setFrameLocation (Frame *frame, jint x, jint y)
 Sets the location of the Frame.
void setFrameMenuBar (Frame *frame, MenuBar *menubar)
 Sets the MenuBar of the Frame.
void setFrameSize (Frame *frame, jint width, jint height)
 Sets Size of the Frame.
void setFrameState (Frame *frame, jint state)
 Sets the state of the Frame.
void setFrameTitle (Frame *frame, const char *title)
 Sets the Title of the Frame.
void showFrame (Frame *frame)
 Shows the Frame.


Detailed Description

Implementation of the Frame functions.

A Frame is a container where you can place control elements or draw on it. The Frame structures permit access to the methods of an AWT Frame. You can change its appearance, add control elements, draw on it, etc.

For more information about the AWT Frame have a look at Sun's Java API documentation.

Author:
Stefan Gruber
Date:
11.01.2005

Definition in file frame.c.


Function Documentation

void addFrameComponent Frame frame,
jobject  comp
 

Adds a Component to the Frame.

Parameters:
frame - The frame to draw on.
comp - The Component to add.
See also:
addFrameComponentWithConstraint(Frame* frame, jobject comp, jobject constraint)

Definition at line 465 of file frame.c.

ComponentListener addFrameComponentListener Frame frame,
void(*)(jint, Component func
 

Adds a ComponentListener for a Frame to call back the specified function.

For more information see: addComponentListener

Parameters:
frame - The frame to add the listener to.
func - The function to call back.
Returns:
the created ComponentListener object.
See also:
removeFrameComponentListener(Frame* frame, ComponentListener cl)

Definition at line 344 of file frame.c.

void addFrameComponentWithConstraint Frame frame,
jobject  comp,
jobject  constraint
 

Adds a Component to the Frame at a position.

Parameters:
frame - The frame to draw on.
comp - The Component to add.
constraint - The constraint for the LayoutManager.
See also:
addFrameComponent(Frame* frame, jobject comp)

Definition at line 478 of file frame.c.

MouseListener addFrameMouseListener Frame frame,
void(*)(jint, Component, jint, jint, jint, jint)  func
 

Adds a MouseListener for a Frame to call back the specified function.

For more information see: addMouseListener

Parameters:
frame - The frame to add the listener to.
func - The function to call back.
Returns:
the created MouseListener object.
See also:
removeFrameMouseListener(Frame* frame, MouseListener ml)

Definition at line 316 of file frame.c.

WindowListener addFrameWindowListener Frame frame,
void(*)(jint, Window func
 

Adds a WindowListener for a Frame to call back the specified function.

For more information see: addWindowListener

Parameters:
frame - The frame to add the listener to.
func - The function to call back.
Returns:
the created WindowListener object.
See also:
removeFrameWindowListener(Frame* frame, WindowListener wl)

Definition at line 288 of file frame.c.

void clearFrameScreen Frame frame  ) 
 

Clears the screen of the Frame.

Parameters:
frame - The frame to draw on.

Definition at line 433 of file frame.c.

void closeFrame Frame frame  ) 
 

Closes the Frame and releases all resources.

Attention:
The frame can not be displayed anymore after calling this function.
Parameters:
frame - Pointer to the frame.
See also:
showFrame(Frame* frame)

hideFrame(Frame* frame)

Definition at line 58 of file frame.c.

void createFrame_ Frame frame  ) 
 

Creates the Frame by getting the Java Frame-Class, the method ids and createing a new Java Frame-Object.

Parameters:
frame - The Frame to create.

Definition at line 536 of file frame.c.

void createFrameC Frame_ frame  ) 
 

Function is called when working with C and calling the function createFrame.

It initializes the Frame_ structure.

Parameters:
frame - A pointer to a Frame_ structure.

Definition at line 579 of file frame.c.

void createFrameCPP FrameCPP_ frame  ) 
 

Function is called when working with C++ and calling the function createFrame.

It initializes the FrameCPP_ structure.

Parameters:
frame - A pointer to a FrameCPP_ structure.

Definition at line 567 of file frame.c.

void deleteFrame_ Frame frame  ) 
 

Deletes the Frame by deleting the global references.

Parameters:
frame - A pointer to a frame.

Definition at line 589 of file frame.c.

void deleteFrameC Frame_ frame  ) 
 

Function is called when working with C and calling the function deleteFrame.

Parameters:
frame - A pointer to a Frame_ structure.

Definition at line 609 of file frame.c.

void deleteFrameCPP FrameCPP_ frame  ) 
 

Function is called when working with C++ and calling the function deleteFrame.

Parameters:
frame - A pointer to a FrameCPP_ structure.

Definition at line 599 of file frame.c.

void drawFrameEllipse Frame frame,
jfloat  x,
jfloat  y,
jfloat  width,
jfloat  height,
jboolean  filled,
const Color c
 

Draws an ellipse on the Frame.

Parameters:
frame - The frame to draw on.
x - The x-coordinate of the initial point.
y - The y-coordinate of the initial point.
width - The width of the rectangle surrounding the ellipse.
height - The height of the rectangle surrounding the ellipse..
filled - If JNI_TRUE the ellipse gets filled out, if JNI_FALSE only the border is drawn.
c - The color of the line. If it ist a NULL-Pointer the foreground color is used.

Definition at line 405 of file frame.c.

void drawFrameLine Frame frame,
jfloat  x1,
jfloat  y1,
jfloat  x2,
jfloat  y2,
const Color c
 

Draws a line on the Frame.

Parameters:
frame - The frame to draw on.
x1 - The x-coordinate of the initial point.
y1 - The y-coordinate of the initial point.
x2 - The x-coordinate of the endpoint.
y2 - The y-coordinate of the endpoint.
c - The color of the line. If it ist a NULL-Pointer the foreground color is used.

Definition at line 371 of file frame.c.

void drawFrameRectangle Frame frame,
jfloat  x,
jfloat  y,
jfloat  width,
jfloat  height,
jboolean  filled,
const Color c
 

Draws a rectangle on the Frame.

Parameters:
frame - The frame to draw on.
x - The x-coordinate of the initial point.
y - The y-coordinate of the initial point.
width - The width of the rectangle.
height - The height of the rectangle.
filled - If JNI_TRUE the rectangle gets filled out, if JNI_FALSE only the border is drawn.
c - The color of the line. If it ist a NULL-Pointer the foreground color is used.

Definition at line 388 of file frame.c.

void drawFrameShape Frame frame,
const Shape s
 

Draws a Shape on the Frame.

Parameters:
frame - The frame to draw on.
s - The shape to draw.

Definition at line 443 of file frame.c.

void drawFrameString Frame frame,
const char *  text,
jfloat  x,
jfloat  y,
const Color c
 

Draws a text on the Frame.

Parameters:
frame - The frame to draw on.
text - The text to draw.
x - The x-coordinate of the initial point.
y - The y-coordinate of the initial point.
c - The color of the line. If it ist a NULL-Pointer the foreground color is used.

Definition at line 420 of file frame.c.

Color getFrameBackgroundColor Frame frame  ) 
 

Gets the background color of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current color of th Frame as struct Color.
See also:
setFrameBackgroundColor(Frame* frame, Color c)

Definition at line 224 of file frame.c.

Color getFrameForegroundColor Frame frame  ) 
 

Gets the foreground color of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current color of th Frame as struct Color.
See also:
setFrameForegroundColor(Frame* frame, Color c)

Definition at line 199 of file frame.c.

jint getFrameHeight Frame frame  ) 
 

Gets the height of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current height of the Frame.
See also:
setFrameSize(Frame* frame, jint width, jint height)

getFrameWidth(Frame* frame)

Definition at line 132 of file frame.c.

jint getFrameState Frame frame  ) 
 

Gets the state of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current state (see FRAME_STATE_XXX).
See also:
setFrameState(Frame* frame, jint state)

Definition at line 249 of file frame.c.

char* getFrameTitle Frame frame  ) 
 

Gets the Title of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
a char* with the current title.
See also:
setFrameTitle(Frame* frame, const char* title)

Definition at line 85 of file frame.c.

jint getFrameWidth Frame frame  ) 
 

Gets the width of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current width of the Frame.
See also:
setFrameSize(Frame* frame, jint width, jint height)

getFrameHeight(Frame* frame)

Definition at line 118 of file frame.c.

jint getFrameX Frame frame  ) 
 

Gets the X-Pos of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current X-Pos of the frame.
See also:
setFrameLocation(Frame* frame, jint x, jint y)

getFrameY(Frame* frame)

Definition at line 160 of file frame.c.

jint getFrameY Frame frame  ) 
 

Gets the Y-Pos of the Frame.

Parameters:
frame - Pointer to the frame.
Returns:
the current Y-Pos of the frame.
See also:
setFrameLocation(Frame* frame, jint x, jint y)

getFrameX(Frame* frame)

Definition at line 174 of file frame.c.

void hideFrame Frame frame  ) 
 

Hides the Frame.

Parameters:
frame - Pointer to the frame.
See also:
showFrame(Frame* frame)

closeFrame(Frame* frame)

Definition at line 44 of file frame.c.

void initFrame_ Frame_ frame  ) 
 

Initializes the Frame_ structure by setting the function pointers.

Parameters:
frame - A pointer to a Frame_ structure.

Definition at line 487 of file frame.c.

jboolean isSameWindow Frame frame,
Window  window
 

Compares if the windows are the same.

Parameters:
frame - Pointer to the frame.
window - A Java-Object to compare with.
Returns:
JNI_TRUE if the same, otherwise JNI_FALSE.

Definition at line 273 of file frame.c.

void removeFrameComponentListener Frame frame,
ComponentListener  cl
 

Removes a ComponentListener from a Frame and deletes the global reference to the ComponentListener.

Parameters:
frame - The frame to remove the listener from.
cl - The ComponentListener to remove.
See also:
addFrameComponentListener(Frame* frame, void (*func)(jint, Component))

Definition at line 357 of file frame.c.

void removeFrameMouseListener Frame frame,
MouseListener  ml
 

Removes a MouseListener from a Frame and deletes the global reference to the MouseListener.

Parameters:
frame - The frame to remove the listener from.
ml - The MouseListener to remove.
See also:
addFrameMouseListener(Frame* frame, void (*func)(jint, Component, jint, jint, jint, jint))

Definition at line 329 of file frame.c.

void removeFrameWindowListener Frame frame,
WindowListener  wl
 

Removes a WindowListener from a Frame and deletes the global reference to the WindowListener.

Parameters:
frame - The frame to remove the listener from.
wl - The WindowListener to remove.
See also:
addFrameWindowListener(Frame* frame, void (*func)(jint, Window))

Definition at line 301 of file frame.c.

void setFrameBackgroundColor Frame frame,
const Color  c
 

Sets the background color of the Frame.

Parameters:
frame - Pointer to the frame.
c - The new Color.
See also:
getFrameBackgroundColor(Frame* frame)

Definition at line 211 of file frame.c.

void setFrameForegroundColor Frame frame,
const Color  c
 

Sets the foreground color of the Frame.

Parameters:
frame - Pointer to the frame.
c - The new Color.
See also:
getFrameForegroundColor(Frame* frame)

Definition at line 186 of file frame.c.

void setFrameLayout Frame frame,
jobject  layoutmanager
 

Sets a LayoutManager to the Frame.

Parameters:
frame - The Container to add the Component to.
layoutmanager - The LayoutManager to set.

Definition at line 453 of file frame.c.

void setFrameLocation Frame frame,
jint  x,
jint  y
 

Sets the location of the Frame.

Parameters:
frame - Pointer to the frame.
x - New X-Pos.
y - New Y-Pos.
See also:
getFrameX(Frame* frame)

getFrameY(Frame* frame)

Definition at line 146 of file frame.c.

void setFrameMenuBar Frame frame,
MenuBar menubar
 

Sets the MenuBar of the Frame.

Parameters:
frame - Pointer to the frame.
menubar - The MenuBar to set.
See also:
getFrameState(Frame* frame)

Definition at line 261 of file frame.c.

void setFrameSize Frame frame,
jint  width,
jint  height
 

Sets Size of the Frame.

Parameters:
frame - Pointer to the frame.
width - New width.
height - New height.
See also:
getFrameWidth(Frame* frame)

getFrameHeight(Frame* frame)

Definition at line 104 of file frame.c.

void setFrameState Frame frame,
jint  state
 

Sets the state of the Frame.

Parameters:
frame - Pointer to the frame.
state - The new state (see FRAME_STATE_XXX).
See also:
getFrameState(Frame* frame)

Definition at line 236 of file frame.c.

void setFrameTitle Frame frame,
const char *  title
 

Sets the Title of the Frame.

Parameters:
frame - Pointer to the frame.
title - The new title.
See also:
getFrameTitle(Frame* frame)

Definition at line 70 of file frame.c.

void showFrame Frame frame  ) 
 

Shows the Frame.

Parameters:
frame - Pointer to the frame.
See also:
hideFrame(Frame* frame)

closeFrame(Frame* frame)

Definition at line 32 of file frame.c.


Generated on Sat Nov 19 14:11:13 2005 for GrubC by  doxygen 1.4.4