|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object GWindow
GWindow is the top level graphics node and holder of GScene nodes (node containing world-to-device transformation). The GWindow is linked to the GUI through its canvas object.
Typical usage:
// Some Swing component to hold the graphics JPanel panel = new JPanel(); panel.setLayout (new BorderLayout()); // Create the window and attach to GUI GWindow window = new GWindow (Color.WHITE); panel.add (window.getCanvas(), BorderLayout.CENTER);GWindow is also the holder of the current "interaction" object communicating mouse events between the back-end AWT component and the client application.
Field Summary | |
static int |
ABORT
|
static int |
BUTTON1_DOUBLE_CLICK
|
static int |
BUTTON1_DOWN
|
static int |
BUTTON1_DRAG
|
static int |
BUTTON1_UP
|
static int |
BUTTON2_DOUBLE_CLICK
|
static int |
BUTTON2_DOWN
|
static int |
BUTTON2_DRAG
|
static int |
BUTTON2_UP
|
static int |
BUTTON3_DOUBLE_CLICK
|
static int |
BUTTON3_DOWN
|
static int |
BUTTON3_DRAG
|
static int |
BUTTON3_UP
|
static int |
FOCUS_IN
|
static int |
FOCUS_OUT
|
static int |
MOTION
|
Constructor Summary | |
GWindow()
Create a new graphics window with default background color. |
|
GWindow(Color backgroundColor)
Create a new graphic window with the specified background color. |
Method Summary | |
GObject |
find(Object userData)
Find a GObject based on user data. |
GObject |
find(String name)
Find a GObject based on specified name. |
Component |
getCanvas()
Return rendering canvas of this window. |
int |
getHeight()
Return height of this window. |
GScene |
getScene()
Return the first scene of this window (or null if no scenes are attached to this window). |
List |
getScenes()
Return all scenes of this window. |
int |
getWidth()
Return width of this window. |
boolean |
print()
Print the current image. |
void |
redraw()
Force a complete redraw of all visible elements. |
void |
refresh()
Refresh the graphics scene. |
void |
saveAsGif(File file)
Store the current graphic image as a GIF file. |
void |
saveAsJpg(File file)
Store the current graphic image as a JPG file. |
void |
saveAsPng(File file)
Store the current graphic image as a PNG file. |
void |
startInteraction(GInteraction interaction)
Install the specified interaction on this window. |
void |
stopInteraction()
Stop the current interaction. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ABORT
public static final int MOTION
public static final int BUTTON1_DOWN
public static final int BUTTON1_DRAG
public static final int BUTTON1_UP
public static final int BUTTON1_DOUBLE_CLICK
public static final int BUTTON2_DOWN
public static final int BUTTON2_DRAG
public static final int BUTTON2_UP
public static final int BUTTON2_DOUBLE_CLICK
public static final int BUTTON3_DOWN
public static final int BUTTON3_DRAG
public static final int BUTTON3_UP
public static final int BUTTON3_DOUBLE_CLICK
public static final int FOCUS_IN
public static final int FOCUS_OUT
Constructor Detail |
public GWindow(Color backgroundColor)
The window contains a JComponent canvas which should be added to a container widget in the GUI.
public GWindow()
Method Detail |
public Component getCanvas()
public int getWidth()
public int getHeight()
public List getScenes()
public GScene getScene()
public GObject find(String name)
name
- Name of object to search for.
public GObject find(Object userData)
public void startInteraction(GInteraction interaction)
interaction
- Interaction to install and start.public void stopInteraction()
public void redraw()
Normally this method is called automatically when needed (typically on retransformations). A client application may call this method explicitly if some external factor that influence the graphics has been changed. However, beware of the performance overhead of such an approach, and consider calling GObject.redraw() on the affected objects instead.
public void refresh()
public boolean print()
public void saveAsGif(File file) throws IOException
file
- File to store in.
IOException
public void saveAsJpg(File file) throws IOException
file
- File to store in.
IOException
public void saveAsPng(File file) throws IOException
file
- File to store in.
IOException
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |