summaryrefslogtreecommitdiff
path: root/src/ext/plantuml/com/ctreber/aclib
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/plantuml/com/ctreber/aclib')
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java38
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java13
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java74
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java86
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java74
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOString.java36
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java44
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java20
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java19
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java96
10 files changed, 0 insertions, 500 deletions
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java
deleted file mode 100644
index 814b927..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-/**
- * <p></p>
- *
- * <p>&copy; 2002 Christian Treber, ct@ctreber.com</p>
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class MOBoolean extends MonitoredObject
-{
- private boolean fBoolean;
-
- public MOBoolean()
- {
- }
-
- public MOBoolean(boolean pBoolean)
- {
- fBoolean = pBoolean;
- }
-
- public void set(boolean pValue)
- {
- fBoolean = pValue;
- fireValueChanged();
- }
-
- public boolean get()
- {
- return fBoolean;
- }
-
- public boolean checkRange()
- {
- return true;
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java
deleted file mode 100644
index 2941637..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-/**
- * <p>Implemented by classes interetested in MonitoredObject values changes.</p>
- *
- * <p>&copy; 2002 Christian Treber, ct@ctreber.com</p>
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public interface MOChangeListener
-{
- public void valueChanged(MonitoredObject pObject);
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java b/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java
deleted file mode 100644
index 722a5db..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-/**
- * <p></p>
- *
- * <p>&copy; 2002 Christian Treber, ct@ctreber.com</p>
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class MODouble extends MonitoredObject
-{
- private double fDouble;
- private boolean fCheckRange = false;
- private double fMin;
- private double fMax;
-
- public MODouble()
- {
- }
-
- public MODouble(double pDouble)
- {
- fDouble = pDouble;
- }
-
- public MODouble(double pDouble, double pMin, double pMax)
- {
- fMin = pMin;
- fMax = pMax;
- fCheckRange = true;
- set(pDouble);
- }
-
- public void set(double pDouble)
- {
- if(!checkRange(pDouble))
- {
- throw new IllegalArgumentException("Argument '" + pDouble +
- "' out of range [" + niceFormat(fMin) + "; " + niceFormat(fMax) + "]");
- }
- fDouble = pDouble;
- fireValueChanged();
- }
-
- private static String niceFormat(double pDouble)
- {
- if(pDouble == Double.MAX_VALUE)
- {
- return "Infinity";
- }
-
- if(pDouble == Double.MIN_VALUE)
- {
- return "-Infinity";
- }
-
- return Double.toString(pDouble);
- }
-
- public double get()
- {
- return fDouble;
- }
-
- private boolean checkRange(double pDouble)
- {
- return !fCheckRange || (fMin <= pDouble) && (pDouble <= fMax);
- }
-
- public boolean checkRange()
- {
- return checkRange(fDouble);
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java
deleted file mode 100644
index f2b3cbf..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-import java.util.HashSet;
-
-/**
- * <p>
- * Monitored enumeration value.
- * </p>
- *
- * <p>
- * &copy; 2002 Christian Treber, ct@ctreber.com
- * </p>
- *
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class MOEnum extends MonitoredObject {
- private HashSet fValidValues = new HashSet();
- /**
- * <p>
- * null if no value selected
- */
- private Object fValue;
-
- public void addValidValue(Object pValue) {
- fValidValues.add(pValue);
- }
-
- public void set(Object pValue) {
- if (pValue != null) {
- checkValue(pValue);
- }
-
- fValue = pValue;
- fireValueChanged();
- }
-
- public Object get() {
- return fValue;
- }
-
- public boolean is(Object pObject) {
- checkValue(pObject);
-
- return this.equals(pObject);
- }
-
- public int hashCode() {
- if (fValue == null) {
- return 0;
- }
-
- return fValue.hashCode();
- }
-
- private void checkValue(Object pValue) {
- if (!fValidValues.contains(pValue)) {
- throw new IllegalArgumentException("Illegal enum value '" + pValue + "'");
- }
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof MOEnum) {
- MOEnum lOther = (MOEnum) obj;
- if (fValue == null) {
- return lOther.fValue == null;
- }
-
- return fValue.equals(lOther.fValue);
- }
-
- if (fValue == null) {
- return obj.equals(null);
- }
-
- return fValue.equals(obj);
- }
-
- public HashSet getValidValues() {
- return fValidValues;
- }
-
- public boolean checkRange() {
- return true;
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java
deleted file mode 100644
index 0816615..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-/**
- * <p></p>
- *
- * <p>&copy; 2002 Christian Treber, ct@ctreber.com</p>
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class MOInteger extends MonitoredObject
-{
- private int fInteger;
- private boolean fCheckRange = false;
- private int fMin;
- private int fMax;
-
- public MOInteger()
- {
- }
-
- public MOInteger(int pInteger)
- {
- fInteger = pInteger;
- }
-
- public MOInteger(int pInteger, int pMin, int pMax)
- {
- fMin = pMin;
- fMax = pMax;
- fCheckRange = true;
- set(pInteger);
- }
-
- public void set(int pInteger)
- {
- if(!checkRange(pInteger))
- {
- throw new IllegalArgumentException("Argument '" + pInteger +
- "' out of range [" + niceFormat(fMin) + "; " + niceFormat(fMax) + "]");
- }
- fInteger = pInteger;
- fireValueChanged();
- }
-
- private static String niceFormat(int pInteger)
- {
- if(pInteger == Integer.MAX_VALUE)
- {
- return "Infinity";
- }
-
- if(pInteger == Integer.MIN_VALUE)
- {
- return "-Infinity";
- }
-
- return Integer.toString(pInteger);
- }
-
- public int get()
- {
- return fInteger;
- }
-
- private boolean checkRange(int pInteger)
- {
- return !fCheckRange || (fMin <= pInteger) && (pInteger <= fMax);
- }
-
- public boolean checkRange()
- {
- return checkRange(fInteger);
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java
deleted file mode 100644
index dc1f92e..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-
-
-/**
- * <p></p>
- *
- * <p>&copy; 2002 Christian Treber, ct@ctreber.com</p>
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class MOString extends MonitoredObject
-{
- private String fString;
-
- public MOString(String pString)
- {
- fString = pString;
- }
-
- public void set(String pString)
- {
- fString = pString;
- fireValueChanged();
- }
-
- public String get()
- {
- return fString;
- }
-
- public boolean checkRange()
- {
- return true;
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java b/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java
deleted file mode 100644
index 8bb4824..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.gui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * <p>
- * </p>
- *
- * <p>
- * &copy; 2002 Christian Treber, ct@ctreber.com
- * </p>
- *
- * @author Christian Treber, ct@ctreber.com
- *
- */
-abstract public class MonitoredObject {
- private List fListeners = new ArrayList();
-
- public void addChangeListener(MOChangeListener pListener) {
- fListeners.add(pListener);
- }
-
- public void removeChangeListener(MOChangeListener pListener) {
- fListeners.remove(pListener);
- }
-
- void fireValueChanged() {
- final Iterator lIt = fListeners.iterator();
- while (lIt.hasNext()) {
- MOChangeListener lListener = (MOChangeListener) lIt.next();
- lListener.valueChanged(this);
- }
- }
-
- /**
- * <p>
- * Check value agains (possibly defined) constraints.
- *
- * @return True if value is within range or range is not checked.
- */
- abstract public boolean checkRange();
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java
deleted file mode 100644
index 4e9950b..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.sort;
-
-import java.util.Comparator;
-
-/**
- * <p>Teehee - found that Comparator allready exists.
- *
- * &copy; 2002 Christian Treber, ct@ctreber.com
- * @author Christian Treber, ct@ctreber.com
- *
- */
-abstract public class CTSort
-{
- public void sort(Object[] items)
- {
- sort(items, new DefaultComparator());
- }
-
- abstract public void sort(Object[] items, Comparator comparator);
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java b/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java
deleted file mode 100644
index b183e41..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.sort;
-
-import java.util.Comparator;
-
-/**
- * <p>Implements a default Comparator based on Comparable and a ascending
- * sort order. Requires that the two objects are Comparable.
- *
- * &copy; 2002 Christian Treber, ct@ctreber.com
- * @author Christian Treber, ct@ctreber.com
- *
- */
-public class DefaultComparator implements Comparator
-{
- public int compare(Object o1, Object o2)
- {
- return ((Comparable)o1).compareTo(o2);
- }
-}
diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java
deleted file mode 100644
index a0922db..0000000
--- a/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package ext.plantuml.com.ctreber.aclib.sort;
-
-import java.util.Comparator;
-
-/**
- * &copy; 2001 Christian Treber, ct@ctreber.com
- * @author Christian Treber, ct@ctreber.com
- */
-public class QuickSort extends CTSort
-{
- public void sort(Object[] items, Comparator comparator)
- {
- if(items.length <= 1)
- {
- // Nothing to sort t all or only one element.
- return;
- }
-
- qsort(items, comparator, 0, items.length - 1);
- insertionSort(items, comparator, 0, items.length - 1);
- }
-
- private void qsort(Object[] items, Comparator comparator, int l, int r)
- {
- final int M = 4;
- int i;
- int j;
- Object v;
-
- if((r - l) > M)
- {
- i = (r + l) / 2;
- if(comparator.compare(items[l], items[i]) > 0)
- {
- swap(items, l, i);
- }
- if(comparator.compare(items[l], items[r]) > 0)
- {
- swap(items, l, r);
- }
- if(comparator.compare(items[i], items[r]) > 0)
- {
- swap(items, i, r);
- }
-
- j = r - 1;
- swap(items, i, j);
- i = l;
- v = items[j];
- while(true)
- {
- while(comparator.compare(items[++i], v) < 0)
- {
- }
- while(comparator.compare(items[--j], v) > 0)
- {
- }
- if(j < i)
- {
- break;
- }
- swap(items, i, j);
- }
- swap(items, i, r - 1);
- qsort(items, comparator, l, j);
- qsort(items, comparator, i + 1, r);
- }
- }
-
- private static void swap(Object[] items, int i, int j)
- {
- final Object tmp;
- tmp = items[i];
- items[i] = items[j];
- items[j] = tmp;
- }
-
- private static void insertionSort(Object[] items, Comparator comparator, int lo0, int hi0)
- {
- int i;
- int j;
- Object v;
-
- for(i = lo0 + 1; i <= hi0; i++)
- {
- v = items[i];
- j = i;
- while((j > lo0) && (comparator.compare(items[j - 1], v) > 0))
- {
- items[j] = items[j - 1];
- j--;
- }
- items[j] = v;
- }
- }
-}