irc.style
Class StyledList

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--irc.style.StyledList
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class StyledList
extends java.awt.Panel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

A styled list is a panel designed for displaying lines of styled text, using special color and style codes, and smileys.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int LEFT
          Left to right direction.
static int RIGHT
          Right to left direction.
 
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
StyledList(IRCConfiguration config, java.awt.Font fnt, boolean wrap, ColorContext context)
          Create a new StyledList.
StyledList(IRCConfiguration config, java.awt.Font fnt, boolean wrap, ColorContext context, java.awt.Color male, java.awt.Color femeale, java.awt.Color undef)
          Create a new StyledList.
StyledList(IRCConfiguration config, java.awt.Font fnt, ColorContext context)
          Create a new StyledList with automatic text wraping.
 
Method Summary
 void addLine(java.lang.String line)
          Add a line at the end of this list.
 void addLines(java.lang.String[] lines)
           
 void addStyledListListener(StyledListListener lis)
          Add a listener.
 void clear()
          Clear all the lines in this list.
 void dispose()
          Dispose any off-screen ressources used by the list.
 int getHorizontalDirection()
          Get the horizontal display direction.
 int getLast()
          Get the last displayed line.
 int getLeft()
          Get the left offset.
 int getLineCount()
          Get the number of line in this list.
 int getLogicalWidth()
          Get the logical width of this list.
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics g)
           
 void release()
          Release this object.
 void removeStyledListListener(StyledListListener lis)
          Remove a listener.
 void setBackgroundImage(java.awt.Image img)
          Set the background image for display.
 void setBackgroundTiling(int t)
          Set the background image tiling.
 void setFirst(int first)
          Set the first line to be displayed.
 void setFont(java.awt.Font fnt)
          Set the font to be used for display.
 void setHorizontalDirection(int direction)
          Set the horizontal display direction.
 void setLast(int last)
          Set the last line to be displayed.
 void setLeft(int left)
          Set the left offset for this list rendering.
 void setNickList(java.lang.String[] list)
          Set the nick list for recognition.
 void setWrap(boolean wrap)
          Set the wrap mode.
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Left to right direction.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right to left direction.

See Also:
Constant Field Values
Constructor Detail

StyledList

public StyledList(IRCConfiguration config,
                  java.awt.Font fnt,
                  ColorContext context)
Create a new StyledList with automatic text wraping.

Parameters:
config - global irc configuration.
fnt - font to be used.
context - color context.

StyledList

public StyledList(IRCConfiguration config,
                  java.awt.Font fnt,
                  boolean wrap,
                  ColorContext context)
Create a new StyledList.

Parameters:
config - global irc configuration.
fnt - font to be used.
wrap - true if wrapping must occur, false otherwise.
context - color context.

StyledList

public StyledList(IRCConfiguration config,
                  java.awt.Font fnt,
                  boolean wrap,
                  ColorContext context,
                  java.awt.Color male,
                  java.awt.Color femeale,
                  java.awt.Color undef)
Create a new StyledList.

Parameters:
config - global irc configuration.
fnt - font to be used.
wrap - true if wrapping must occur, false otherwise.
context - color context.
male - male color for asl.
femeale - femeale color for asl.
undef - undefined gender color for asl.
Method Detail

release

public void release()
Release this object. No further call may be performed on this object.


setHorizontalDirection

public void setHorizontalDirection(int direction)
Set the horizontal display direction.

Parameters:
direction - horizontal display direction.

getHorizontalDirection

public int getHorizontalDirection()
Get the horizontal display direction.

Returns:
horizontal display direction.

setBackgroundImage

public void setBackgroundImage(java.awt.Image img)
Set the background image for display.

Parameters:
img - background image, or null if no background image is to be displayed.

setBackgroundTiling

public void setBackgroundTiling(int t)
Set the background image tiling.

Parameters:
t - background image tiling mode. See IRCConfiguration for tiling modes.

setFont

public void setFont(java.awt.Font fnt)
Set the font to be used for display.

Overrides:
setFont in class java.awt.Container
Parameters:
fnt - font to be used.

setWrap

public void setWrap(boolean wrap)
Set the wrap mode.

Parameters:
wrap - mode, true if end-of-line wrapping must be performed, false otherwise.

setNickList

public void setNickList(java.lang.String[] list)
Set the nick list for recognition.

Parameters:
list - the nick list.

addStyledListListener

public void addStyledListListener(StyledListListener lis)
Add a listener.

Parameters:
lis - the new listener.

removeStyledListListener

public void removeStyledListListener(StyledListListener lis)
Remove a listener.

Parameters:
lis - the listener to remove.

setLeft

public void setLeft(int left)
Set the left offset for this list rendering.

Parameters:
left - the left offset, in pixel.

getLeft

public int getLeft()
Get the left offset.

Returns:
the left offset, in pixel.

setFirst

public void setFirst(int first)
Set the first line to be displayed.

Parameters:
first - the first line to be displayed.

setLast

public void setLast(int last)
Set the last line to be displayed.

Parameters:
last - last line to be displayed.

getLogicalWidth

public int getLogicalWidth()
Get the logical width of this list.

Returns:
the logical width, in pixel.

getLast

public int getLast()
Get the last displayed line.

Returns:
the last displayed line.

getLineCount

public int getLineCount()
Get the number of line in this list.

Returns:
the line count.

addLine

public void addLine(java.lang.String line)
Add a line at the end of this list.

Parameters:
line - new line to add.

addLines

public void addLines(java.lang.String[] lines)

dispose

public void dispose()
Dispose any off-screen ressources used by the list. This method won't put the list in a non-drawable state, but next screen refresh might me slower.


clear

public void clear()
Clear all the lines in this list.


paint

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

update

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

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Specified by:
imageUpdate in interface java.awt.image.ImageObserver
Overrides:
imageUpdate in class java.awt.Component