Public Member Functions | |
void | brush (int red, int green, int blue) |
void | brush (int red, int green, int blue, int alpha) |
void | clear () |
void | createPolyline (int length) |
void | drawPolyline () |
SVWindow (String name, int hash, int posX, int posY, int sizeX, int sizeY, int canvasSizeX, int canvasSizeY) | |
void | addMessageBox () |
void | setStrokeWidth (float width) |
void | drawEllipse (int x, int y, int width, int height) |
void | drawImage (PImage img, int xPos, int yPos) |
void | drawLine (int x1, int y1, int x2, int y2) |
void | drawRectangle (int x1, int y1, int x2, int y2) |
void | drawText (int x, int y, String text) |
void | pen (int red, int green, int blue) |
void | pen (int red, int green, int blue, int alpha) |
void | textAttributes (String font, int pixelSize, boolean bold, boolean italic, boolean underlined) |
void | zoomRectangle (int x1, int y1, int x2, int y2) |
void | update () |
void | addMenuBarItem (String parent, String name, int id, boolean checked) |
void | addMenuBarItem (String parent, String name) |
void | addMenuBarItem (String parent, String name, int id) |
void | addMessage (String message) |
void | showInputDialog (String msg, String def, int id, SVEventType evtype) |
void | showInputDialog (String msg) |
void | showYesNoDialog (String msg) |
void | addPopupMenuItem (String parent, String name) |
void | addPopupMenuItem (String parent, String name, int cmdEvent, String value, String desc) |
void | destroy () |
Public Attributes | |
int | hash |
SVPopupMenu | svPuMenu = null |
PCanvas | canvas |
Static Public Attributes | |
static final double | SCALING_FACTOR = 2 |
static int | nrWindows = 0 |
The SVWindow is the top-level ui class. It should get instantiated whenever the user intends to create a new window. It contains helper functions to draw on the canvas, add new menu items, show modal dialogs etc.
Definition at line 52 of file SVWindow.java.
|
inline |
Construct a new SVWindow and set it visible.
name | Title of the window. |
hash | Unique internal representation. This has to be the same as defined by the client, as they use this to refer to the windows. |
posX | X position of where to draw the window (upper left). |
posY | Y position of where to draw the window (upper left). |
sizeX | The width of the window. |
sizeY | The height of the window. |
canvasSizeX | The canvas width of the window. |
canvasSizeY | The canvas height of the window. |
Definition at line 202 of file SVWindow.java.
|
inline |
Adds a checkbox entry to the menubar, c.f. SVMenubar.add(...)
Definition at line 501 of file SVWindow.java.
|
inline |
Adds a submenu to the menubar, c.f. SVMenubar.add(...)
Definition at line 507 of file SVWindow.java.
|
inline |
Adds a new entry to the menubar, c.f. SVMenubar.add(...)
Definition at line 512 of file SVWindow.java.
|
inline |
Add a message to the message box.
Definition at line 521 of file SVWindow.java.
|
inline |
Convenience function to add a message box to the window which can be used to output debug information.
Definition at line 295 of file SVWindow.java.
|
inline |
Adds a submenu to the popup menu, c.f. SVPopupMenu.add(...)
Definition at line 617 of file SVWindow.java.
|
inline |
Adds a new menu entry to the popup menu, c.f. SVPopupMenu.add(...)
Definition at line 625 of file SVWindow.java.
|
inline |
Set the brush to an RGB color
Definition at line 118 of file SVWindow.java.
|
inline |
Set the brush to an RGBA color
Definition at line 123 of file SVWindow.java.
|
inline |
Erase all content from the window, but do not destroy it.
Definition at line 133 of file SVWindow.java.
|
inline |
Start setting up a new polyline. The server will now expect polyline data until the polyline is complete.
length | number of coordinate pairs |
Definition at line 157 of file SVWindow.java.
|
inline |
Destroys a window.
Definition at line 634 of file SVWindow.java.
|
inline |
Draw an ellipse at (x,y) with given width and height, using the current stroke, the current brush color to fill it and the current pen color for the outline.
Definition at line 322 of file SVWindow.java.
|
inline |
Draw the image with the given name at (x,y). Any image loaded stays in memory, so if you intend to redraw an image, you do not have to use createImage again.
Definition at line 335 of file SVWindow.java.
|
inline |
Draw a line from (x1,y1) to (x2,y2) using the current pen color and stroke.
Definition at line 344 of file SVWindow.java.
|
inline |
Draw the now complete polyline.
Definition at line 167 of file SVWindow.java.
|
inline |
Draw a rectangle given the two points (x1,y1) and (x2,y2) using the current stroke, pen color for the border and the brush to fill the interior.
Definition at line 359 of file SVWindow.java.
|
inline |
Draw some text at (x,y) using the current pen color and text attributes. If the current font does NOT support at least one character, it tries to find a font which is capable of displaying it and use that to render the text. Note: If the font says it can render a glyph, but in reality it turns out to be crap, there is nothing we can do about it.
Definition at line 386 of file SVWindow.java.
|
inline |
Set the pen color to an RGB value
Definition at line 423 of file SVWindow.java.
|
inline |
Set the pen color to an RGBA value
Definition at line 428 of file SVWindow.java.
|
inline |
Allows you to specify the thickness with which to draw lines, recantgles and ellipses.
width | The new thickness. |
Definition at line 311 of file SVWindow.java.
|
inline |
Show a modal input dialog. The answer by the dialog is then send to the client, together with the associated menu id, as SVET_POPUP
msg | The text that is displayed in the dialog. |
def | The default value of the dialog. |
id | The associated commandId |
evtype | The event this is associated with (usually SVET_MENU or SVET_POPUP) |
Definition at line 569 of file SVWindow.java.
|
inline |
Shows a modal input dialog to the user. The return value is automatically sent to the client as SVET_INPUT event (with command id -1).
msg | The text of the dialog. |
Definition at line 591 of file SVWindow.java.
|
inline |
Shows a dialog presenting "Yes" and "No" as answers and returns either a "y" or "n" to the client.
msg | The text that is displayed in the dialog. |
Definition at line 601 of file SVWindow.java.
|
inline |
Define how to display text. Note: underlined is not currently not supported
Definition at line 435 of file SVWindow.java.
|
inline |
Flush buffers and update display.
Only actually reacts if there are no more messages in the stack, to prevent the canvas from flickering.
Definition at line 483 of file SVWindow.java.
|
inline |
Zoom the window to the rectangle given the two points (x1,y1) and (x2,y2), which must be greater than (x1,y1).
Definition at line 457 of file SVWindow.java.
PCanvas com.google.scrollview.ui.SVWindow.canvas |
Definition at line 113 of file SVWindow.java.
int com.google.scrollview.ui.SVWindow.hash |
A unique representation for the window, also known by the client. It is used when sending messages from server to client to identify him.
Definition at line 97 of file SVWindow.java.
|
static |
The total number of created Windows. If this ever reaches 0 (apart from the beginning), quit the server.
Definition at line 103 of file SVWindow.java.
|
static |
Constant defining the "speed" at which to zoom in and out.
Definition at line 63 of file SVWindow.java.
SVPopupMenu com.google.scrollview.ui.SVWindow.svPuMenu = null |
Definition at line 112 of file SVWindow.java.