public final class CHandler
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
void |
addNewMU(java.lang.String name,
java.lang.String address,
int port,
MuSocket msock) |
Add the text display component owned by the given MuSocket to our display
object.
|
void |
closeActiveMU(java.lang.String stamp) |
Close the connection to the active MU*
|
void |
connectToNewMU() |
Show MU* Connector and set-up a connection to a new MU*
|
void |
connectToNewMU(java.lang.String muName,
java.lang.String address,
int port,
int charType,
java.lang.String charName) |
Connect to a MU* with the given connection information
|
JMSwingText |
getActiveMUDSwingText() |
This returns the active JMSwingText
|
JMText |
getActiveMUDText() |
Return the 'address' for the active JMText object
|
JMText |
getActiveMUDText(java.lang.String stamp) |
Return the active JMText component, verified with the passed timestamp
|
MuSocket |
getActiveMUHandle() |
Return the MuSocket for the currently "active" MU*
|
int |
getActiveMUIndex() |
Return the index of the active MU
|
java.lang.String |
getActiveTitle() |
Return the title of the active MU*.
|
java.util.Vector |
getAllMUs() |
Return an array of all the MU*s.
|
static CHandler |
getInstance() |
Returns an instance of this class if it has already been instantiated.
|
MuSocket |
getMUHandle(int muNum) |
Return the proper MuSocket for the requested mu
|
java.awt.Component |
getTextObject() |
Deprecated.
This method has been moved to MuckMain and broken into three
separate methods: getTextPanel(), getFancyTextPanel(), and
getLegacyTextPanel()
|
java.lang.String |
getTitle(int index) |
Return the title of the MU based on the given index
|
boolean |
isActiveMU(MuSocket mSock) |
Determines if the given MU* is the currently active MU*.
|
boolean |
isActiveMUDConnected() |
Return the connection status of the active MU*
|
boolean |
isActiveMUEchoState() |
Return the ECHO state for the active MU*
|
void |
nextMU() |
Make the next MU* in the list the active MU*
The process that makes the call to this method is responsible for
updating the display appropriately
|
MuSocket |
openSocket(SimpleWorld connWorld,
int charType) |
Create a new MuSocket that will be set-up with the supplied information
and start its thread.
|
MuSocket |
openSocket(java.lang.String name,
java.lang.String address,
int port,
boolean ssl,
int charType) |
Deprecated.
- The new function should pass a SimpleWorld object Create a
new MuSocket that will be set-up with the supplied information and start
its thread. Return the given MuSocket to the calling method. AddNewMU is
normally called after this if this is a brand new connection.
|
void |
previousMU() |
Make the previous MU* in the list the active MU*.
|
void |
reconnectToMU() |
Reconnect to the currently active (visible) MU*
|
void |
removeActiveMU(java.lang.String stamp) |
Remove the active MU* from our list altogether
|
void |
removeMU(MuSocket mSock) |
Remove the MU* indicated by the MuSocket and timeStamp
|
void |
sendText(java.lang.String send) |
Send the text to the currently active MU*
|
void |
sendText(java.lang.String inSend,
MuSocket msock) |
Send a string to the supplied MU*, using the proper encoding method
(ASCII or Unicode)
|
void |
setActiveMU(int target) |
Sets the active MU* (the MU* visible to the user) based on the index
number provided.
|
void |
setAllAttribs(java.awt.Font fontFace,
java.awt.Color fgColour,
java.awt.Color bgColour,
java.awt.Color[] newPal) |
Change the font face and size on all the connections
|
void |
setAllColours(java.awt.Color fgColour,
java.awt.Color bgColour) |
Set the foreground and background colours for all the MU*s.
|
void |
setAllFonts(java.awt.Font newStyle) |
Set the Font for all active MU*s
|
void |
setAntiAliasing(boolean state) |
Change between aliased and antialised text in our
output windows.
|
void |
setCustomPalette(java.awt.Color[] newPal) |
This method sets the custom colours to be used on all our MU* windows.
|
void |
setDoubleBuffer(boolean state) |
Change the drawing type for the JMText...
|
void |
setLogging(boolean state) |
Activate or deactivate logging in all connections
|
void |
setLowColour(boolean state) |
Set the MU* displays to operating in either "low colour" (8 colours,
normal and bold) or "high colour" (16 colours).
|
void |
showLatestMU() |
This method displays the last MU* connected to that is still open.
|
int |
totalConnections() |
Get the total number of MU*s open regardless of their connection status
|
public static CHandler getInstance()
public java.awt.Component getTextObject()
public void setActiveMU(int target)
target - The index number representing which MU* should be set
active.public void showLatestMU()
public void addNewMU(java.lang.String name,
java.lang.String address,
int port,
MuSocket msock)
name - The human-readable name of the MUaddress - The numeric or human-readable address for the MU* serverport - The MU* server port to connect tomsock - The MuSocket which is responsible for communicating between
JamochaMUD the new MU*.public MuSocket openSocket(java.lang.String name, java.lang.String address, int port, boolean ssl, int charType)
ssl - Returns whether the connection is to be encrypted (SSL) or
plain text. true - encrypted connection false -
plain text connectionname - The human-readable name for the new MUaddress - The human-readable or numeric address for the MU* serverport - The MU* server port to connect tocharType - The type of character connetion (eg. character or puppet)public MuSocket openSocket(SimpleWorld connWorld, int charType)
connWorld - charType - The type of character connection (eg. character or
puppet)public void nextMU()
public void previousMU()
public void closeActiveMU(java.lang.String stamp)
stamp - Timestamp of MU* to be closed (as confirmation)public void removeActiveMU(java.lang.String stamp)
stamp - This is the time stamp used to verify that we are closing
the proper MU*.public void removeMU(MuSocket mSock)
mSock - The MuSocket to close and removepublic JMText getActiveMUDText()
public JMSwingText getActiveMUDSwingText()
public JMText getActiveMUDText(java.lang.String stamp)
stamp - A timestamp to verify the component returnedpublic int getActiveMUIndex()
public java.lang.String getTitle(int index)
index - Index representing the MU* we are to retrieve the title of.indexpublic MuSocket getMUHandle(int muNum)
muNum - This variable represents the index of the MU* to retrievemuNumpublic MuSocket getActiveMUHandle()
public boolean isActiveMUDConnected()
throws java.lang.Exception
true - The active MU* is connected to a server
false - The active MU* is not connected to a serverjava.lang.Exception - if there are no current connectionspublic void sendText(java.lang.String send)
send - public void sendText(java.lang.String inSend,
MuSocket msock)
inSend - msock - public void setAllAttribs(java.awt.Font fontFace,
java.awt.Color fgColour,
java.awt.Color bgColour,
java.awt.Color[] newPal)
newPal - This array represents the colour palette that is to be usedfontFace - The Font to use for the display.fgColour - The foreground colour to usebgColour - The background colour to usepublic void setLogging(boolean state)
state - true - enable logging
false - disable loggingpublic void setAllColours(java.awt.Color fgColour,
java.awt.Color bgColour)
fgColour - The foreground colour to usebgColour - The background colour to usepublic void setCustomPalette(java.awt.Color[] newPal)
newPal - An array containing our new Colors.public void setAllFonts(java.awt.Font newStyle)
newStyle - The Font style to usepublic void connectToNewMU(java.lang.String muName,
java.lang.String address,
int port,
int charType,
java.lang.String charName)
muName - The human readable name of the MU* to connect toaddress - The URL or IP address of the MU* to connect toport - The port number of the MU* to connect tocharType - The type of character (eg. character or puppet)charName - The name of the characterpublic void connectToNewMU()
public int totalConnections()
public boolean isActiveMU(MuSocket mSock)
mSock - The MuSocket to check to see if it is current the active
MU*.true - the provided MU* is the active MU*
false - the provided MU* is not the active MUpublic java.lang.String getActiveTitle()
public void setDoubleBuffer(boolean state)
state - true - set the display to double buffer
false - set the display to work without bufferingpublic void setAntiAliasing(boolean state)
state - true - enable antialiasing
false - disalbe antialiasingpublic void setLowColour(boolean state)
state - true - set the display to low colour mode
false - set display to high colour modepublic boolean isActiveMUEchoState()
true - the active MU* echo mode is enabled
false - the active MU* is not in echo modepublic void reconnectToMU()
public java.util.Vector getAllMUs()