diff --git a/CVSROOT/checkoutlist b/CVSROOT/checkoutlist
deleted file mode 100644
index b04b3501..00000000
--- a/CVSROOT/checkoutlist
+++ /dev/null
@@ -1,13 +0,0 @@
-# The "checkoutlist" file is used to support additional version controlled
-# administrative files in $CVSROOT/CVSROOT, such as template files.
-#
-# The first entry on a line is a filename which will be checked out from
-# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
-# The remainder of the line is an error message to use if the file cannot
-# be checked out.
-#
-# File format:
-#
-# []
-#
-# comment lines begin with '#'
diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo
deleted file mode 100644
index b19e7b7a..00000000
--- a/CVSROOT/commitinfo
+++ /dev/null
@@ -1,15 +0,0 @@
-# The "commitinfo" file is used to control pre-commit checks.
-# The filter on the right is invoked with the repository and a list
-# of files to check. A non-zero exit of the filter program will
-# cause the commit to be aborted.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being committed to, relative
-# to the $CVSROOT. For the first match that is found, then the remainder
-# of the line is the name of the filter to run.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/config b/CVSROOT/config
deleted file mode 100644
index ff43ec00..00000000
--- a/CVSROOT/config
+++ /dev/null
@@ -1,14 +0,0 @@
-# Set this to "no" if pserver shouldn't check system users/passwords
-#SystemAuth=no
-
-# Put CVS lock files in this directory rather than directly in the repository.
-#LockDir=/var/lock/cvs
-
-# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
-# level of the new working directory when using the `cvs checkout'
-# command.
-#TopLevelAdmin=no
-
-# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
-# history file, or a subset as needed (ie `TMAR' logs all write operations)
-#LogHistory=TOFEWGCMAR
diff --git a/CVSROOT/cvswrappers b/CVSROOT/cvswrappers
deleted file mode 100644
index 0accaf1b..00000000
--- a/CVSROOT/cvswrappers
+++ /dev/null
@@ -1,23 +0,0 @@
-# This file affects handling of files based on their names.
-#
-# The -t/-f options allow one to treat directories of files
-# as a single file, or to transform a file in other ways on
-# its way in and out of CVS.
-#
-# The -m option specifies whether CVS attempts to merge files.
-#
-# The -k option specifies keyword expansion (e.g. -kb for binary).
-#
-# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
-#
-# wildcard [option value][option value]...
-#
-# where option is one of
-# -f from cvs filter value: path to filter
-# -t to cvs filter value: path to filter
-# -m update methodology value: MERGE or COPY
-# -k expansion mode value: b, o, kkv, &c
-#
-# and value is a single-quote delimited value.
-# For example:
-#*.gif -k 'b'
diff --git a/CVSROOT/editinfo b/CVSROOT/editinfo
deleted file mode 100644
index d78886c1..00000000
--- a/CVSROOT/editinfo
+++ /dev/null
@@ -1,21 +0,0 @@
-# The "editinfo" file is used to allow verification of logging
-# information. It works best when a template (as specified in the
-# rcsinfo file) is provided for the logging procedure. Given a
-# template with locations for, a bug-id number, a list of people who
-# reviewed the code before it can be checked in, and an external
-# process to catalog the differences that were code reviewed, the
-# following test can be applied to the code:
-#
-# Making sure that the entered bug-id number is correct.
-# Validating that the code that was reviewed is indeed the code being
-# checked in (using the bug-id number or a seperate review
-# number to identify this particular code set.).
-#
-# If any of the above test failed, then the commit would be aborted.
-#
-# Actions such as mailing a copy of the report to each reviewer are
-# better handled by an entry in the loginfo file.
-#
-# One thing that should be noted is the the ALL keyword is not
-# supported. There can be only one entry that matches a given
-# repository.
diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo
deleted file mode 100644
index 5a59f0a5..00000000
--- a/CVSROOT/loginfo
+++ /dev/null
@@ -1,26 +0,0 @@
-# The "loginfo" file controls where "cvs commit" log information
-# is sent. The first entry on a line is a regular expression which must match
-# the directory that the change is being made to, relative to the
-# $CVSROOT. If a match is found, then the remainder of the line is a filter
-# program that should expect log information on its standard input.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name ALL appears as a regular expression it is always used
-# in addition to the first matching regex or DEFAULT.
-#
-# You may specify a format string as part of the
-# filter. The string is composed of a `%' followed
-# by a single format character, or followed by a set of format
-# characters surrounded by `{' and `}' as separators. The format
-# characters are:
-#
-# s = file name
-# V = old version number (pre-checkin)
-# v = new version number (post-checkin)
-#
-# For example:
-#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
-# or
-#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
diff --git a/CVSROOT/modules b/CVSROOT/modules
deleted file mode 100644
index cb9e9efc..00000000
--- a/CVSROOT/modules
+++ /dev/null
@@ -1,26 +0,0 @@
-# Three different line formats are valid:
-# key -a aliases...
-# key [options] directory
-# key [options] directory files...
-#
-# Where "options" are composed of:
-# -i prog Run "prog" on "cvs commit" from top-level of module.
-# -o prog Run "prog" on "cvs checkout" of module.
-# -e prog Run "prog" on "cvs export" of module.
-# -t prog Run "prog" on "cvs rtag" of module.
-# -u prog Run "prog" on "cvs update" of module.
-# -d dir Place module in directory "dir" instead of module name.
-# -l Top-level directory only -- do not recurse.
-#
-# NOTE: If you change any of the "Run" options above, you'll have to
-# release and re-checkout any working directories of these modules.
-#
-# And "directory" is a path to a directory relative to $CVSROOT.
-#
-# The "-a" option specifies an alias. An alias is interpreted as if
-# everything on the right of the "-a" had been typed on the command line.
-#
-# You can encode a module within a module by using the special '&'
-# character to interpose another module into the current module. This
-# can be useful for creating a module that consists of many directories
-# spread out over the entire source repository.
diff --git a/CVSROOT/notify b/CVSROOT/notify
deleted file mode 100644
index 34f0bc28..00000000
--- a/CVSROOT/notify
+++ /dev/null
@@ -1,12 +0,0 @@
-# The "notify" file controls where notifications from watches set by
-# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
-# a regular expression which is tested against the directory that the
-# change is being made to, relative to the $CVSROOT. If it matches,
-# then the remainder of the line is a filter program that should contain
-# one occurrence of %s for the user to notify, and information on its
-# standard input.
-#
-# "ALL" or "DEFAULT" can be used in place of the regular expression.
-#
-# For example:
-#ALL mail %s -s "CVS notification"
diff --git a/CVSROOT/rcsinfo b/CVSROOT/rcsinfo
deleted file mode 100644
index 49e59f4d..00000000
--- a/CVSROOT/rcsinfo
+++ /dev/null
@@ -1,13 +0,0 @@
-# The "rcsinfo" file is used to control templates with which the editor
-# is invoked on commit and import.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being made to, relative to the
-# $CVSROOT. For the first match that is found, then the remainder of the
-# line is the name of the file that contains the template.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/taginfo b/CVSROOT/taginfo
deleted file mode 100644
index 274a46dd..00000000
--- a/CVSROOT/taginfo
+++ /dev/null
@@ -1,20 +0,0 @@
-# The "taginfo" file is used to control pre-tag checks.
-# The filter on the right is invoked with the following arguments:
-#
-# $1 -- tagname
-# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
-# $3 -- repository
-# $4-> file revision [file revision ...]
-#
-# A non-zero exit of the filter program will cause the tag to be aborted.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being committed to, relative
-# to the $CVSROOT. For the first match that is found, then the remainder
-# of the line is the name of the filter to run.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/verifymsg b/CVSROOT/verifymsg
deleted file mode 100644
index 86f747ce..00000000
--- a/CVSROOT/verifymsg
+++ /dev/null
@@ -1,21 +0,0 @@
-# The "verifymsg" file is used to allow verification of logging
-# information. It works best when a template (as specified in the
-# rcsinfo file) is provided for the logging procedure. Given a
-# template with locations for, a bug-id number, a list of people who
-# reviewed the code before it can be checked in, and an external
-# process to catalog the differences that were code reviewed, the
-# following test can be applied to the code:
-#
-# Making sure that the entered bug-id number is correct.
-# Validating that the code that was reviewed is indeed the code being
-# checked in (using the bug-id number or a seperate review
-# number to identify this particular code set.).
-#
-# If any of the above test failed, then the commit would be aborted.
-#
-# Actions such as mailing a copy of the report to each reviewer are
-# better handled by an entry in the loginfo file.
-#
-# One thing that should be noted is the the ALL keyword is not
-# supported. There can be only one entry that matches a given
-# repository.
diff --git a/mudclient/project.properties b/mudclient/project.properties
deleted file mode 100644
index 34c231c7..00000000
--- a/mudclient/project.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-maven.repo.remote=http://www.generationjava.com/jars2/,http://www.ibiblio.org/maven/
-
-maven.ui.navcol.background=#f4f8d8
-maven.ui.banner.background=#000066
-maven.ui.section.background=#000066
-maven.ui.subsection.background=#000066
-maven.xdoc.date = left
-maven.xdoc.version = v${pom.currentVersion}
-maven.ui.breadcrumbs.background=#f4f8d8
-
-maven.xdoc.poweredby.image=../1x1.gif
diff --git a/mudclient/project.xml b/mudclient/project.xml
deleted file mode 100644
index 9bb1ed43..00000000
--- a/mudclient/project.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
- 3
- mudclient
- mudclient
- 0.2
-
- OSJava
- http://www.osjava.org/
- /images/osjava.gif
-
- 2003
- org.cyberiantiger
- /images/1x1.gif
-
-
- mudclient
-
-
- If you want to connect to any mud other than elephant.org you'll
- currently have to hack the source code, as there's some elephant specific
- code in there. [support of their "external client mode"]
-
-
- A mudclient
-
- http://www.osjava.org/mudclient/
- http://www.osjava.org:8080/jira/secure/BrowseProject.jspa?id=10011
- www.osjava.org/maven/mudclient
- /sites/org/osjava/www/maven/genjava/mudclient/
- /sites/org/osjava/www/maven/builds/
-
-
-
-
-
- 1.0
- 1.0
- HEAD
-
-
-
-
-
-
-
-
-
-
-
- Antony Riley
- antony
- antony@cyberiantiger.org
- Cyberiantiger.org
-
- Java Developer
-
-
-
-
-
-
-
-
-
-
-
-
-
- antony@www.osjava.org
-
- src/java
- src/test
-
-
-
-
- src/test/config
- config
-
-
- src/test
-
- jndi.properties
-
-
-
-
- **/*Test.java
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mudclient/src/java/org/cyberiantiger/console/AbstractConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/AbstractConsoleAction.java
deleted file mode 100644
index 72dd5d47..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/AbstractConsoleAction.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.cyberiantiger.console;
-
-public abstract class AbstractConsoleAction implements ConsoleAction {
-
- public boolean isEndOfLine() {
- return false;
- }
-
- public void appendToBuffer(StringBuffer buffer) {
- }
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/BackgroundConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/BackgroundConsoleAction.java
deleted file mode 100644
index aff4d7fb..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/BackgroundConsoleAction.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.cyberiantiger.console;
-
-public class BackgroundConsoleAction extends AbstractConsoleAction {
-
- private int color;
-
- public BackgroundConsoleAction(int color) {
- this.color = color;
- }
-
- public void apply(Console con) {
- con.setBackground(color);
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/BeepConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/BeepConsoleAction.java
deleted file mode 100644
index 2c1335fa..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/BeepConsoleAction.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.cyberiantiger.console;
-
-public class BeepConsoleAction extends AbstractConsoleAction {
-
- public BeepConsoleAction() {
- }
-
- public void apply(Console con) {
- con.beep();
- }
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/BoldConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/BoldConsoleAction.java
deleted file mode 100644
index 4c1d2e71..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/BoldConsoleAction.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.cyberiantiger.console;
-
-public class BoldConsoleAction extends AbstractConsoleAction {
-
- private boolean bold;
-
- public BoldConsoleAction(boolean bold) {
- this.bold = bold;
- }
-
- public void apply(Console con) {
- con.setBold(bold);
- }
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/ClearScreenConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/ClearScreenConsoleAction.java
deleted file mode 100644
index 7cfe732c..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/ClearScreenConsoleAction.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.cyberiantiger.console;
-
-public class ClearScreenConsoleAction extends AbstractConsoleAction {
-
- public void apply(Console con) {
- con.clearScreen();
- }
-
- public boolean isEndOfLine() {
- return true;
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/Console.java b/mudclient/src/java/org/cyberiantiger/console/Console.java
deleted file mode 100644
index 92452cd0..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/Console.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.cyberiantiger.console;
-
-public interface Console {
-
- public static final int BLACK = 0;
- public static final int RED = 1;
- public static final int YELLOW = 2;
- public static final int GREEN = 3;
- public static final int CYAN = 4;
- public static final int BLUE = 5;
- public static final int MAGENTA = 6;
- public static final int WHITE = 7;
-
- public static final int BOLD = 1 << 16;
- public static final int FLASH = 1 << 17;
- public static final int REVERSE = 1 << 18;
-
- public static final int DEFAULT = (BLACK<<8) | WHITE;
-
- public int getBufferSize();
-
- public int getWidth();
-
- public int getHeight();
-
- public void resize(int width, int height);
-
- public void moveCursorX(int x);
-
- public void moveCursorY(int x);
-
- public int getCursorX();
-
- public int getCursorY();
-
- public void setCursorX(int x);
-
- public void setCursorY(int y);
-
- public void drawString(String str);
-
- public void drawString(char[] chars);
-
- public void drawString(char[] chars, int offset, int len);
-
- public void setForeground(int color);
-
- public void setBackground(int color);
-
- public void setBold(boolean bold);
-
- public void setFlash(boolean flash);
-
- public void setReverse(boolean reverse);
-
- public void clearScreen();
-
- public void addAction(ConsoleAction action);
-
- public void beep();
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/ConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/ConsoleAction.java
deleted file mode 100644
index c42e3f79..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/ConsoleAction.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.cyberiantiger.console;
-
-public interface ConsoleAction {
-
- public void apply(Console console);
-
- public boolean isEndOfLine();
-
- public void appendToBuffer(StringBuffer buffer);
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/console/ElephantMUDConsoleAction.java b/mudclient/src/java/org/cyberiantiger/console/ElephantMUDConsoleAction.java
deleted file mode 100644
index 8eef8792..00000000
--- a/mudclient/src/java/org/cyberiantiger/console/ElephantMUDConsoleAction.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package org.cyberiantiger.console;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.regex.*;
-import java.io.*;
-
-public class ElephantMUDConsoleAction extends AbstractConsoleAction {
-
- private static Pattern mudMode = Pattern.compile("\\A\\(/(0|\".*\"),(0|\".*\"),(0|\".*\"),(-?\\d+),(-?\\d+),(-?\\d+),/\\)(.*)\\z$",Pattern.DOTALL);
-
- private static Map pinkFish = new HashMap();
-
- public final static int NO_WRAP = 1;
- public final static int NO_BLOCK = 2;
- public final static int NO_BUFFER = 4;
- public final static int IS_INVIS = 8;
- public final static int IS_DEAD = 16;
- public final static int IS_CHANNEL = 32;
- public final static int NO_NEWLINE = 64;
-
- static {
- ConsoleAction tmp;
- pinkFish.put("RESET",new ResetConsoleAction());
- pinkFish.put("BOLD",new BoldConsoleAction(true));
- pinkFish.put("FLASH",new FlashConsoleAction(true));
- pinkFish.put("RED",new ForegroundConsoleAction(Console.RED));
- pinkFish.put("YELLOW",tmp=new ForegroundConsoleAction(Console.YELLOW));
- pinkFish.put("ORANGE",tmp);
- pinkFish.put("GREEN",new ForegroundConsoleAction(Console.GREEN));
- pinkFish.put("CYAN",new ForegroundConsoleAction(Console.CYAN));
- pinkFish.put("BLUE",new ForegroundConsoleAction(Console.BLUE));
- pinkFish.put("MAGENTA",new ForegroundConsoleAction(Console.MAGENTA));
- pinkFish.put("BLACK",new ForegroundConsoleAction(Console.BLACK));
- pinkFish.put("WHITE",new ForegroundConsoleAction(Console.WHITE));
- pinkFish.put("B_RED",new BackgroundConsoleAction(Console.RED));
- pinkFish.put("B_YELLOW",tmp=new BackgroundConsoleAction(Console.YELLOW));
- pinkFish.put("B_ORANGE",tmp);
- pinkFish.put("B_GREEN",new BackgroundConsoleAction(Console.GREEN));
- pinkFish.put("B_CYAN",new BackgroundConsoleAction(Console.CYAN));
- pinkFish.put("B_BLUE",new BackgroundConsoleAction(Console.BLUE));
- pinkFish.put("B_MAGENTA",new BackgroundConsoleAction(Console.MAGENTA));
- pinkFish.put("B_BLACK",new BackgroundConsoleAction(Console.BLACK));
- pinkFish.put("B_WHITE",new BackgroundConsoleAction(Console.WHITE));
- tmp = new NullConsoleAction();
- pinkFish.put("ENDTERM",tmp);
- pinkFish.put("TERMSIZE",tmp);
- pinkFish.put("TOINPUT",tmp);
- pinkFish.put("TOMAIN",tmp);
- pinkFish.put("TOSTATUS",tmp);
- pinkFish.put("SC",tmp);
- pinkFish.put("RC",tmp);
- pinkFish.put("CLS",new ClearScreenConsoleAction());
- pinkFish.put("CLEOL",tmp);
- pinkFish.put("BELL",new BeepConsoleAction());
-
- // The following action(s) are not used by Elephant, but included for
- // completeness
- pinkFish.put("REVERSE",new ReverseConsoleAction(true));
- }
-
- private String pClass;
- private String sClass;
- private String orig;
- private int flags;
- private int indent;
- private int wrapAt;
-
- private String data;
-
- public ElephantMUDConsoleAction(String data) {
- Matcher m = mudMode.matcher(data);
- if(m.matches()) {
- String tmp;
- tmp = m.group(1);
- if(tmp.length()>1) pClass = tmp.substring(1,tmp.length()-1);
- tmp = m.group(2);
- if(tmp.length()>1) sClass = tmp.substring(1,tmp.length()-1);
- tmp = m.group(3);
- if(tmp.length()>1) orig = tmp.substring(1,tmp.length()-1);
- flags = Integer.parseInt(m.group(4));
- indent = Integer.parseInt(m.group(5));
- wrapAt = Integer.parseInt(m.group(6));
- this.data = m.group(7);
- } else {
- this.data = data;
- }
- }
-
- public ElephantMUDConsoleAction(
- String pClass,String sClass,String orig,
- int flags, int indent, int wrapAt, String data
- )
- {
- this.pClass = pClass;
- this.sClass = sClass;
- this.orig = orig;
- this.flags = flags;
- this.indent = indent;
- this.wrapAt = wrapAt;
- this.data = data;
- }
-
- public String getPrimaryClass() {
- return pClass;
- }
-
- public String getSecondaryClass() {
- return sClass;
- }
-
- public String getOrigin() {
- return orig;
- }
-
- public int getFlags() {
- return flags;
- }
-
- public int getIndent() {
- return indent;
- }
-
- public int getWrapAt() {
- return wrapAt;
- }
-
- public String getData() {
- return data;
- }
-
- public void apply(Console con) {
- int w = con.getWidth();
- int h = con.getHeight();
- String[] lines = data.split("\r?\n");
-
- // Check cursor position: If not at 0, newline
- if(con.getCursorX() != 0) {
- con.setCursorX(0);
- con.moveCursorY(1);
- }
-
- for(int i=0;i= 'A' && ch <= 'Z') ||
- (ch >= 'a' && ch <= 'z')
- )
- {
- switch(ch) {
- case 'm':
- StringTokenizer tokenizer =
- new StringTokenizer(ansi.toString(),";");
- while(tokenizer.hasMoreTokens()) {
- try {
- int i = Integer.parseInt(tokenizer.nextToken());
- ConsoleAction action = null;
- switch (i) {
- case 0:
- actions.add(new BoldConsoleAction(false));
- actions.add(new FlashConsoleAction(false));
- actions.add(new ReverseConsoleAction(false));
- break;
- case 1:
- action=new BoldConsoleAction(true);
- break;
- case 4:
- // Underscore -> Not implemented.
- break;
- case 5:
- action=new FlashConsoleAction(true);
- break;
- case 7:
- action=new ReverseConsoleAction(true);
- break;
- case 8:
- // Conceal -> Not implemented.
- break;
- case 30:
- action=new ForegroundConsoleAction(Console.BLACK);
- break;
- case 31:
- action=new ForegroundConsoleAction(Console.RED);
- break;
- case 32:
- action=new ForegroundConsoleAction(Console.GREEN);
- break;
- case 33:
- action=new ForegroundConsoleAction(Console.YELLOW);
- break;
- case 34:
- action=new ForegroundConsoleAction(Console.BLUE);
- break;
- case 35:
- action=new ForegroundConsoleAction(Console.MAGENTA);
- break;
- case 36:
- action=new ForegroundConsoleAction(Console.CYAN);
- break;
- case 37:
- action=new ForegroundConsoleAction(Console.WHITE);
- break;
- case 40:
- action=new BackgroundConsoleAction(Console.BLACK);
- break;
- case 41:
- action=new BackgroundConsoleAction(Console.RED);
- break;
- case 42:
- action=new BackgroundConsoleAction(Console.GREEN);
- break;
- case 43:
- action=new BackgroundConsoleAction(Console.YELLOW);
- break;
- case 44:
- action=new BackgroundConsoleAction(Console.BLUE);
- break;
- case 45:
- action=new BackgroundConsoleAction(Console.MAGENTA);
- break;
- case 46:
- action=new BackgroundConsoleAction(Console.CYAN);
- break;
- case 47:
- action=new BackgroundConsoleAction(Console.WHITE);
- break;
-
- }
- if(action != null) {
- actions.add(action);
- }
- } catch (NumberFormatException nfe) {
- }
- }
- break;
- case 'H':
- if(ansi.length() == 0){
- actions.add(new ClearScreenConsoleAction());
- }
- break;
- default:
- ansi.append(ch);
- System.out.println("Unknown escape string: \""+ansi+"\"");
- }
- ansi.setLength(0);
- state = TEXT;
- } else {
- ansi.append(ch);
- }
- break;
- }
- }
-
- public void flush(MudClient client) {
- Iterator i = actions.iterator();
- while(i.hasNext()) {
- ConsoleAction action = (ConsoleAction) i.next();
- client.consoleAction(action);
- }
- actions.clear();
- client.consoleAction(
- new StringConsoleAction(buffer,last_offset,offset-last_offset)
- );
- last_offset = offset;
- }
-
- public String getName() {
- return "ANSI";
- }
-
- public boolean changeParser() {
- return parserDetect != NONE;
- }
-
- public Parser getNewParser() {
- switch(parserDetect) {
- case ELECLIENT:
- return new ElephantMUDParser();
- default:
- return this;
- }
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/parser/ElephantMUDParser.java b/mudclient/src/java/org/cyberiantiger/mudclient/parser/ElephantMUDParser.java
deleted file mode 100644
index b4e6c7a9..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/parser/ElephantMUDParser.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.cyberiantiger.mudclient.parser;
-
-import java.util.*;
-import org.cyberiantiger.console.*;
-import org.cyberiantiger.mudclient.MudClient;
-
-public class ElephantMUDParser implements Parser {
-
- private List actions = new ArrayList();
- private boolean haveEscape = false;
-
- StringBuffer temp = new StringBuffer();
-
- public ElephantMUDParser() {
- }
-
- public void putChar(char ch) {
- if(haveEscape) {
- if(ch == 'D') {
- String text = temp.toString();
- temp.setLength(0);
- // XXX: A Hack to get around some messages not being
- // done correctly
- if(!text.startsWith("(/")) {
- int i = text.indexOf("(/");
- actions.add(
- new ElephantMUDConsoleAction(
- "fail",null,null,0,0,0,text.substring(0,i)
- )
- );
- text = text.substring(i);
- }
- actions.add(new ElephantMUDConsoleAction(text));
- } else {
- // The mud isn't sending us stuff in external client mode !
- }
- haveEscape = false;
- } else {
- if(ch == '\033') {
- haveEscape = true;
- } else {
- temp.append(ch);
- }
- }
- }
-
- public void flush(MudClient client) {
- Iterator i = actions.iterator();
- while(i.hasNext()) {
- ConsoleAction action = (ConsoleAction) i.next();
- client.consoleAction(action);
- }
- actions.clear();
- }
-
- public String getName() {
- return "ELECLIENT";
- }
-
- public boolean changeParser() {
- return false;
- }
-
- public Parser getNewParser() {
- return this;
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/parser/Parser.java b/mudclient/src/java/org/cyberiantiger/mudclient/parser/Parser.java
deleted file mode 100644
index 840f11c5..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/parser/Parser.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.cyberiantiger.mudclient.parser;
-
-import org.cyberiantiger.mudclient.MudClient;
-
-
-public interface Parser {
-
- /**
- * Push a character to this parser.
- *
- * @return The parser to push the next character to, may not always be
- * this instance of parser
- */
- public void putChar(char ch);
-
- /**
- * Tell this parser to flush it's output to client.
- */
- public void flush(MudClient client);
-
- /**
- * Get the name of this parser
- */
- public String getName();
-
- /**
- * Should we change the parser
- */
- public boolean changeParser();
-
- /**
- * Get the new parser in the event that it should be changed.
- */
- public Parser getNewParser();
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModel.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModel.java
deleted file mode 100644
index ec89bcfd..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModel.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-import java.util.*;
-import java.awt.Toolkit;
-import org.cyberiantiger.console.*;
-
-/**
- * A Class to represent a text based console
- */
-public class ConsoleModel implements Console {
-
- // The width of the console
- int width;
- // The height of the console
- int height;
- // The lines of buffer that the console uses.
- private int bufferSize;
-
- // The buffer each element represents a line.
- List buffer;
- // The offset into the buffer, of the first line on the screen
- int buffer_offset = 0;
- // The X position of the cursor
- private int cursor_x = 0;
- // The Y position of the cursor
- private int cursor_y = 0;
- // Current set of attributes
- private int attr = DEFAULT;
-
- public ConsoleModel(int width, int height, int bufferSize) {
- this.width = width;
- this.height = height;
- this.bufferSize = bufferSize;
- buffer = new LinkedList();
- }
-
- public int getBufferSize() {
- return buffer_offset;
- }
-
- public int getWidth() {
- return width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public void resize(int width, int height) {
- if(width != this.width || height != this.height) {
- this.width = width;
- this.height = height;
- setCursorX(getCursorX());
- setCursorY(getCursorY());
- }
- }
-
- public void moveCursorX(int x) {
- setCursorX(getCursorX()+x);
- }
-
- public void moveCursorY(int y) {
- setCursorY(getCursorY()+y);
- }
-
- public int getCursorX() {
- return cursor_x;
- }
-
- public int getCursorY() {
- return cursor_y;
- }
-
- public void setCursorX(int x) {
- if(x > width) {
- cursor_x = x % width;
- setCursorY(getCursorY()+x/width);
- } else if(x < 0) {
- cursor_x = 0;
- } else {
- cursor_x = x;
- }
- }
-
- public void setCursorY(int y) {
- if(y >= height) {
- buffer_offset += y - height + 1;
- cursor_y = height - 1;
- while(buffer_offset > bufferSize) {
- buffer.remove(0);
- buffer_offset--;
- }
- } else if(y<0) {
- cursor_y = 0;
- } else {
- cursor_y = y;
- }
- }
-
- public void drawString(String str) {
- if(str.length() > 0) {
- char[] data = new char[str.length()];
- str.getChars(0,data.length,data,0);
- drawString(data,0,data.length);
- }
- }
-
- public void drawString(char[] chars) {
- drawString(chars,0,chars.length);
- }
-
- public void drawString(char[] chars, int offset, int len) {
- if(len > 0) {
- Line current = getCurrentLine();
- if(cursor_x + len > width) {
- current.overwriteString(cursor_x, attr, chars, offset, width - cursor_x);
- offset += width - cursor_x;
- len -= width - cursor_x;
- setCursorX(0);
- setCursorY(cursor_y + 1);
- drawString(chars, offset, len);
- } else {
- current.overwriteString(cursor_x, attr, chars, offset, len);
- setCursorX(cursor_x + len);
- }
- }
- }
-
- public void setForeground(int color) {
- attr &= 0xffffff00;
- attr |= color;
- }
-
- public void setBackground(int color) {
- attr &= 0xffff00ff;
- attr |= (color << 8);
- }
-
- public void setBold(boolean bold) {
- attr |= BOLD;
- if(!bold) {
- attr ^= BOLD;
- }
- }
-
- public void setFlash(boolean flash) {
- attr |= FLASH;
- if(!flash) {
- attr ^= FLASH;
- }
- }
-
- public void setReverse(boolean reverse) {
- attr |= REVERSE;
- if(!reverse) {
- attr ^= REVERSE;
- }
- }
-
- public void clearScreen() {
- for(int i=0;i= buffer.size()) {
- return null;
- } else {
- return (Line) buffer.get(line);
- }
- }
-
- protected Line getCurrentLine() {
- if(buffer_offset + cursor_y >= buffer.size()) {
- for(int i=buffer.size();i<=buffer_offset + cursor_y;i++) {
- buffer.add(null);
- }
- }
- Line ret = (Line) buffer.get(buffer_offset + cursor_y);
- if(ret == null) {
- ret = new Line();
- buffer.set(buffer_offset + cursor_y, ret);
- }
- return ret;
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModelListener.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModelListener.java
deleted file mode 100644
index 4184357a..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleModelListener.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-public interface ConsoleModelListener {
-
- public void consoleChanged();
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleView.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleView.java
deleted file mode 100644
index a3fd03c2..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ConsoleView.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import org.cyberiantiger.console.*;
-
-public class ConsoleView extends JComponent implements ConsoleModelListener
-{
-
- private ConsoleModel model;
- private int lineOffset = 0;
-
- public ConsoleView(ConsoleModel model) {
- this.model = model;
- model.addView(this);
- setOpaque(true);
- setFont(new Font("monospaced",Font.PLAIN,14));
- setForeground(Color.white);
- setBackground(Color.black);
- setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
- enableEvents(
- AWTEvent.MOUSE_EVENT_MASK |
- AWTEvent.MOUSE_MOTION_EVENT_MASK |
- AWTEvent.MOUSE_WHEEL_EVENT_MASK |
- AWTEvent.COMPONENT_EVENT_MASK);
-
- }
-
- public synchronized void paintComponent(Graphics g) {
- int width = getWidth();
- int height = getHeight();
- g.setFont(getFont());
- FontMetrics fm = g.getFontMetrics();
- int char_width = fm.charWidth('A');
- int row_height = fm.getHeight();
- {
- // Fill the borders, and translate the origin
- int w = model.getWidth() * char_width;
- int x = (width - w) / 2;
- int h = model.getHeight() * row_height;
- int y = (height - h) / 2;
- g.setColor(getBackground());
- g.fillRect(0,0,width,y);
- g.fillRect(0,y+h,width,height-y-h);
- g.fillRect(0,y,x,h);
- g.fillRect(x+w,y,width-x-w,h);
- g.translate(x,y);
- }
- int text_offset = row_height - fm.getDescent();
- int y = 0;
- for(int i=0;i>8) & 7) {
- case ConsoleModel.BLACK:
- return Color.black;
- case ConsoleModel.RED:
- return Color.red;
- case ConsoleModel.YELLOW:
- return Color.yellow;
- case ConsoleModel.GREEN:
- return Color.green;
- case ConsoleModel.CYAN:
- return Color.cyan;
- case ConsoleModel.BLUE:
- return Color.blue;
- case ConsoleModel.MAGENTA:
- return Color.magenta;
- case ConsoleModel.WHITE:
- return Color.white;
- }
- return Color.black;
- }
-
- public Dimension getPreferredSize() {
- FontMetrics fm = getFontMetrics(getFont());
- int row_height = fm.getHeight();
- int char_width = fm.charWidth('A');
- return new Dimension(
- model.getWidth() * char_width,
- model.getHeight() * row_height
- );
-
- }
-
- public Dimension getMinimumSize() {
- FontMetrics fm = getFontMetrics(getFont());
- int row_height = fm.getHeight();
- int char_width = fm.charWidth('A');
- return new Dimension(
- char_width,
- row_height
- );
- }
-
- /**
- * Write something to our model
- */
- public synchronized void consoleAction(ConsoleAction action) {
- cancelSelection();
- model.addAction(action);
- }
-
- /**
- * Resize our model depending on our size
- */
- public synchronized void resizeConsole() {
- FontMetrics fm = getFontMetrics(getFont());
- int width = getWidth() / fm.charWidth('A');
- int height = getHeight() / fm.getHeight();
-
- if(width < 1) {
- width = 1;
- }
- if(height < 1) {
- height = 1;
- }
- model.addAction(new ResizeConsoleAction(width,height));
- }
-
- private boolean doing_selection;
- private int x_start;
- private int y_start;
-
- private int char_x_start;
- private int char_y_start;
- private int char_x_end;
- private int char_y_end;
-
- private void startSelection(int x, int y) {
- }
-
- private void continueSelection(int x, int y) {
- }
-
- private void endSelection(int x, int y) {
- }
-
- private void cancelSelection() {
- }
-
- protected void processComponentEvent(ComponentEvent ce) {
- super.processComponentEvent(ce);
- if(ce.getID() == ComponentEvent.COMPONENT_RESIZED) {
- resizeConsole();
- }
- }
-
- protected void processMouseEvent(MouseEvent me) {
- super.processMouseEvent(me);
- if(me.getID() == MouseEvent.MOUSE_PRESSED) {
- startSelection(me.getX(),me.getY());
- } else if(me.getID() == MouseEvent.MOUSE_RELEASED) {
- endSelection(me.getX(),me.getY());
- }
- }
-
- protected void processMouseMotionEvent(MouseEvent me) {
- super.processMouseMotionEvent(me);
- if(me.getID() == MouseEvent.MOUSE_DRAGGED) {
- continueSelection(me.getX(),me.getY());
- }
- }
-
- protected void processMouseWhellEvent(MouseWheelEvent mwe) {
- System.out.println("Got MouseWheelEvent: "+mwe);
- super.processMouseWheelEvent(mwe);
- }
-
- public void consoleChanged() {
- repaint();
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ControlWindow.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/ControlWindow.java
deleted file mode 100644
index 89b3e5c8..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/ControlWindow.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import java.util.*;
-import org.cyberiantiger.mudclient.MudClient;
-import org.cyberiantiger.mudclient.parser.*;
-import org.cyberiantiger.mudclient.net.MudConnection;
-import org.cyberiantiger.console.*;
-
-public class ControlWindow extends JFrame {
-
- private MudClient client;
-
- private JMenuBar menuBar;
- private JMenu fileMenu;
- private JMenu emulationMenu;
- private JMenu helpMenu;
- private JMenuItem connectMenuItem;
- private JMenuItem disconnectMenuItem;
- private JMenuItem exitMenuItem;
- private JMenuItem ansiMenuItem;
- private JMenuItem externalMenuItem;
- private JMenuItem helpMenuItem;
- private JMenuItem aboutMenuItem;
- private JTabbedPane tabbedOutputPane;
- private JTextField inputField;
-
- private MudClientUI defaultOutput;
- private Map customOutput = new HashMap();
- private Map views = new HashMap();
-
- public ControlWindow(MudClient client) {
- super("Elephant Mud Client");
- this.client = client;
- initComponents();
- }
-
- private void initComponents() {
- setDefaultCloseOperation(EXIT_ON_CLOSE);
-
- menuBar = new JMenuBar();
- fileMenu = new JMenu("File");
- emulationMenu = new JMenu("Emulation");
- helpMenu = new JMenu("Help");
- connectMenuItem = new JMenuItem("Connect");
- disconnectMenuItem= new JMenuItem("Disconnect");
- exitMenuItem = new JMenuItem("Exit");
- ansiMenuItem = new JMenuItem("Ansi");
- externalMenuItem = new JMenuItem("External Client");
- helpMenuItem = new JMenuItem("Help");
- aboutMenuItem = new JMenuItem("About");
-
- menuBar.add(fileMenu);
- menuBar.add(emulationMenu);
- menuBar.add(helpMenu);
-
- fileMenu.add(connectMenuItem);
- fileMenu.add(disconnectMenuItem);
- fileMenu.add(exitMenuItem);
-
- emulationMenu.add(ansiMenuItem);
- emulationMenu.add(externalMenuItem);
-
- helpMenu.add(helpMenuItem);
- helpMenu.add(aboutMenuItem);
-
- connectMenuItem.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- client.connect();
- }
- });
- disconnectMenuItem.setEnabled(false);
- disconnectMenuItem.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- client.disconnect();
- }
- });
- exitMenuItem.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- client.exit();
- }
- });
- ansiMenuItem.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- client.setParser(new ANSIParser());
- }
- });
- externalMenuItem.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- client.setParser(new ElephantMUDParser());
- }
- });
- helpMenuItem.setEnabled(false);
- aboutMenuItem.setEnabled(false);
- setJMenuBar(menuBar);
-
- getContentPane().setLayout(new BorderLayout());
- tabbedOutputPane = new JTabbedPane(
- JTabbedPane.BOTTOM,
- JTabbedPane.WRAP_TAB_LAYOUT
- );
- getContentPane().add(tabbedOutputPane,BorderLayout.CENTER);
-
- inputField = new JTextField();
- inputField.setFont(new Font("monospaced",Font.PLAIN,14));
- inputField.addKeyListener(
- new KeyListener() {
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) {}
- public void keyTyped(KeyEvent e) {
- // Hack, should use getKeyCode(), but for some
- // reason java swallows it.
- if(e.getKeyChar() == '\n') {
- client.command(
- getSelectedView().getViewID(),
- inputField.getText()
- );
- inputField.selectAll();
- }
- }
- });
-
- getContentPane().add(inputField,BorderLayout.SOUTH);
-
- defaultOutput = createView("Main");
- defaultOutput.sendSizeChangeEvents(client);
-
- pack();
-
- enableEvents(AWTEvent.WINDOW_EVENT_MASK);
- }
-
- public MudClientUI createView(String id) {
- MudClientUI ui = getView(id);
- if(ui != null) {
- return ui;
- } else {
- ui = new MudClientUI(id);
- tabbedOutputPane.addTab(id, ui);
- views.put(id,ui);
- return ui;
- }
- }
-
- public void deleteView(String id) {
- }
-
- public MudClientUI getView(String viewId) {
- return (MudClientUI) views.get(viewId);
- }
-
- public MudClientUI getSelectedView() {
- return (MudClientUI)tabbedOutputPane.getSelectedComponent();
- }
-
- public void processWindowEvent(WindowEvent we) {
- super.processWindowEvent(we);
- if(we.getID() == WindowEvent.WINDOW_CLOSING) {
- client.exit();
- }
- }
-
- public void consoleAction(ConsoleAction action) {
- if(action instanceof ElephantMUDConsoleAction) {
- ElephantMUDConsoleAction eAction =
- (ElephantMUDConsoleAction) action;
-
- String tmp = eAction.getPrimaryClass();
-
- // First check if there's an existing window to grab this message.
- String outputName;
- MudClientUI destination;
-
- if((destination = (MudClientUI)customOutput.get(tmp) ) == null) {
- if((outputName = client.getCustomOutputName(tmp)) == null) {
- destination = defaultOutput;
- } else {
- destination = createView(outputName);
- java.util.List types = client.getCustomOutputTypes(outputName);
- Iterator i = types.iterator();
- while(i.hasNext()) {
- customOutput.put(i.next(), destination);
- }
- }
- }
- destination.consoleAction(action);
- } else {
- defaultOutput.consoleAction(action);
- }
- }
-
- public void connectionStatusChanged(int newStatus) {
- switch(newStatus) {
- case MudConnection.CONNECTED:
- disconnectMenuItem.setEnabled(true);
- connectMenuItem.setEnabled(false);
- break;
- case MudConnection.CONNECTING:
- case MudConnection.DISCONNECTING:
- disconnectMenuItem.setEnabled(false);
- connectMenuItem.setEnabled(false);
- break;
- case MudConnection.DISCONNECTED:
- disconnectMenuItem.setEnabled(false);
- connectMenuItem.setEnabled(true);
- break;
- }
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/Line.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/Line.java
deleted file mode 100644
index 1c6237fa..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/Line.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-import java.util.List;
-import java.util.ArrayList;
-
-public class Line {
-
- public LineSegment first = null;
-
- public Line() {
- }
-
- public void overwriteString(int offset,int attr,String str) {
- LineSegment segment = new LineSegment(str, attr);
- overwriteSegment(offset,segment);
- }
-
- public void overwriteString(int offset,int attr,char[] chars,int off,int len)
- {
- LineSegment segment = new LineSegment(chars,off,len, attr);
- overwriteSegment(offset,segment);
- }
-
- public void overwriteSegment(int offset,LineSegment segment) {
- if(first == null) {
- if(offset != 0) {
- first = new LineSegment(offset,ConsoleModel.DEFAULT);
- first.next = segment;
- } else {
- first = segment;
- }
- } else {
- if(offset == 0) {
- segment.next = first.deleteChars(segment.len);
- first = segment;
- } else {
- first.overwriteSegment(offset,segment);
- }
- }
- }
-
- public String toString() {
- StringBuffer ret = new StringBuffer();
- LineSegment seg = first;
- while(seg != null) {
- ret.append(seg.data,seg.offset,seg.len);
- seg = seg.next;
- }
- return ret.toString();
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/LineSegment.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/LineSegment.java
deleted file mode 100644
index cc32e3c3..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/LineSegment.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-public class LineSegment {
-
- public char[] data;
- public int offset;
- public int len;
- public int attr;
- public LineSegment next = null;
-
- // Create a new segment, consisting of len spaces.
- public LineSegment(int len,int attr) {
- data = new char[len];
- for (int i=0;i len) {
- if(next == null) {
- next = new LineSegment(offset-len,ConsoleModel.DEFAULT);
- next.next = segment;
- } else {
- next.overwriteSegment(offset-len, segment);
- }
- } else if(offset == len) {
- if(next == null) {
- // appends to this segment
- this.next = segment;
- } else {
- // overwrites the next segment, and maybe the one after that.
- segment.next = next.deleteChars(segment.len);
- this.next = segment;
- }
- } else {
- if(offset + segment.len > len) {
- // Carries on, into next segment
- segment.next = next.deleteChars(this.len - offset);
- this.next = segment;
- this.len = offset;
- } else if(offset + segment.len == len) {
- // Overwrites the latter half of this segment.
- this.len = offset;
- segment.next = this.next;
- this.next = segment;
- } else {
- // Splits this segment in two.
- LineSegment tail = new LineSegment(data,this.offset + offset + segment.len, len - offset - segment.len, this.attr);
- tail.next = this.next;
- segment.next = tail;
- this.next = segment;
- }
- }
- }
-
- public LineSegment deleteChars(int number) {
- if(number > len) {
- if(next != null) {
- return next.deleteChars(number - len);
- } else {
- return null;
- }
- } else if(number == len) {
- return next;
- } else {
- offset += number;
- len -= number;
- return this;
- }
- }
-
- public String toString() {
- return new String(data,offset,len);
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/mudclient/ui/MudClientUI.java b/mudclient/src/java/org/cyberiantiger/mudclient/ui/MudClientUI.java
deleted file mode 100644
index d7a31e24..00000000
--- a/mudclient/src/java/org/cyberiantiger/mudclient/ui/MudClientUI.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.cyberiantiger.mudclient.ui;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.net.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import org.cyberiantiger.console.*;
-import org.cyberiantiger.mudclient.MudClient;
-import org.cyberiantiger.mudclient.net.*;
-import org.cyberiantiger.mudclient.parser.*;
-
-public class MudClientUI extends JPanel implements ConsoleModelListener {
-
- private ConsoleModel model;
- private ConsoleView view;
- private JScrollBar scrollBar;
- private String viewID;
- private MudClient client;
-
- public MudClientUI(String viewID) {
- this.viewID = viewID;
- model = new ConsoleModel(80,25,2000);
- view = new ConsoleView(model);
- scrollBar = new JScrollBar(JScrollBar.VERTICAL);
-
- model.addView(this);
-
- scrollBar.addAdjustmentListener(
- new AdjustmentListener() {
- public void adjustmentValueChanged(AdjustmentEvent ae) {
- view.setLineOffset(scrollBar.getValue());
- }
- });
-
- setLayout(new BorderLayout());
- add(BorderLayout.CENTER,view);
- add(BorderLayout.EAST,scrollBar);
- }
-
- public String getViewID() {
- return viewID;
- }
-
- public void consoleChanged() {
- scrollBar.setBlockIncrement(model.getHeight());
- scrollBar.setValues(
- model.getBufferSize(),
- model.getHeight(),
- 0,
- model.getHeight() + model.getBufferSize()
- );
- if(client != null) {
- client.setWindowSize(model.getWidth(),model.getHeight());
- }
- }
-
- public void consoleAction(ConsoleAction action) {
- view.consoleAction(action);
- }
-
- public void sendSizeChangeEvents(MudClient client) {
- this.client = client;
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetOption.java b/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetOption.java
deleted file mode 100644
index 502f528c..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetOption.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.cyberiantiger.telnet;
-
-public abstract class AbstractTelnetOption implements TelnetOption {
-
- protected int option;
-
- public AbstractTelnetOption(int option) {
- this.option = option;
- }
-
- public int getOption() {
- return option;
- }
-
- public byte[] getBytes() {
- return new byte[] { (byte) IAC, (byte) option };
- }
-
- public String toString() {
- return "IAC " + commandToString(option);
- }
-
- protected String commandToString(int command) {
- switch(command) {
- case SE: return "SE";
- case NOP: return "NOP";
- case DM: return "DM";
- case BRK: return "BRK";
- case IP: return "IP";
- case AO: return "AO";
- case AYT: return "AYT";
- case EC: return "EC";
- case EL: return "EL";
- case GA: return "GA";
- case SB: return "SB";
- case WILL: return "WILL";
- case WONT: return "WONT";
- case DO: return "DO";
- case DONT: return "DONT";
- case IAC: return "IAC";
- default: return "<" + command + ">";
- }
- }
-
- protected String optionToString(int option) {
- switch(option) {
- case TOPT_BIN: return "TOPT_BIN";
- case TOPT_ECHO: return "TOPT_ECHO";
- case TOPT_RECN: return "TOPT_RECN";
- case TOPT_SUPP: return "TOPT_SUPP";
- case TOPT_APRX: return "TOPT_APRX";
- case TOPT_STAT: return "TOPT_STAT";
- case TOPT_TIM: return "TOPT_TIM";
- case TOPT_REM: return "TOPT_REM";
- case TOPT_OLW: return "TOPT_OLW";
- case TOPT_OPS: return "TOPT_OPS";
- case TOPT_OCRD: return "TOPT_OCRD";
- case TOPT_OHT: return "TOPT_OHT";
- case TOPT_OHTD: return "TOPT_OHTD";
- case TOPT_OFD: return "TOPT_OFD";
- case TOPT_OVT: return "TOPT_OVT";
- case TOPT_OVTD: return "TOPT_OVTD";
- case TOPT_OLD: return "TOPT_OLD";
- case TOPT_EXT: return "TOPT_EXT";
- case TOPT_LOGO: return "TOPT_LOGO";
- case TOPT_BYTE: return "TOPT_BYTE";
- case TOPT_DATA: return "TOPT_DATA";
- case TOPT_SUP: return "TOPT_SUP";
- case TOPT_SUPO: return "TOPT_SUPO";
- case TOPT_SNDL: return "TOPT_SNDL";
- case TOPT_TERM: return "TOPT_TERM";
- case TOPT_EOR: return "TOPT_EOR";
- case TOPT_TACACS: return "TOPT_TACACS";
- case TOPT_OM: return "TOPT_OM";
- case TOPT_TLN: return "TOPT_TLN";
- case TOPT_3270: return "TOPT_3270";
- case TOPT_X_3: return "TOPT_X_3";
- case TOPT_NAWS: return "TOPT_NAWS";
- case TOPT_TS: return "TOPT_TS";
- case TOPT_RFC: return "TOPT_RFC";
- case TOPT_LINE: return "TOPT_LINE";
- case TOPT_XDL: return "TOPT_XDL";
- case TOPT_AUTH: return "TOPT_AUTH";
- case TOPT_ENVIR: return "TOPT_ENVIR";
- case TOPT_TN3270E: return "TOPT_TN3270E";
- case TOPT_XAUTH: return "TOPT_XAUTH";
- case TOPT_CHARSET: return "TOPT_CHARSET";
- case TOPT_RSP: return "TOPT_RSP";
- case TOPT_COMPORT: return "TOPT_COMPORT";
- case TOPT_SLE: return "TOPT_SLE";
- case TOPT_STARTTLS: return "TOPT_STARTTLS";
- case TOPT_KERMIT: return "TOPT_KERMIT";
- case TOPT_SEND_URL: return "TOPT_SEND_URL";
- case TOPT_EXTOP: return "TOPT_EXTOP";
- default: return "<" + option + ">";
- }
- }
-
- protected String dataToString(byte[] data) {
- return "\"" + new String(data) + "\"";
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetSubOption.java b/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetSubOption.java
deleted file mode 100644
index eee6300a..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/AbstractTelnetSubOption.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.cyberiantiger.telnet;
-
-public abstract class AbstractTelnetSubOption extends AbstractTelnetOption {
-
- protected int suboption;
-
- public AbstractTelnetSubOption(int option, int suboption) {
- super(option);
- this.suboption = suboption;
- }
-
- public int getSubOption() {
- return suboption;
- }
-
- public byte[] getBytes() {
- return new byte[] { (byte) IAC, (byte) option, (byte) suboption };
- }
-
- public String toString() {
- return super.toString() + " " + optionToString(suboption);
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/BinaryData.java b/mudclient/src/java/org/cyberiantiger/telnet/BinaryData.java
deleted file mode 100644
index ddfd9355..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/BinaryData.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.cyberiantiger.telnet;
-
-public interface BinaryData {
-
- public byte[] getBytes();
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/OptionParser.java b/mudclient/src/java/org/cyberiantiger/telnet/OptionParser.java
deleted file mode 100644
index 21e093b2..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/OptionParser.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.cyberiantiger.telnet;
-
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-/**
- * A static class for parsing telnet options, coz it's stateless.
- */
-public class OptionParser {
-
- // No-One can instantiate the class
- private OptionParser() {}
-
- public static TelnetOption parseOption(InputStream in, int option)
- throws IOException
- {
- if(option < 240) {
- return new UnknownTelnetOption(option);
- } else if(option < 250) {
- return new SimpleTelnetOption(option);
- } else if(option == TelnetOption.SB) {
- int suboption = in.read();
- // Check for end of stream.
- if(suboption == -1) return null;
- ByteArrayOutputStream out = new ByteArrayOutputStream(40);
- while(true) {
- int i = in.read();
- // Check for end of stream.
- if(i == -1) return null;
- if(i == TelnetOption.IAC) {
- int j = in.read();
- // Check for end of stream.
- if(j == -1) return null;
- if(j == TelnetOption.IAC) {
- out.write(TelnetOption.IAC);
- } else if(j == TelnetOption.SE) {
- return new TelnetSubOption(suboption, out.toByteArray());
- } else {
- // It's a broken telnet implementation, assume they
- // just forgot to double the TelnetOption.IAC.
- out.write(TelnetOption.IAC);
- out.write(j);
- }
- } else {
- out.write(i);
- }
- }
- } else {
- int suboption = in.read();
- if(suboption == -1) return null;
- return new TelnetNegotiation(option, suboption);
- }
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetOption.java b/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetOption.java
deleted file mode 100644
index a233735b..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetOption.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.cyberiantiger.telnet;
-
-public class SimpleTelnetOption extends AbstractTelnetOption {
-
- public SimpleTelnetOption(int option) {
- super(option);
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetSession.java b/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetSession.java
deleted file mode 100644
index 3c285e64..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/SimpleTelnetSession.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.cyberiantiger.telnet;
-
-import java.io.*;
-
-public abstract class SimpleTelnetSession implements TelnetSession {
-
- private OutputStream out;
-
- String term;
- int width = 0;
- int height = 0;
-
- boolean nawsOn = false;
- boolean termOn = false;
-
- public SimpleTelnetSession(String term) {
- this.term = term;
- }
-
- public void receiveOption(TelnetOption opt)
- throws IOException
- {
- if(opt instanceof TelnetNegotiation) {
- TelnetOption reply;
- switch(opt.getOption()) {
- case TelnetOption.WILL:
- switch(((TelnetNegotiation)opt).getSubOption()) {
- case TelnetOption.TOPT_ECHO:
- serverWillEcho(true);
- break;
- default:
- break;
- }
- break;
- case TelnetOption.WONT:
- switch(((TelnetNegotiation)opt).getSubOption()) {
- case TelnetOption.TOPT_ECHO:
- serverWillEcho(false);
- break;
- default:
- break;
- }
- break;
- case TelnetOption.DO:
- switch(((TelnetNegotiation)opt).getSubOption()) {
- case TelnetOption.TOPT_TERM:
- reply = new TelnetNegotiation(
- TelnetOption.WILL,
- TelnetOption.TOPT_TERM
- );
- out.write(reply.getBytes());
- termOn = true;
- break;
- case TelnetOption.TOPT_NAWS:
- reply = new TelnetNegotiation(
- TelnetOption.WILL,
- TelnetOption.TOPT_NAWS
- );
- out.write(reply.getBytes());
- nawsOn = true;
- sendWindowSize();
- break;
- default:
- // Ignored
- break;
- }
- break;
- case TelnetOption.DONT:
- break;
- }
- } else if(opt instanceof TelnetSubOption) {
- byte[] data;
- data = ((TelnetSubOption)opt).getData();
- switch(((TelnetSubOption)opt).getSubOption()) {
- case TelnetOption.TOPT_TERM:
- if(data.length == 1 && data[0] == TelnetOption.SEND) {
- sendTerminalType();
- }
- default:
- break;
- }
- }
- }
-
- public void setOutputStream(OutputStream out) throws IOException {
- this.out = out;
- }
-
- public void sendWindowSize() throws IOException {
- if(out != null && nawsOn && (width != 0 || height != 0) ) {
- TelnetOption opt = new TelnetSubOption(
- TelnetOption.TOPT_NAWS,
- new byte[] {
- ((byte) ((width>>8) & 0xff)),
- ((byte) (width & 0xff)),
- ((byte) ((height>>8) & 0xff)),
- ((byte) (height & 0xff))
- });
- out.write(opt.getBytes());
- }
- }
-
- public void sendTerminalType() throws IOException {
- if(out != null && termOn) {
- byte[] term = this.term.getBytes();
- byte[] data = new byte[term.length+1];
- data[0] = TelnetOption.IS;
- System.arraycopy(term,0,data,1,term.length);
- TelnetOption opt = new TelnetSubOption(
- TelnetOption.TOPT_TERM,
- data);
- out.write(opt.getBytes());
- }
- }
-
- public void setWindowSize(int width, int height) throws IOException {
- if(this.width != width || this.height != height) {
- this.width = width;
- this.height = height;
- sendWindowSize();
- }
- }
-
- protected abstract void serverWillEcho(boolean echo);
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/TelnetBufferedInputStream.java b/mudclient/src/java/org/cyberiantiger/telnet/TelnetBufferedInputStream.java
deleted file mode 100644
index 8c10be32..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/TelnetBufferedInputStream.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.cyberiantiger.telnet;
-
-import java.io.*;
-
-/**
- * A buffered input stream which will not do a blocking read unless explictely
- * told to do so
- */
-public class TelnetBufferedInputStream extends FilterInputStream {
-
- private byte[] buffer = new byte[2048];
- private int off = 0;
- private int len = 0;
- private boolean allowBlocking = false;
-
- public TelnetBufferedInputStream(InputStream in) {
- super(in);
- }
-
- public int read() throws IOException {
- if(allowBlocking && len == 0) {
- fillBuffer();
- }
- if(len <= 0) {
- return -1;
- }
- len--;
- return buffer[off++] & 0xff;
- }
-
- public int read(byte[] b) throws IOException {
- return read(b, 0, b.length);
- }
-
- public int read(byte[] b, int bOff, int bLen) throws IOException {
- if(allowBlocking && len == 0) {
- fillBuffer();
- }
- if(len <= 0) {
- return -1;
- }
- if(len > bLen) {
- System.arraycopy(buffer,off,b,bOff,bLen);
- len -= bLen;
- off += bLen;
- } else {
- System.arraycopy(buffer,off,b,bOff,len);
- bLen = len;
- len = 0;
- }
- return bLen;
- }
-
- public void fillBuffer() throws IOException {
- if(len != 0) return;
- off = 0;
- len = in.read(buffer,off,buffer.length - len);
- }
-
- public int available() throws IOException {
- return len;
- }
-
- public void setAllowBlocking(boolean allowBlocking) {
- this.allowBlocking = allowBlocking;
- }
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/TelnetInputStream.java b/mudclient/src/java/org/cyberiantiger/telnet/TelnetInputStream.java
deleted file mode 100644
index e12dd59d..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/TelnetInputStream.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.cyberiantiger.telnet;
-
-import java.io.*;
-
-public abstract class TelnetInputStream extends FilterInputStream {
-
- byte[] buffer = new byte[2048];
- int off = 0;
- int len = 0;
-
- boolean inTelnetOpt = false;
- int toptVal = -1;
-
- public TelnetInputStream(InputStream in) {
- super(new TelnetBufferedInputStream(in));
- }
-
- /**
- * Fill the buffer in this object.
- */
- private void fillBuffer() throws IOException {
- if(len != 0) return;
- if(in.available() == -1) {
- // NO MORE DATA !
- len = -1;
- return;
- }
- off = 0;
- if(inTelnetOpt) {
- try {
- ((TelnetBufferedInputStream)in).setAllowBlocking(true);
- if(toptVal == -1) {
- int ch = in.read();
- if(ch == -1) {
- len = -1;
- return;
- } else if(ch == TelnetOption.IAC) {
- buffer[len++] = (byte) ch;
- } else {
- TelnetOption opt = OptionParser.parseOption(in,ch);
- parseTelnetOption(opt);
- }
- } else {
- TelnetOption opt = OptionParser.parseOption(in,toptVal);
- parseTelnetOption(opt);
- }
- } finally {
- inTelnetOpt = false;
- ((TelnetBufferedInputStream)in).setAllowBlocking(false);
- }
- }
- if(in.available() == 0) {
- ((TelnetBufferedInputStream)in).fillBuffer();
- }
- int ch;
- while( (ch = in.read()) != -1) {
- if(ch == TelnetOption.IAC) {
- ch = in.read();
- if(ch != TelnetOption.IAC) {
- inTelnetOpt = true;
- toptVal = ch;
- // Read no more at this point, we have the start of a
- // telnet option.
- break;
- } else {
- buffer[len++] = (byte)ch;
- }
- } else {
- buffer[len++] = (byte)ch;
- }
- }
- // Recursive call to ensure we at least have either the end of stream
- // or one byte to read when this method exits.
- if(len == 0) fillBuffer();
- }
-
- public int read() throws IOException {
- if(len == 0) {
- fillBuffer();
- }
- if(len == -1) {
- return -1;
- }
- len--;
- return buffer[off++] & 0xff;
- }
-
- public int read(byte[] b) throws IOException {
- return read(b,0,b.length);
- }
-
- public int read(byte[] b, int bOff, int bLen) throws IOException {
- if(len == 0) {
- fillBuffer();
- }
- if(len == -1) {
- return -1;
- }
- if(len>bLen) {
- System.arraycopy(buffer,off,b,bOff,bLen);
- len -= bLen;
- off += bLen;
- } else {
- System.arraycopy(buffer,off,b,bOff,len);
- bLen = len;
- len = 0;
- }
- return bLen;
- }
-
- public int available() throws IOException {
- return len;
- }
-
- public void close() throws IOException {
- in.close();
- }
-
- protected abstract void parseTelnetOption(TelnetOption topt)
- throws IOException;
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/TelnetNegotiation.java b/mudclient/src/java/org/cyberiantiger/telnet/TelnetNegotiation.java
deleted file mode 100644
index 927d4b3a..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/TelnetNegotiation.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.cyberiantiger.telnet;
-
-public class TelnetNegotiation extends AbstractTelnetSubOption {
-
- public TelnetNegotiation(int option, int suboption) {
- super(option, suboption);
- }
-
-}
diff --git a/mudclient/src/java/org/cyberiantiger/telnet/TelnetOption.java b/mudclient/src/java/org/cyberiantiger/telnet/TelnetOption.java
deleted file mode 100644
index f62e62d8..00000000
--- a/mudclient/src/java/org/cyberiantiger/telnet/TelnetOption.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.cyberiantiger.telnet;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-public interface TelnetOption extends BinaryData {
-
- /**
- * Top Level Telnet Stuff
- */
- public static final int SE = 240;
- public static final int NOP = 241;
- public static final int DM = 242;
- public static final int BRK = 243;
- public static final int IP = 244;
- public static final int AO = 245;
- public static final int AYT = 246;
- public static final int EC = 247;
- public static final int EL = 248;
- public static final int GA = 249;
- public static final int SB = 250;
- public static final int WILL = 251;
- public static final int WONT = 252;
- public static final int DO = 253;
- public static final int DONT = 254;
- public static final int IAC = 255;
-
- /**
- * Telnet Option Types
- */
- // TOPT_BIN Binary Transmission 0 Std Rec 856 27
- public static final int TOPT_BIN = 0;
- // TOPT_ECHO Echo 1 Std Rec 857 28
- public static final int TOPT_ECHO = 1;
- // TOPT_RECN Reconnection 2 Prop Ele ...
- public static final int TOPT_RECN = 2;
- // TOPT_SUPP Suppress Go Ahead 3 Std Rec 858 29
- public static final int TOPT_SUPP = 3;
- // TOPT_APRX Approx Message Size Negotiation 4 Prop Ele ...
- public static final int TOPT_APRX = 4;
- // TOPT_STAT Status 5 Std Rec 859 30
- public static final int TOPT_STAT = 5;
- // TOPT_TIM Timing Mark 6 Std Rec 860 31
- public static final int TOPT_TIM = 6;
- // TOPT_REM Remote Controlled Trans and Echo 7 Prop Ele 726
- public static final int TOPT_REM = 7;
- // TOPT_OLW Output Line Width 8 Prop Ele ...
- public static final int TOPT_OLW = 8;
- // TOPT_OPS Output Page Size 9 Prop Ele ...
- public static final int TOPT_OPS = 9;
- // TOPT_OCRD Output Carriage-Return Disposition 10 Hist Ele 652 *
- public static final int TOPT_OCRD = 10;
- // TOPT_OHT Output Horizontal Tabstops 11 Hist Ele 653 *
- public static final int TOPT_OHT = 11;
- // TOPT_OHTD Output Horizontal Tab Disposition 12 Hist Ele 654 *
- public static final int TOPT_OHTD = 12;
- // TOPT_OFD Output Formfeed Disposition 13 Hist Ele 655 *
- public static final int TOPT_OFD = 13;
- // TOPT_OVT Output Vertical Tabstops 14 Hist Ele 656 *
- public static final int TOPT_OVT = 14;
- // TOPT_OVTD Output Vertical Tab Disposition 15 Hist Ele 657 *
- public static final int TOPT_OVTD = 15;
- // TOPT_OLD Output Linefeed Disposition 16 Hist Ele 658 *
- public static final int TOPT_OLD = 16;
- // TOPT_EXT Extended ASCII 17 Prop Ele 698
- public static final int TOPT_EXT = 17;
- // TOPT_LOGO Logout 18 Prop Ele 727
- public static final int TOPT_LOGO = 18;
- // TOPT_BYTE Byte Macro 19 Prop Ele 735
- public static final int TOPT_BYTE = 19;
- // TOPT_DATA Data Entry Terminal 20 Prop Ele 1043
- public static final int TOPT_DATA = 20;
- // TOPT_SUP SUPDUP 21 Prop Ele 736
- public static final int TOPT_SUP = 21;
- // TOPT_SUPO SUPDUP Output 22 Prop Ele 749
- public static final int TOPT_SUPO = 22;
- // TOPT_SNDL Send Location 23 Prop Ele 779
- public static final int TOPT_SNDL = 23;
- // TOPT_TERM Terminal Type 24 Prop Ele 1091
- public static final int TOPT_TERM = 24;
- // TOPT_EOR End of Record 25 Prop Ele 885
- public static final int TOPT_EOR = 25;
- // TOPT_TACACS TACACS User Identification 26 Prop Ele 927
- public static final int TOPT_TACACS = 26;
- // TOPT_OM Output Marking 27 Prop Ele 933
- public static final int TOPT_OM = 27;
- // TOPT_TLN Terminal Location Number 28 Prop Ele 946
- public static final int TOPT_TLN = 28;
- // TOPT_3270 Telnet 3270 Regime 29 Prop Ele 1041
- public static final int TOPT_3270 = 29;
- // TOPT_X.3 X.3 PAD 30 Prop Ele 1053
- public static final int TOPT_X_3 = 30;
- // TOPT_NAWS Negotiate About Window Size 31 Prop Ele 1073
- public static final int TOPT_NAWS = 31;
- // TOPT_TS Terminal Speed 32 Prop Ele 1079
- public static final int TOPT_TS = 32;
- // TOPT_RFC Remote Flow Control 33 Prop Ele 1372
- public static final int TOPT_RFC = 33;
- // TOPT_LINE Linemode 34 Draft Ele 1184
- public static final int TOPT_LINE = 34;
- // TOPT_XDL X Display Location 35 Prop Ele 1096
- public static final int TOPT_XDL = 35;
- // TOPT_ENVIR Telnet Environment Option 36 Hist Not 1408
- //public static final int TOPT_ENVIR = 36;
- // TOPT_AUTH Telnet Authentication Option 37 Exp Ele 1416
- public static final int TOPT_AUTH = 37;
- // TOPT_ENVIR Telnet Environment Option 39 Prop Ele 1572
- public static final int TOPT_ENVIR = 39;
- // TOPT_TN3270E TN3270 Enhancements 40 Draft Ele 2355 *
- public static final int TOPT_TN3270E = 40;
- // TOPT_XAUTH Telnet XAUTH 41 Exp
- public static final int TOPT_XAUTH = 41;
- // TOPT_CHARSET Telnet CHARSET 42 Exp 2066
- public static final int TOPT_CHARSET = 42;
- // TOPT_RSP Telnet Remote Serial Port 43 Exp
- public static final int TOPT_RSP = 43;
- // TOPT_COMPORT Telnet Com Port Control 44 Exp 2217
- public static final int TOPT_COMPORT = 44;
- // TOPT_SLE Telnet Suppress Local Echo 45 Exp *
- public static final int TOPT_SLE = 45;
- // TOPT_STARTTLS Telnet Start TLS 46 Exp *
- public static final int TOPT_STARTTLS = 46;
- // TOPT_KERMIT Telnet KERMIT 47 Exp *
- public static final int TOPT_KERMIT = 47;
- // TOPT_SEND-URL Send-URL 48 Exp *
- public static final int TOPT_SEND_URL = 48;
- // TOPT_EXTOP Extended-Options-List 255 Std Rec 861 32
- public static final int TOPT_EXTOP = 255;
-
- // First Byte in Subnegotation: IAC SB
I get "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial".
-
You do not have a jndi.properties file in your classpath, or your jndi.properties lacks a java.naming.factory.initial property.
-
I get a ClassCastException with java.util.Properties.
-
Most likely you are trying to get a DataSource but you have forgotten to include org.osjava.jndi.datasource=true.
-
I get an SQLException of 'No suitable driver'.
-
Your driver's jar is not in the classpath.
-
I get InvalidNameException of [key] not found.
-
You have not specified the org.osjava.jndi.root correctly in your jndi.properties.
-Simple-JNDI is intended to solve two problems. The first is that of finding a container independent way of opening a database connection, the second is to find a good way of specifying application configurations.
-
-
-In a J2EE container, you can use JNDI as a java.sql.Connection factory. This code however is not usable outside of a J2EE container as you cannot guarrentee you have a JNDI implementation available, and to be honest, you don't want to start some other server to make your simple script run. Simple-JNDI is not a server, it is merely an API, however it looks exactly the same as the JNDI client code used in a J2EE container.
-
-
-Applications need configuration. A servlets container uses the web.xml files to configure, while a J2EE container uses a different system, for example, JBoss has a jboss.jcml configuration file which sets a system up via JMX managed beans. An application could however use Simple-JNDI for parameter values.
-
-
-
-
-Using Simple-JNDI is the same as using JNDI itself. So this is not covered here, however the examples do give the basic gist.
-
-
-
-
-Installing Simple-JNDI is as simple as adding the simple-jndi jar, genjava-core jar, jdbc 2.0 jar and the commons-lang jar to your classpath.
-
-
-
-
-This is where all the work goes in a Simple-JNDI installation. Firstly you need a jndi.properties file, which somehow needs to go into your classpath. This jndi.properties needs one manadatory value:
-
-This property is a part of the jndi specification, java.naming.factory.initial. This should be set equal to org.osjava.jndi.PropertiesFactory.
-
-
-There are two optional, simple-jndi specific parameters.
-The first, org.osjava.jndi.root, is the location of your simple-jndi root, which is the location in which simple-jndi looks for values when code asks for them. The following code block details a few examples with explanatory comments.
-
-
-# absolute directory, using the default file protocol
-org.osjava.jndi.root=/home/hen/gj/simple-jndi/config/
-
-# relative directory, using the default file protocol
-org.osjava.jndi.root=config/
-
-# specified file protocol with an absolute directory
-org.osjava.jndi.root=file:///home/hen/gj/simple-jndi/config/
-
-# specified file protocol with a relative directory
-org.osjava.jndi.root=file://config/
-
-# classpath protocol with a package 'config'
-org.osjava.jndi.root=classpath://config
-
-
-If no org.osjava.jndi.root is specified, then a classpath root is chosen, with no package.
-
-
-The second optional parameter is the delimiter used to separate elements in a lookup value. This allows code to get closer to pretending to be another JNDI implementation, such as DNS or LDAP.
-
-# DNS/Java like delimiters
-org.osjava.jndi.delimiter=.
-
-# LDAP/XPath like delimiters
-org.osjava.jndi.delimiter=/
-
-
-If no org.osjava.jndi.delimiter is specified, then a '.' (dot) is chosen.
-
Version 0.6 has been released, as of 2003-08-12. The following features were added:
-
-
You may now see and modify the Simple-JNDI parameters through Simple-JNDI.
-
Because Windows cannot handle ':' in a filename, "java:" is quietly converted to "java".
-
Unit Tests written and plugged into Maven.
-
-
-
Version 0.5 has been released, as of 2003-04-08. The biggest change was in the move from the 'com.generationjava' namespace to the 'org.osjava' namespace, and an accompanying change in look and feel to the site. However, the following features were also added:
-
-
Boolean and URL Converters added.
-
Values in the System properties [ie) -Dfoo.bar=baa] now override simple-jndi.
-
Values may now be bound to the JNDI space, where they override the configured simple-jndi properties. When removed, the value goes back to the simple-jndi default.
-
-
-
Version 0.4 has been released, as of 2003-02-27. The following features were added:
-
-
com.foo.Value can have a partner key of com.foo.Value.type which specifies the type of object to use for the key. While this system will be pluggable, currently it supports java.lang.Number only.
-
Any XML format may be used underneath instead of a .properties system. Properties files take precedence over XML files, so in the light of foo.xml and foo.properties, only foo.properties will be read.
-
The underlying properties parsing has been improved. It now handles ordered collections. These are implemented by specifying a key multiple times. One issue with this is that the object returned maybe a List or a String [or something else depending on type], leading to an ugly instanceof style of programming. The following eases this.
-
org.osjava.naming.Jndi is a wrapper which automatically grabs the default InitialContext and provides simple helper routines for getting data out. One such example is getList(String key) which improves the situation in the previous bullet point.
-
-
-
-
Version 0.3 has been released, as of 2003-02-14. The following features were added:
-
-
Implemented a protocol system for the simple-jndi root's location. The original file location was retrofitted into this and a classpath location was added. A http location is planned
-
If a protocol is unspecified, then resort to v0.2 format, ie) file://
-
If root is unspecified, then use the classpath
-
The delimiter in the search values is configurable, so people can more easily mimic LDAP
Allow the delimiter in the search values to be configurable, so people can more easily mimic LDAP etc: DONE v0.3
-
If root is unspecified, then use the classpath: DONE v0.3
-
Allow the root to be a classpath root, ie) org.osjava: DONE v0.3
-
-0.3 released-
-
Use OrderedProperties to order the underlying .properties files. DONE v0.4
-
Types. com.foo.Value can have a partner key of com.foo.Value.type which specifies the type of object to use for the key. DONE v0.4
-
Add multiple-line format for .properties files. ie) if there are equal keys, they should create a collection. Note, with the OrderedProperties this becomes a list and not a collection. DONE v0.4
-
XML underneath as well as .properties: DONE v0.4
-
-0.4 released-
-
Allow converters to be configured/plugged in somehow. Add new converters. [URL/Boolean converters added in v0.5]
-
Allow users to bind their own variables on top of the properties. DONE v0.5. This would only be for a single instance of the context, though the factory could return the same instance every time.
-
Place the System properties before the simple-jndi layer so that -D may override it. DONE v0.5.
-
-0.5 released-
-
Simple-JNDI parameters may now be read through simple-jndi. DONE v0.6
-
Test if ProductionDS.org.osjava.jndi.datasource is obtainable [from examples page] DONE. v0.6: Confirmed
-
Handle java:/ on a Windows platform. Filenames are unable to contain colons. DONE. v0.6: java: resolves to java on all platforms
-
Write maven.xml to do the test-config copy to target/test-classes. DONE. v0.6: Changed project.xml to handle this.
-
Put the standard configuration options into the JNDI scope itself and pay attention for when they are changed. Thus allowing the system to change at runtime. DONE. v0.6
-
-0.6 released-
-
Implement Type in such a way that the object to create may be specified, say JDOPersistenceFactory, and that sub-properties may be set as bean properties.
-
Implement binding so that values may be stored in the system, making it Read/Write.
-
Implementing the list methods so you can see the values in a particular directory/properties file.
-
Searches. Consider implementing DirContext.
-
Switch to using Names in the system, with the String argument being turned to a Name based on delimiters specified in the jndi.properties. Allow more than one delimiter.
-
Other DataSource like things? JDO?
-
Allow the root to be a url, so properties can be found online
-
Hook up DBCP or some other connection pool.
-
Make it nice to hook up Enhanced drivers from DbUtils??
-
Confirm that jars and zips may be used in the classpath protocol.
-
Add a jdbc implementation underneath for the configuration.
-
Allow the underlying Properties class to use [when applicable] to be specified.
-
multiple domains. ie) Configure org.osjava to use .properties over http, and org.osjava to use xml over classpath.
-
Implement a Name class which finds the lookup key separator and injects that inside the name values [a string array]
-
When a value is unbound, don't return to the default but instead make it so it throws an exception when you try to obtain that value [unless bound again].
-
Allow a map-delimiter so that something like bob.foo.thing#bah=fred uses bah as the key, and fred as the value.
-
Is there a way to specify the type of a List or Map, or must ArrayList and HashMap always be used?
-
Create a Config class. Base it on previous written ones. Allow it to have a context stack, basic conversion methods and a root context concept [starts with a '.', or whatever that value is].
-
Write a simple-jndi server/client setup. Maybe use beep4j
-
Enable BlahDS.url so you can see the url of a datasource. Block passwords.
-
Implement DataSource creation as a part of the converter.
-
Test DataSources in various situations. Given a lookup of java:/TestDS and a delimiter of /, a directory of java: and a file of TestDS.properties, it appears to still look for TestDS/url and not url. Basically the PropertiesDataSource is buggy in its lookup.
-
Static back end to the binding, so that different contexts can share values.