pl.net.linux.krzak.kchat.util
Class kChatTextArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--pl.net.linux.krzak.kchat.util.kChatTextArea
All Implemented Interfaces:
java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class kChatTextArea
extends java.awt.Component
implements java.awt.event.AdjustmentListener

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int ACCEPT
           
static int IGNORE
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
kChatTextArea()
          Create object with default Width=200 and rows=2
kChatTextArea(int _Width, int _rows)
           
 
Method Summary
 void addClickListener(ClickListener cl)
          Add ClickListener
 void addScroll(java.awt.Scrollbar sc)
          enable scroller support
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
           
 void appendText(java.lang.String text, java.lang.String color)
          Append text with specified colour into text area
 boolean autoScroll()
          get status automatic scrolling if new messages arrive
 void autoScroll(boolean val)
          Automatic scrolling if new messages arrive
 java.awt.Dimension getMinimumSize()
           
 int getOffset()
           
 java.awt.Dimension getPreferredSize()
           
 int getrows()
           
 void paint(java.awt.Graphics g)
           
 void processMouseEvent(java.awt.event.MouseEvent e)
           
 void removeClickListener()
          Remove ClickListener
 void removeMessage(MessagesClass msg)
          Remove text from textarea
 void setBackgroundImage(java.awt.Image im)
          Set background image
 void setOffset(int off)
           
 java.awt.Color stringToColor(java.lang.String color)
          Convert string color represetation into proper object
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCEPT

public static final int ACCEPT

IGNORE

public static final int IGNORE
Constructor Detail

kChatTextArea

public kChatTextArea()
Create object with default Width=200 and rows=2

kChatTextArea

public kChatTextArea(int _Width,
                     int _rows)
Parameters:
_Width - Initial width of component
_rows - Initial count of rows
Method Detail

setBackgroundImage

public void setBackgroundImage(java.awt.Image im)
Set background image

addClickListener

public void addClickListener(ClickListener cl)
Add ClickListener
See Also:
removeClickListener()

removeClickListener

public void removeClickListener()
Remove ClickListener
See Also:
addClickListener(pl.net.linux.krzak.kchat.util.ClickListener)

addScroll

public void addScroll(java.awt.Scrollbar sc)
enable scroller support

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener

autoScroll

public boolean autoScroll()
get status automatic scrolling if new messages arrive

autoScroll

public void autoScroll(boolean val)
Automatic scrolling if new messages arrive
Parameters:
val - default true

getrows

public int getrows()

getOffset

public int getOffset()

setOffset

public void setOffset(int off)

appendText

public void appendText(java.lang.String text,
                       java.lang.String color)
Append text with specified colour into text area
Parameters:
text - Text to append
color - Text colour (ex. #1c1c1c)
See Also:
stringToColor(java.lang.String)

removeMessage

public void removeMessage(MessagesClass msg)
Remove text from textarea
Parameters:
msg - MessagesClass to remove
color - Text colour (ex. #1c1c1c)
See Also:
MessagesClass

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Component

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Component

stringToColor

public java.awt.Color stringToColor(java.lang.String color)
Convert string color represetation into proper object
Parameters:
color - Color value like #1c1c1c

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Component

processMouseEvent

public void processMouseEvent(java.awt.event.MouseEvent e)
Overrides:
processMouseEvent in class java.awt.Component