Class Component

java.lang.Object
javaforce.ui.Component
All Implemented Interfaces:
KeyCode, KeyEvents, MouseEvents
Direct Known Subclasses:
Canvas, Container, FlexBox, FontComponent, ScrollBar, ScrollBox

public class Component extends Object implements KeyEvents, MouseEvents
  • Field Details

    • foreClr

      protected Color foreClr
    • backClr

      protected Color backClr
    • disabledClr

      protected Color disabledClr
    • selectedClr

      protected Color selectedClr
    • pos

      protected Point pos
    • size

      protected Dimension size
    • parent

      protected Component 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 consumer
      Component consumes mouse up/down events.
    • zero

      public static final Dimension zero
    • debug

      public static boolean debug
  • Constructor Details

    • Component

      public Component()
  • Method Details

    • load

      public static Component load(String fn)
      Loads a complete form from a XML file (*.ui).
    • save

      public void save(String fn)
      Saves a component (and all children) to an XML file (*.ui).
    • isContainer

      public boolean isContainer()
    • isConsumer

      protected boolean isConsumer()
    • setParent

      protected void setParent(Component parent)
    • setConsumer

      protected void setConsumer(boolean consumes)
    • getPosition

      public Point getPosition()
    • getX

      public int getX()
    • getY

      public int getY()
    • setPosition

      public void setPosition(Point pt)
    • setPosition

      public void setPosition(int x, int y)
    • getSize

      public Dimension getSize()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • setSize

      public void setSize(Dimension dim)
    • setSize

      public void setSize(int width, int height)
    • getMinSize

      public Dimension 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

      public boolean isInside(Point pt)
    • render

      public void render(Image image)
    • renderLayer

      public void renderLayer(int layer, Image image)
    • layout

      public void layout(LayoutMetrics metrics)
    • setFocusable

      public void setFocusable(boolean state)
    • isVisible

      public boolean isVisible()
    • setVisible

      public void setVisible(boolean state)
    • getTopContainer

      public Container 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

      public Color getForeColor()
    • getBackColor

      public Color getBackColor()
    • getDisabledColor

      public Color getDisabledColor()
    • getSelectedColor

      public Color getSelectedColor()
    • setForeColor

      public void setForeColor(Color clr)
    • setBackColor

      public void setBackColor(Color clr)
    • setDisabledColor

      public void setDisabledColor(Color clr)
    • setSelectedColor

      public void setSelectedColor(Color clr)
    • getBorderStyle

      public int getBorderStyle()
    • setBorderStyle

      public void setBorderStyle(int lineStyle)
    • getMouseX

      public int getMouseX()
    • getMouseY

      public int getMouseY()
    • getMousePosition

      public Point getMousePosition()
    • getKeyState

      public boolean getKeyState(int vk)
    • keyTyped

      public void keyTyped(char ch)
      Specified by:
      keyTyped in interface KeyEvents
    • keyPressed

      public void keyPressed(int key)
      Specified by:
      keyPressed in interface KeyEvents
    • keyReleased

      public void keyReleased(int key)
      Specified by:
      keyReleased in interface KeyEvents
    • mouseMove

      public void mouseMove(int x, int y)
      Specified by:
      mouseMove in interface MouseEvents
    • mouseDown

      public void mouseDown(int button)
      Specified by:
      mouseDown in interface MouseEvents
    • mouseUp

      public void mouseUp(int button)
      Specified by:
      mouseUp in interface MouseEvents
    • mouseScroll

      public void mouseScroll(int dx, int dy)
      Specified by:
      mouseScroll in interface MouseEvents