irc
Class IRCConfiguration

java.lang.Object
  |
  +--irc.IRCConfiguration

public class IRCConfiguration
extends java.lang.Object

Global IRC configuration.


Field Summary
static int TILING_CENTER
           
static int TILING_STRETCH
           
static int TILING_TILE
           
 
Constructor Summary
IRCConfiguration(TextProvider text, IRCColorModel model, URLHandler handler, ImageLoader loader, SoundHandler sound, FileHandler file)
          Create a new IRCConfiguration.
 
Method Summary
 void addSmiley(java.lang.String match, java.lang.String file)
          Add a smiley in the smiley table.
 java.lang.String formatASL(java.lang.String info)
          Format a string given asl info and current settings.
 java.lang.Object get(java.lang.String key)
          Get the given property value.
 java.awt.Color getASLColor(java.lang.String info, java.awt.Color male, java.awt.Color femeale, java.awt.Color undef)
          Find the correct ASL color for the given info.
 boolean getASLMaster()
          Return wether asl should be processed, because asl field is enabled or floating asl is enabled.
 AudioConfiguration getAudioConfiguration()
          Get the audio configuration.
 boolean getB(java.lang.String key)
          Get the given property value as a boolean value.
 java.awt.Image getBackgroundImage(java.lang.String type, java.lang.String name)
          Get the background image associated with the given source type and name.
 int getBackgroundTiling(java.lang.String type, java.lang.String name)
          Get the background image tiling associated with the given source type and name.
 java.awt.Color getColor(int i)
          Get the i'th color of the color model.
 ColorContext getColorContext(java.lang.String type, java.lang.String name)
          Get the color context associated with the given source type and name.
 ColorContext getDefaultColorContext()
          Get the default color context.
 boolean getDockingPolicy(java.lang.String type, java.lang.String name)
          Get the docking policy for the given source type and name.
 java.util.Enumeration getHighLightWords()
          Get highlight words.
 int getI(java.lang.String key)
          Get the given property value as an int value.
 ImageLoader getImageLoader()
          Get the image loader.
 IRCColorModel getIRCColorModel()
          Get IRC color model.
 java.util.Vector getNickMenuVector()
          Get the nick menu configuration vector.
 java.lang.String getS(java.lang.String key)
          Get the given property value as String value.
 SecurityProvider getSecurityProvider()
          Get the security provider.
 SmileyTable getSmileyTable()
          Get the smileys table.
 java.awt.Color[] getStyleColors(ColorContext context)
          Get the colors associated with the given color context.
 java.lang.String getText(int code)
          Get formatted text associated with the given text code, with no parameter.
 java.lang.String getText(int code, java.lang.String p1)
          Get formatted text associated with the given text code, with one parameter.
 java.lang.String getText(int code, java.lang.String p1, java.lang.String p2)
          Get formatted text associated with the given text code, with two parameters.
 java.lang.String getText(int code, java.lang.String p1, java.lang.String p2, java.lang.String p3)
          Get formatted text associated with the given text code, with three parameters.
 TextProvider getTextProvider()
          Get text provider.
 URLHandler getURLHandler()
          Get URLHandler.
 java.lang.String getVersion()
          Get version number as a string.
 int getVersionHigh()
          Get the high version number.
 int getVersionLow()
          Get the low version number.
 int getVersionMed()
          Get the middle version number.
 java.lang.String getVersionModifiers()
          Get the version modifiers.
 boolean highLightNick()
          Get nick highlight flag.
 void loadDefaultColors(java.awt.Color[] cols)
          Load the given color array with the default source colors.
 boolean matchMouseConfiguration(java.lang.String eventName, java.awt.event.MouseEvent event)
          Check whether the given event name and the given mouse event match.
 boolean mayCommand(java.lang.String cmd)
          Check wether the given command may be executed by the user.
 boolean mayJoin(java.lang.String channel)
          Test wether the given channel may be joined.
 boolean mayLeave(java.lang.String channel)
          Test wether the given channel may be left.
 void set(java.lang.String key, boolean val)
          Set the given property to the given boolean value.
 void set(java.lang.String key, int val)
          Set the given property to the given int value.
 void set(java.lang.String key, java.lang.Object obj)
          Set the given property to the given value.
 void setBackgroundImage(java.lang.String type, java.lang.String name, java.lang.String image)
          Set the background image to be used for the given source type and name.
 void setBackgroundTiling(java.lang.String type, java.lang.String name, int tiling)
          Set the background image tiling to be used for the given source type and name.
 void setCommandList(java.lang.String list)
          Set the authorized command list.
 void setDockingPolicy(java.lang.String type, java.lang.String name, boolean action)
          Set the docking policy associated with the given source type and name.
 void setHighLightConfig(int color, boolean nick, java.util.Vector words)
          Set highlight configuration.
 void setJoinList(java.lang.String list)
          Set the "may join" list.
 void setLeaveList(java.lang.String list)
          Set the "may leave" list.
 void setMouseConfiguration(java.lang.String eventName, int button, int count)
          Configure the given mouse event name.
 void setSourceColor(java.lang.String type, java.lang.String name, java.awt.Color[] c)
          Set the source colors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TILING_CENTER

public static final int TILING_CENTER
See Also:
Constant Field Values

TILING_STRETCH

public static final int TILING_STRETCH
See Also:
Constant Field Values

TILING_TILE

public static final int TILING_TILE
See Also:
Constant Field Values
Constructor Detail

IRCConfiguration

public IRCConfiguration(TextProvider text,
                        IRCColorModel model,
                        URLHandler handler,
                        ImageLoader loader,
                        SoundHandler sound,
                        FileHandler file)
Create a new IRCConfiguration.

Parameters:
text - text provider to use.
model - color model to use.
handler - URL handler to use.
loader - image loader to use.
sound - sound handler to use.
file - file handler to use.
Method Detail

getVersionHigh

public int getVersionHigh()
Get the high version number.

Returns:
the high version number.

getVersionMed

public int getVersionMed()
Get the middle version number.

Returns:
the middle version number.

getVersionLow

public int getVersionLow()
Get the low version number.

Returns:
the low version number.

getVersionModifiers

public java.lang.String getVersionModifiers()
Get the version modifiers.

Returns:
version modifiers.

getVersion

public java.lang.String getVersion()
Get version number as a string.

Returns:
high.med.lowmod version number.

getSecurityProvider

public SecurityProvider getSecurityProvider()
Get the security provider.

Returns:
the security provider.

setMouseConfiguration

public void setMouseConfiguration(java.lang.String eventName,
                                  int button,
                                  int count)
Configure the given mouse event name.

Parameters:
eventName - event name.
button - mouse button index.
count - mouse click count.

matchMouseConfiguration

public boolean matchMouseConfiguration(java.lang.String eventName,
                                       java.awt.event.MouseEvent event)
Check whether the given event name and the given mouse event match.

Parameters:
eventName - mouse event name.
event - mouse event.
Returns:
true if events match, false otherwise.

set

public void set(java.lang.String key,
                java.lang.Object obj)
Set the given property to the given value. This value may be null.

Parameters:
key - property name.
obj - property value.

set

public void set(java.lang.String key,
                int val)
Set the given property to the given int value.

Parameters:
key - property name.
val - property value.

set

public void set(java.lang.String key,
                boolean val)
Set the given property to the given boolean value.

Parameters:
key - property name.
val - property value.

get

public java.lang.Object get(java.lang.String key)
Get the given property value.

Parameters:
key - property name.
Returns:
the property value.
Throws:
java.lang.RuntimeException - if the property is unknown.

getI

public int getI(java.lang.String key)
Get the given property value as an int value.

Parameters:
key - property name.
Returns:
the property value.
Throws:
java.lang.RuntimeException - if the property is unknown.

getB

public boolean getB(java.lang.String key)
Get the given property value as a boolean value.

Parameters:
key - property name.
Returns:
the property value.
Throws:
java.lang.RuntimeException - if the property is unknown.

getS

public java.lang.String getS(java.lang.String key)
Get the given property value as String value.

Parameters:
key - property name.
Returns:
the property value.
Throws:
java.lang.RuntimeException - if the property is unknown.

getNickMenuVector

public java.util.Vector getNickMenuVector()
Get the nick menu configuration vector.

Returns:
the nick menu vector.

setDockingPolicy

public void setDockingPolicy(java.lang.String type,
                             java.lang.String name,
                             boolean action)
Set the docking policy associated with the given source type and name.

Parameters:
type - source type.
name - source name.
action - true if source should be undocked, false otherwise.

getDockingPolicy

public boolean getDockingPolicy(java.lang.String type,
                                java.lang.String name)
Get the docking policy for the given source type and name.

Parameters:
type - source type.
name - source name.
Returns:
true if the source should be undocked, false otherwise.

getBackgroundImage

public java.awt.Image getBackgroundImage(java.lang.String type,
                                         java.lang.String name)
Get the background image associated with the given source type and name.

Parameters:
type - source type.
name - source name.
Returns:
background image, or null if no image is to be displayed.

getBackgroundTiling

public int getBackgroundTiling(java.lang.String type,
                               java.lang.String name)
Get the background image tiling associated with the given source type and name.

Parameters:
type - source type.
name - source name.
Returns:
tiling mode for background image.

setBackgroundImage

public void setBackgroundImage(java.lang.String type,
                               java.lang.String name,
                               java.lang.String image)
Set the background image to be used for the given source type and name.

Parameters:
type - source type.
name - source name.
image - image name.

setBackgroundTiling

public void setBackgroundTiling(java.lang.String type,
                                java.lang.String name,
                                int tiling)
Set the background image tiling to be used for the given source type and name.

Parameters:
type - source type.
name - source name.
tiling - tiling mode to be used.

mayLeave

public boolean mayLeave(java.lang.String channel)
Test wether the given channel may be left.

Parameters:
channel - channel to be left.
Returns:
true if channel may be left, false otherwise.

mayJoin

public boolean mayJoin(java.lang.String channel)
Test wether the given channel may be joined.

Parameters:
channel - channel to be joined.
Returns:
true if channel may be joined, false otherwise.

setJoinList

public void setJoinList(java.lang.String list)
Set the "may join" list.

Parameters:
list - join list.

setLeaveList

public void setLeaveList(java.lang.String list)
Set the "may leave" list.

Parameters:
list - leave list.

setCommandList

public void setCommandList(java.lang.String list)
Set the authorized command list.

Parameters:
list - authorized command list.

mayCommand

public boolean mayCommand(java.lang.String cmd)
Check wether the given command may be executed by the user.

Returns:
true if command may be executed, false otherwise.

formatASL

public java.lang.String formatASL(java.lang.String info)
Format a string given asl info and current settings.

Parameters:
info - user whois information.
Returns:
formatted asl information. An empty string shouldn't be displayed.

getASLColor

public java.awt.Color getASLColor(java.lang.String info,
                                  java.awt.Color male,
                                  java.awt.Color femeale,
                                  java.awt.Color undef)
Find the correct ASL color for the given info.

Parameters:
info - user whois information.
male - male color.
femeale - femeale color.
undef - undefined gender color.
Returns:
asl color.

getAudioConfiguration

public AudioConfiguration getAudioConfiguration()
Get the audio configuration.

Returns:
the audio configuration.

getDefaultColorContext

public ColorContext getDefaultColorContext()
Get the default color context.

Returns:
the default color context.

getColorContext

public ColorContext getColorContext(java.lang.String type,
                                    java.lang.String name)
Get the color context associated with the given source type and name.

Parameters:
type - source name.
name - source name.
Returns:
associated color context.

loadDefaultColors

public void loadDefaultColors(java.awt.Color[] cols)
Load the given color array with the default source colors. The array must be of length 16.

Parameters:
cols - color array to be filled.

setSourceColor

public void setSourceColor(java.lang.String type,
                           java.lang.String name,
                           java.awt.Color[] c)
Set the source colors.

Parameters:
type - source type.
name - source name.
c - color array.

getStyleColors

public java.awt.Color[] getStyleColors(ColorContext context)
Get the colors associated with the given color context.

Parameters:
context - the context to get colors from.
Returns:
color array for the given context.

addSmiley

public void addSmiley(java.lang.String match,
                      java.lang.String file)
Add a smiley in the smiley table.

Parameters:
match - the matching text to replace.
file - image file name.

getImageLoader

public ImageLoader getImageLoader()
Get the image loader.

Returns:
the image loader.

getSmileyTable

public SmileyTable getSmileyTable()
Get the smileys table.

Returns:
the smiley table.

getASLMaster

public boolean getASLMaster()
Return wether asl should be processed, because asl field is enabled or floating asl is enabled.

Returns:
master asl status.

setHighLightConfig

public void setHighLightConfig(int color,
                               boolean nick,
                               java.util.Vector words)
Set highlight configuration.

Parameters:
color - hightlight color.
nick - true if nick highlight enabled.
words - hightlight words set.

highLightNick

public boolean highLightNick()
Get nick highlight flag.

Returns:
nick highlight flag.

getHighLightWords

public java.util.Enumeration getHighLightWords()
Get highlight words.

Returns:
enumeration of String.

getURLHandler

public URLHandler getURLHandler()
Get URLHandler.

Returns:
URLHandler.

getTextProvider

public TextProvider getTextProvider()
Get text provider.

Returns:
text provider.

getIRCColorModel

public IRCColorModel getIRCColorModel()
Get IRC color model.

Returns:
color model.

getText

public java.lang.String getText(int code)
Get formatted text associated with the given text code, with no parameter.

Parameters:
code - text code.
Returns:
formatted text.

getText

public java.lang.String getText(int code,
                                java.lang.String p1)
Get formatted text associated with the given text code, with one parameter.

Parameters:
code - text code.
p1 - first parameter.
Returns:
formatted text.

getText

public java.lang.String getText(int code,
                                java.lang.String p1,
                                java.lang.String p2)
Get formatted text associated with the given text code, with two parameters.

Parameters:
code - text code.
p1 - first parameter.
p2 - second parameter.
Returns:
formatted text.

getText

public java.lang.String getText(int code,
                                java.lang.String p1,
                                java.lang.String p2,
                                java.lang.String p3)
Get formatted text associated with the given text code, with three parameters.

Parameters:
code - text code.
p1 - first parameter.
p2 - second parameter.
p3 - third parameter.
Returns:
formatted text.

getColor

public java.awt.Color getColor(int i)
Get the i'th color of the color model.

Parameters:
i - index.
Returns:
color at index i.