فهرست منبع

Javadoc fixes

LH 10 سال پیش
والد
کامیت
a5b5524ff6

+ 6 - 9
ToolKit/build.gradle

@@ -1,21 +1,18 @@
 defaultTasks 'distZip'
 
 apply plugin: 'java'
-apply plugin: 'application'
-
 
 sourceCompatibility = 1.8
 version = 'SNAPSHOT'
-mainClassName = 'de.nplusc.izc.iZpl.Builder'
 
 
-jar{
-	manifest{
-		attributes 'Implementation-Title': 'iZToolKit',
-					'Implementation-Version': 'SNAPSHOT',
-					'Main-Class': 'de.nplusc.izc.iZpl.Builder'
-	}
+task distZip(dependsOn: 'jar') {
+	//NO-OPtask als redirect
 }
+distZip.inputs.file file(tasks.jar.archivePath)
+distZip.outputs.file file(tasks.jar.archivePath)
+
+
 
 dependencies{
 	compile fileTree(dir: 'lib', include: '*.jar')

+ 69 - 5
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/Detectors.java

@@ -10,13 +10,55 @@ import java.util.prefs.Preferences;
  */
 
 /**
- *
+ * Various detectuon routines
  * @author LH
  */
 public class Detectors
 {
     //@SuppressWarnings("empty-statement")
-
+    
+    
+    /**
+     * Detecs the OS Family and architecture
+     * @return {OSFamily,Architecture}
+     */
+    public static String[] getSystemClassification()
+    {
+        String operatingSystemInternal = System.getProperty("os.name");
+        String osname = "VOID";
+        String osarchinternal = System.getProperty("os.arch");
+        String osarch = "VOID";
+        switch(operatingSystemInternal)
+        {
+            case "Linux":
+                osname="Linux";
+                break;
+            case "Windows":
+                osname="Windows";
+                break;
+        }
+        switch(osarchinternal)
+        {
+            case "i386":
+            case "i486":
+            case "i586":
+            case "i686":
+            case "x86":
+                osarch= "x86";
+                break;
+            case "x86_64":
+            case "amd64":
+                osarch = "x64";
+                break;
+        }
+        return new String[]{osname,osarch};
+    }
+    
+    
+    /**
+     * Checks whether OS is windows 8
+     * @return True when win8 got detected
+     */
     public static boolean detectIsWin8()
     {
         boolean ret = false;
@@ -36,22 +78,40 @@ public class Detectors
         // return ret;
 
     }
-
+    
+    
+    /**
+     * Detecs if a 64bit windows7 got used
+     * @return true on 64bit win7 or win8
+     */
     public static boolean detect64bitWinon7and8()
     {
         return FileTK.checkDirExist("Program files (x86)");
     }
 
+    
+    /**
+     * Detects if PRogram runs on WIndows XPlode
+     * @return true if WinXP
+     */
     public static boolean detectWInXP()
     {
         return FileTK.checkDirExist("C:\\WINDOWS\\Help\\Tours");
     }
-
+    
+    /**
+     * Detects Existence of win7
+     * @return true on win7
+     */
     public static boolean detectWin7()
     {
         return FileTK.checkDirExist("C:\\Users") && !detectIsWin8();//Users gibts bei 7 und 8 deshalb die 2. bedingung
     }
-
+    
+    /**
+     * Detecs whether program runs as Admin on windows
+     * @return True when admin-rights are existing
+     */
     public static boolean detectisAdmin()
     {
         ////neuer dirty hack
@@ -92,4 +152,8 @@ public class Detectors
         }
         return false;*/
     }
+
+    private Detectors()
+    {
+    }
 }

+ 7 - 2
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/FIleLImiter.java

@@ -9,7 +9,7 @@ import java.io.File;
 import javax.swing.filechooser.FileFilter;
 
 /**
- *
+ * FileChooser utility to reduce available file extensions
  * @author LH
  */
 public class FIleLImiter extends FileFilter
@@ -53,7 +53,12 @@ public class FIleLImiter extends FileFilter
         }
         return ret +";";
     }
-
+    
+    
+    /**
+     * Sets the fileextensions that can be selected with the FileChooser that uses thhis FileLImiter
+     * @param exts Array of fileextensions to attach
+     */
     public void setExtensions(String[] exts)
     {
         availExts = exts;

+ 5 - 1
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/HLTools.java

@@ -7,7 +7,7 @@ package de.nplusc.izc.tools.baseTools;
 import java.util.prefs.Preferences;
 
 /**
- *
+ * Subset of tools a certain program used to avoid a dependency tree hell
  * @author LH
  */
 public class HLTools
@@ -46,4 +46,8 @@ public class HLTools
         }
         return out;
     }
+
+    private HLTools()
+    {
+    }
 }

+ 5 - 1
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/Messagers.java

@@ -32,7 +32,11 @@ public class Messagers
         //disabled Constructor
     }
 
-
+    /**
+     * Single LIne message Toolblox shorthand
+     * @param msg The single line of text
+     * @param ButtonTxt Button message
+     */
     public static void SingleLineMsg(String msg,String ButtonTxt)
     {
         JPanel p = new JPanel();

+ 49 - 4
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/RingBuffer.java

@@ -13,7 +13,7 @@ import java.util.LinkedList;
  */
 
 /**
- *
+ * Utility to provide a Ringbuffer with a fixed maximum size for arbitrary data
  * @author LH
  */
 public class RingBuffer<T>
@@ -141,30 +141,55 @@ public class RingBuffer<T>
     private LinkedList<T> l = new LinkedList<>();
     private boolean retDefault = false;
     
+    
+    /**
+     * Initializes a Ringbuffer of size 10 (default)
+     * @param clazz Class-type to define the type of some variables
+     */
     public RingBuffer(Class<T> clazz)
     {
         length=10;
         defaults = null;
     }
-        public RingBuffer(Class<T> clazz,T defaultValue)
+    /**
+     * Initializes the Ringbuffer to 10 and all variables prefilled with default value
+     * @param clazz Class-type to define the type of some variables
+     * @param defaultValue Prefill-Value
+     */
+    public RingBuffer(Class<T> clazz,T defaultValue)
     {
         length=10;
         defaults = defaultValue;
         retDefault=true;
     }
-    
+    /**
+     * Initializes Ringbuffer to arbitrary size with defaultvalue
+     * @param clazz Class-type to define the type of some variables
+     * @param length Size of the buffer
+     * @param  defaultValue Prefill-Value
+     */
     public RingBuffer(Class<T> clazz,int length,T defaultValue)
     {
         this.length=length;
         defaults = defaultValue;
         retDefault=true;
     }
-        public RingBuffer(Class<T> clazz,int length)
+    /**
+     * Initializes Ringbuffer to arbitrary size
+     * @param clazz Class-type to define the type of some variables
+     * @param length Size of the buffer
+     */
+    public RingBuffer(Class<T> clazz,int length)
     {
         this.length=length;
         defaults = null;
     }
     
+    /**
+     * gets the content at the given Index
+     * @param idx Index to obtain data from
+     * @return Data-element of buffer or null if invalid INdex used
+     */
     public T getContentAt(int idx)
     {
         T ret = null;
@@ -194,15 +219,29 @@ public class RingBuffer<T>
         }
         return ret;
     }
+    
+    /**
+     * gets the element at oldest position of the buffer
+     * @return the element thats at the lowest position
+     */
     public T getOldestElement()
     {
         return l.peekFirst();
     }
+    
+    /**
+     * gets the last added item
+     * @return item that got added last
+     */
     public T getNewestElement()
     {
         return l.peekLast();
     }
     
+    /**
+     * Adds item at end of buffer
+     * @param item Item to add
+     */
     public void addItem(T item)
     {
         try
@@ -222,6 +261,12 @@ public class RingBuffer<T>
             ex.printStackTrace();
         }
     }
+    
+    /**
+     * add item a given position
+     * @param item Item to add
+     * @param pos Inex to add the item at
+     */
     public void addItem(T item,int pos)
     {
         l.remove(pos);

+ 4 - 0
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/Svoujnf.java

@@ -4,6 +4,10 @@
  */
 package de.nplusc.izc.tools.baseTools;
 
+/**
+ * Dirty hack
+ * @author iZc <nplusc.de>
+ */
 class Svoujnf
 {
     //Runtime.

+ 107 - 9
ToolKit/src/main/java/de/nplusc/izc/tools/baseTools/Tools.java

@@ -58,6 +58,14 @@ public class Tools
         }
         
     }
+    
+    /**
+     * Method to pad the left of a Sting with given character
+     * @param count Destination amount of data
+     * @param base String to pad up
+     * @param filler Padding data
+     * @return Padded String
+     */
     public static String padLeft(final int count, final String base, final char filler)
     {
         if (base == null)
@@ -72,7 +80,12 @@ public class Tools
         Arrays.fill(prefix, filler);
         return new StringBuilder(count).append(prefix).append(base).toString();
     }
-
+    
+    
+    /**
+     * Method rename and shorthand for Thread.sleep()
+     * @param time Time to wait in ms
+     */
     public static void wait(int time)
     {
 
@@ -85,7 +98,12 @@ public class Tools
             ex.printStackTrace();
         }
     }
-
+    
+    /**
+     * SHA-Hashes a String
+     * @param s String to hash
+     * @return Hashed String
+     */
     public static String getSHAString(String s)
     {
         try
@@ -112,7 +130,13 @@ public class Tools
             return null;
         }
     }
-
+    
+    
+    /**
+     * Integerizes a String
+     * @param ip String to integerize
+     * @return Array of Integers where each int is a Character of the string
+     */
     public static int[] lettersToInt(String ip)
     {
         ip = ip.toLowerCase();
@@ -125,6 +149,11 @@ public class Tools
         return ri;
     }
 
+    /**
+     * Sum of the Elements of the Array
+     * @param i Integer-array to sumup
+     * @return Sum of the elements
+     */
     public static int addIntsTogether(int[] i)
     {
         int t = 1;
@@ -135,6 +164,14 @@ public class Tools
         return t;
     }
 
+    
+    @Deprecated
+    /**
+     * HACK!!!
+     * @param m unknown
+     * @param ints unknown
+     * @return unknown
+     */
     public static int addIntsTogether(HashMap<String, String> m, boolean ints)
     {
         //boolean ints = !noints;
@@ -168,6 +205,13 @@ public class Tools
         return t;
     }
 
+    @Deprecated
+    /**
+     * Adds the Strings together while respecting Alphabet and wraps . Dont use for new Code
+     * @param s1 String 1
+     * @param s2 String 2
+     * @return the merged Strings
+     */
     public static String stringAdd(String s1, String s2)
     {
         char[] ca1 = s1.toLowerCase().toCharArray();
@@ -235,7 +279,7 @@ public class Tools
 
         return backString(op);
     }
-
+    @Deprecated
     public static String backString(int[] ia)
     {
         int l = ia.length, i1;
@@ -259,7 +303,7 @@ public class Tools
 
         return rl;
     }
-
+    @Deprecated
     public static String stringFold(String s, int l, int rec)//halbiert Strings und addiert die Hälften
     {
         int l1 = s.length() / 2;//,l2;
@@ -281,16 +325,34 @@ public class Tools
         return so1;
     }
 
+    @Deprecated
     public static String stringFold(String s, int l)
     {
         return stringFold(s, l, 30);
     }
 
+    /**
+     * 2-Elemente-Meckermeldung
+     * @param mode ignored
+     * @param MSGLine1 Zeile 1 der Meldung
+     * @param MSGLine2 ZEile 2 der Meldung
+     * @return true if left button got pressed, false on right one
+     */
     public static boolean dlg(boolean mode, String MSGLine1, String MSGLine2)
     {
         return dlg(mode, MSGLine1, MSGLine2, "Fortfahren", "Abbrechen");
     }
 
+    
+    /**
+     * 2-Elemente-Meckermeldung
+     * @param mode ignored
+     * @param MSGLine1 Zeile 1 der Meldung
+     * @param MSGLine2 ZEile 2 der Meldung
+     * @param btnLeft MEssage of left button
+     * @param btnRight MEssage of Right button
+     * @return true if left button got pressed, false on right one
+     */
     public static boolean dlg(boolean mode, String MSGLine1, String MSGLine2, String btnLeft, String btnRight)
     {
         if(hl)
@@ -411,6 +473,10 @@ public class Tools
         return ContState;
     }
 
+    /**
+     * Wrapper to debugmessage code
+     * @param logLine Line to logg
+     */
     public static void log(final String logLine)
     {
         /*Thread t = new Thread(new Runnable() {
@@ -540,6 +606,10 @@ public class Tools
     
      */
     //</editor-fold>
+    /**
+     * COmmand run wrapper
+     * @param runnable Command elements
+     */
     public static void runSingleCmd(String... runnable)
     {
         runSingleCmd(true, runnable);
@@ -884,7 +954,13 @@ public class Tools
        return FileTK.getRelativePath(absolutePath, basePath);
     }
     
-    
+    /**
+     * Array shortening method
+     * @param toTrunc SArray to remove
+     * @param number Amount to remove
+     * @param fromBack True means remove from end, false means remove from start
+     * @return Shortened array
+     */
     @SuppressWarnings("ManualArrayToCollectionCopy")//Quick and Dirty Hack
     public static Object[] truncateArray(Object[] toTrunc, int number, boolean fromBack)
     {
@@ -912,11 +988,23 @@ public class Tools
         return out;
     }
 
+    
+    /**
+     * OPens a Input window for a line of text
+     * @param title Title of the window
+     * @return 
+     */
     public static String getInputString(String title)
     {
         return getInputString(title, false);
     }
-
+    
+    /**
+     * OPens a Input window for a line of text
+     * @param title Title of the window
+     * @param txArea WHether to use a MUltiline input or a singleline inout
+     * @return 
+     */
     public static String getInputString(String title, boolean txArea)
     {
         Object txfIP;//Hack!!!!
@@ -933,7 +1021,7 @@ public class Tools
                 null,
                 txfIP,
                 title,
-                JOptionPane.OK_OPTION);
+                JOptionPane.PLAIN_MESSAGE);
         String ret = "";
         if (txArea == true)
         {
@@ -946,6 +1034,11 @@ public class Tools
         return ret;
     }
 
+    /**
+     * Shorthand to write serialized data to a file
+     * @param o Object to dump
+     * @param p Destination file
+     */
     public static void saveSerializedObject(Object[] o, String p)
     {
         try
@@ -959,7 +1052,12 @@ public class Tools
             //NOP
         }
     }
-
+    
+    /**
+     * Shorthand to load serialized data
+     * @param p Path to load from
+     * @return Array with the objects dumped
+     */
     public static Object[] loadSerializedObject(String p)
     {
         try