Class Canvas
java.lang.Object
javaforce.webui.Component
javaforce.webui.Container
javaforce.webui.Canvas
-
Nested Class Summary
Nested classes/interfaces inherited from class Component
Component.Event -
Field Summary
Fields inherited from class Component
ArrayType, attrs, AUTO, backclr, borderclr, BOTTOM, CENTER, classes, client, clr, COLUMN, DRAG_EW, DRAG_MOVE, DRAG_NESW, DRAG_NS, DRAG_NWSE, events, height, HIDDEN, HORIZONTAL, id, LEFT, NONE, parent, RIGHT, ROW, SCROLL, styles, TOP, VERTICAL, VISIBLE, width, x, yModifier and TypeFieldDescriptionstatic final Component[]static final intintintstatic final intstatic final intintstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intArrayList<javaforce.webui.Component.OnEvent> intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intintintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDraw an image on canvas.voidDraw a rectangle on canvas.voidEnables user drawn rectangle on canvas.getRect()Returns coordinates of last user drawn rectangle.html()Returns HTML to render component.voidTells the client to start WebGL on canvas.voidonDrawRect(Rectangle rect) Methods inherited from class Container
add, add, count, events, get, get, getAll, getComponent, init, remove, remove, removeAll, set, setClient, setFlexDirectionModifier and TypeMethodDescriptionvoidAdd component at index.voidAdd component to end of components.intcount()voidevents()Perform any post loading events.get(int idx) Get Component by id.getAll()getComponent(String name) Deprecated.voidinit()Perform any initialization with the client.voidremove(int idx) voidvoidvoidvoidsetClient(WebUIClient client) Provides the client (connection to web browser side) and init other variables.voidsetFlexDirection(int dir) Methods inherited from class Component
action, addActionListener, addAttr, addChangedListener, addClass, addClickListener, addEvent, addKeyDownListener, addKeyDownListenerPreventDefault, addKeyUpListener, addKeyUpListenerPreventDefault, addLoadedListener, addMouseDownListener, addMouseEnterListener, addMouseMoveListener, addMouseUpListener, addMovedListener, addResizedListener, addValidateListener, addVisibleListener, click, decode, dispatchEvent, enableDragging, encode, getAttrs, getBackColor, getBorderColor, getClient, getColor, getEvents, getHeight, getID, getName, getParent, getProperty, getStyle, getTopParent, gettransform, gettransformorigin, getWidth, getX, getY, hasAttr, hasClass, hasSize, hasStyle, initInvisible, isLoaded, isPopup, isVisible, onChanged, onClick, onDrawRect, onEvent, onKeyDown, onKeyUp, onLoaded, onMouseDown, onMouseEnter, onMouseMove, onMouseUp, onPos, onPosSize, onSize, removeAttr, removeClass, removeStyle, requestPos, requestPosSize, requestSize, sendData, sendEvent, sendOnResize, setAlign, setAutoHeight, setAutoWidth, setBackColor, setBorder, setBorderColor, setBorderGray, setClass, setColor, setDisabled, setFlex, setFocus, setFocusable, setFontSize, setHeight, setMaxHeight, setMaxWidth, setName, setPadding, setPosition, setProperty, setReadonly, setrotate, setscale, setSize, setStyle, settransform, settransformorigin, settransformorigin, settranslate, setVerticalAlign, setVisible, setWidth, toString, validateModifier and TypeMethodDescriptionvoidaction()voidaddActionListener(Action handler) voidvoidaddChangedListener(Changed handler) voidvoidaddClickListener(Click handler) voidvoidaddKeyDownListener(KeyDown handler) voidaddKeyDownListenerPreventDefault(KeyDown handler) voidaddKeyUpListener(KeyUp handler) voidaddKeyUpListenerPreventDefault(KeyUp handler) voidaddLoadedListener(Loaded handler) voidaddMouseDownListener(MouseDown handler) voidaddMouseEnterListener(MouseEnter handler) voidaddMouseMoveListener(MouseMove handler) voidaddMouseUpListener(MouseUp handler) voidaddMovedListener(Moved handler) voidaddResizedListener(Resized handler) voidaddValidateListener(Validate handler) voidaddVisibleListener(Visible handler) voidclick()voiddispatchEvent(String event, String[] args) Dispatches event.voidenableDragging(int drag_type, int x1, int y1, int x2, int y2) Enables dragging a component.getAttrs()Returns all attributes defined for a component (id, attrs, class, styles)intintReturns client (waits until Component is presented to user).intgetColor()intgetID()Gets Component's ID.getName()Gets Component's name.Returns Component's parent Container.getProperty(String key) Get user define property.Returns Component's top-most parent Container.intgetWidth()intgetX()intgetY()booleanbooleanbooleanhasSize()booleanprotected voidSets component to initial invisible.booleanisLoaded()booleanisPopup()booleanprotected voidprotected voidonClick(String[] args, MouseEvent me) voidonDrawRect(String[] args) voidProcess custom events.protected voidprotected voidprotected voidprotected voidonMouseDown(String[] args, MouseEvent me) protected voidonMouseEnter(String[] args, MouseEvent me) protected voidonMouseMove(String[] args, MouseEvent me) protected voidonMouseUp(String[] args, MouseEvent me) voidvoidvoidvoidremoveAttr(String attr) voidremoveClass(String cls) voidremoveStyle(String style) voidvoidvoidvoidsendData(byte[] data) Invokes getClient().sendData()booleanInvokes getClient().sendEvent()voidTriggers onresize event on client side.voidsetAlign(int align) voidvoidvoidsetBackColor(int clr) voidsetBorder(boolean state) voidsetBorderColor(int clr) voidsetBorderGray(boolean state) voidvoidsetColor(int clr) voidsetDisabled(boolean state) voidsetFlex(boolean state) voidsetFocus()voidvoidsetFontSize(int size) voidsetHeight(int height) voidvoidvoidSets Component's name.voidsetPadding(int px) voidsetPosition(int x, int y) voidsetProperty(String key, Object value) Set user define property.voidsetReadonly(boolean state) voidsetrotate(float deg) voidsetscale(float x, float y) voidsetSize(int width, int height) voidvoidsettransform(String transform) voidsettransformorigin(float x, float y) voidsettransformorigin(String origin) voidsettranslate(float x, float y) voidsetVerticalAlign(int align) voidsetVisible(boolean state) voidsetWidth(int width) toString()booleanvalidate()
-
Constructor Details
-
Canvas
public Canvas()
-
-
Method Details
-
html
-
initWebGL
public void initWebGL()Tells the client to start WebGL on canvas. -
enableDrawRect
public void enableDrawRect()Enables user drawn rectangle on canvas. Use addChangedListener() to get notification. -
getRect
Returns coordinates of last user drawn rectangle. -
drawRect
Draw a rectangle on canvas. -
drawImage
-
onDrawRect
- Overrides:
onDrawRectin classComponent
-