mae.sss
Class Menu

java.lang.Object
  extended bymae.sss.Menu

public class Menu
extends java.lang.Object

Adds various static methods to SSS


Method Summary
static java.lang.Class chooser()
          (Chooser actions -- see Chooser)
static java.lang.Class help()
          Starts a Teacher session
static void println(java.lang.Object x)
          Prints the object into system output
static boolean save(java.lang.String txt)
          Saves a String into a text file
static java.lang.Object[] sort(java.lang.Object[] a)
          Sort the array in ascending order.
static java.lang.Class teacher()
          Starts a Teacher session from a File
static java.lang.Object[] toArray(java.util.Enumeration e)
          Shows the contents of an Enumeration as an array of Objects
static java.lang.Object[] toArray(java.util.Iterator e)
          Shows the contents of an Iterator as an array of Objects
static java.awt.Frame toFrame(java.awt.Component c)
          If the Component is already on a Frame, returns it.
static java.lang.String toString(java.io.File f)
          Reads a text file into a String
static java.lang.String toString(java.io.InputStream in)
          Reads an InputStream into a String.
static java.awt.Component[] toTree(java.awt.Container c)
          Shows the containment hierarchy of Container c (possibly JComponent).
static java.lang.Object[] toTree(java.io.File f)
          Shows the contents of a directory, or a zip/jar file.
static javax.swing.tree.TreeNode[] toTree(javax.swing.tree.TreeNode n)
          Shows the contents of a TreeNode; returns an array of nodes
static java.lang.Class version()
          Shows SSS version (splash screen)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

chooser

public static java.lang.Class chooser()
                               throws java.lang.ClassNotFoundException
(Chooser actions -- see Chooser)

Throws:
java.lang.ClassNotFoundException

println

public static void println(java.lang.Object x)
Prints the object into system output


sort

public static java.lang.Object[] sort(java.lang.Object[] a)
Sort the array in ascending order. Objects need not be Comparable, they are sorted as Strings


help

public static java.lang.Class help()
Starts a Teacher session


teacher

public static java.lang.Class teacher()
Starts a Teacher session from a File


toString

public static java.lang.String toString(java.io.File f)
                                 throws java.io.IOException
Reads a text file into a String

Throws:
java.io.IOException

toString

public static java.lang.String toString(java.io.InputStream in)
                                 throws java.io.IOException
Reads an InputStream into a String. Useful after URL.openStream() or Class.getResourceAsStream()

Throws:
java.io.IOException

save

public static boolean save(java.lang.String txt)
Saves a String into a text file


toArray

public static java.lang.Object[] toArray(java.util.Enumeration e)
Shows the contents of an Enumeration as an array of Objects


toArray

public static java.lang.Object[] toArray(java.util.Iterator e)
Shows the contents of an Iterator as an array of Objects


toTree

public static java.lang.Object[] toTree(java.io.File f)
                                 throws java.io.IOException
Shows the contents of a directory, or a zip/jar file.

If f is a zip/jar archive, its contents are displayed.
Otherwise contents of the containing folder are displayed.
Returns a File array or a ZipEntry array.

Throws:
java.io.IOException

toTree

public static javax.swing.tree.TreeNode[] toTree(javax.swing.tree.TreeNode n)
Shows the contents of a TreeNode; returns an array of nodes


toTree

public static java.awt.Component[] toTree(java.awt.Container c)
Shows the containment hierarchy of Container c (possibly JComponent).

Returns an array of Components within c.


toFrame

public static java.awt.Frame toFrame(java.awt.Component c)
If the Component is already on a Frame, returns it.
 Otherwise, adds it into a new Jframe
 If it is an Applet, invokes init() and start()
 Invokes pack() and show() on the new JFrame
 


version

public static java.lang.Class version()
Shows SSS version (splash screen)