|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gradeview.util.Misc
A set of miscellaneous, non-class specific functions which are used
throughout GradeView. Note, an object of type Misc should never be
created. All of Misc's functions/methods are static, meaning that they
can be called upon directly. For example, if we wanted to print the
contents of a HashMap
using Misc's
printHashMap()
function, we could use the
following code:
// myHashMap is a predefined instance of java.util.HashMap.
Misc.printHashMap( myHashMap );
Constructor Summary | |
Misc()
|
Method Summary | |
static java.util.HashMap |
buildHashMap(java.lang.String parseMe)
Builds a new HashMap based on the contents of
a given string. |
static javax.swing.JPanel |
makePanel()
Makes a JPanel according to GradeView defaults (i.e., foreground color, background color, etc. |
static javax.swing.JLabel |
makeSmallLabel(java.lang.String withString)
Creates a JLabel in a small font and a
GradeView-default color. |
static javax.swing.JLabel |
makeSmallLabel(java.lang.String withString,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Creates a JLabel in a small font. |
static void |
printHashMap(java.util.HashMap printMe)
Prints the contents of a HashMap to the
system console. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Misc()
Method Detail |
public static javax.swing.JLabel makeSmallLabel(java.lang.String withString)
JLabel
in a small font and a
GradeView-default color.withString
- The new label's textual contents.makeSmallLabel(String, GridBagLayout, GridBagConstraints)
public static javax.swing.JLabel makeSmallLabel(java.lang.String withString, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
JLabel
in a small font. It will
then call a GridBagLayout's
setConstraints()
method with the new JLabel and the specified GridBagConstraints.withString
- The new label's textual contents.gridbag
- The GridBagLayout to call setConstraints() on.c
- The GridBagConstraints that will be passed to
gridbag.setConstraints(), along with the new label.makeSmallLabel(String)
,
GridBagLayout
,
GridBagConstraints
public static javax.swing.JPanel makePanel()
public static java.util.HashMap buildHashMap(java.lang.String parseMe)
HashMap
based on the contents of
a given string. The string is parsed as such; Each entry in the HashMap
is separated by a comma (,) and each pair is separated by a single
equal sign (=). For example:
HashMap myHashMap = Misc.buildHashMap( "first=one,second=two,third=three" );
This code would build a hashmap with the following keys and values:
parseMe
- The string to be parsed/converted into a HashMap.HashMap
public static void printHashMap(java.util.HashMap printMe)
HashMap
to the
system console.printMe
- The HashMap whose contents should be printed to the
system console.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |