Package javaforce.ui
Class Component
java.lang.Object
javaforce.ui.Component
- All Implemented Interfaces:
KeyCode,KeyEvents,MouseEvents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected intprotected booleanComponent consumes mouse up/down events.static booleanprotected Colorprotected booleanprotected booleanprotected booleanprotected booleanprotected Colorprotected intprotected Componentprotected Pointprotected Colorprotected Dimensionprotected booleanstatic final DimensionFields inherited from interface javaforce.ui.KeyCode
VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9, VK_A, VK_ALT_L, VK_ALT_R, VK_B, VK_BACKSLASH, VK_BACKSPACE, VK_C, VK_CAPS_LOCK, VK_COMMA, VK_CONTROL_L, VK_CONTROL_R, VK_D, VK_DELETE, VK_DIVIDE, VK_DOWN, VK_E, VK_END, VK_ENTER, VK_ESCAPE, VK_F, VK_F1, VK_F10, VK_F11, VK_F12, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_G, VK_H, VK_HOME, VK_I, VK_INSERT, VK_J, VK_K, VK_KEYPAD_0, VK_KEYPAD_1, VK_KEYPAD_2, VK_KEYPAD_3, VK_KEYPAD_4, VK_KEYPAD_5, VK_KEYPAD_6, VK_KEYPAD_7, VK_KEYPAD_8, VK_KEYPAD_9, VK_KEYPAD_DIVIDE, VK_KEYPAD_ENTER, VK_KEYPAD_LOCK, VK_KEYPAD_MINUS, VK_KEYPAD_MULTIPLY, VK_KEYPAD_PERIOD, VK_KEYPAD_PLUS, VK_L, VK_LEFT, VK_M, VK_MENU, VK_N, VK_O, VK_OS, VK_P, VK_PAGE_DOWN, VK_PAGE_UP, VK_PAUSE, VK_PERIOD, VK_Q, VK_R, VK_RIGHT, VK_S, VK_SCROLL_LOCK, VK_SHIFT_L, VK_SHIFT_R, VK_SPACE, VK_T, VK_TAB, VK_TILDE, VK_U, VK_UP, VK_V, VK_W, VK_X, VK_Y, VK_Z -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintbooleangetKeyState(int vk) intgetLayer()intintintintgetSize()intgetWidth()intgetX()intgetY()protected booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidkeyPressed(int key) voidkeyReleased(int key) voidkeyTyped(char ch) voidlayout(LayoutMetrics metrics) static ComponentLoads a complete form from a XML file (*.ui).voidmouseDown(int button) voidmouseMove(int x, int y) voidmouseScroll(int dx, int dy) voidmouseUp(int button) voidonBlur()voidonFocus()voidvoidrenderLayer(int layer, Image image) voidSaves a component (and all children) to an XML file (*.ui).voidsetBackColor(Color clr) voidsetBorderStyle(int lineStyle) protected voidsetConsumer(boolean consumes) voidsetDisabledColor(Color clr) voidsetEditable(boolean state) voidsetEnabled(boolean state) voidsetFocus()voidsetFocusable(boolean state) voidsetForeColor(Color clr) voidsetLayer(int layer) Sets a component layer.protected voidvoidsetPosition(int x, int y) voidsetPosition(Point pt) voidsetSelectedColor(Color clr) voidsetSize(int width, int height) voidvoidsetVisible(boolean state)
-
Field Details
-
foreClr
-
backClr
-
disabledClr
-
selectedClr
-
pos
-
size
-
parent
-
layer
protected int layer -
borderStyle
protected int borderStyle -
enabled
protected boolean enabled -
editable
protected boolean editable -
focused
protected boolean focused -
focusable
protected boolean focusable -
visible
protected boolean visible -
consumer
protected boolean consumerComponent consumes mouse up/down events. -
zero
-
debug
public static boolean debug
-
-
Constructor Details
-
Component
public Component()
-
-
Method Details
-
load
Loads a complete form from a XML file (*.ui). -
save
Saves a component (and all children) to an XML file (*.ui). -
isContainer
public boolean isContainer() -
isConsumer
protected boolean isConsumer() -
setParent
-
setConsumer
protected void setConsumer(boolean consumes) -
getPosition
-
getX
public int getX() -
getY
public int getY() -
setPosition
-
setPosition
public void setPosition(int x, int y) -
getSize
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
setSize
-
setSize
public void setSize(int width, int height) -
getMinSize
-
getMinWidth
public int getMinWidth() -
getMinHeight
public int getMinHeight() -
getLayer
public int getLayer() -
setLayer
public void setLayer(int layer) Sets a component layer. Default = 0. Currently the only other supported layer is 1 for popup menus and lists. -
isInside
-
render
-
renderLayer
-
layout
-
setFocusable
public void setFocusable(boolean state) -
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean state) -
getTopContainer
-
onFocus
public void onFocus() -
onBlur
public void onBlur() -
setFocus
public void setFocus() -
isFocused
public boolean isFocused() -
isFocusable
public boolean isFocusable() -
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean state) -
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean state) -
getForeColor
-
getBackColor
-
getDisabledColor
-
getSelectedColor
-
setForeColor
-
setBackColor
-
setDisabledColor
-
setSelectedColor
-
getBorderStyle
public int getBorderStyle() -
setBorderStyle
public void setBorderStyle(int lineStyle) -
getMouseX
public int getMouseX() -
getMouseY
public int getMouseY() -
getMousePosition
-
getKeyState
public boolean getKeyState(int vk) -
keyTyped
public void keyTyped(char ch) -
keyPressed
public void keyPressed(int key) - Specified by:
keyPressedin interfaceKeyEvents
-
keyReleased
public void keyReleased(int key) - Specified by:
keyReleasedin interfaceKeyEvents
-
mouseMove
public void mouseMove(int x, int y) - Specified by:
mouseMovein interfaceMouseEvents
-
mouseDown
public void mouseDown(int button) - Specified by:
mouseDownin interfaceMouseEvents
-
mouseUp
public void mouseUp(int button) - Specified by:
mouseUpin interfaceMouseEvents
-
mouseScroll
public void mouseScroll(int dx, int dy) - Specified by:
mouseScrollin interfaceMouseEvents
-