public final class GraphicsUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.awt.Window |
basicGUIMain(java.awt.Component c,
boolean dialog)
Defaults title to null.
|
static java.awt.Window |
basicGUIMain(java.awt.Component c,
boolean dialog,
java.lang.String title)
a basic main for testing a graphical class.
|
static void |
centerWindow(java.awt.Window window)
Centers the window on the screen.
|
static void |
drawPolygons(java.awt.Graphics g,
java.util.Collection<?> v)
draw a bunch of polygons
|
static void |
drawPolygons(java.awt.Graphics g,
java.util.Iterator<?> iter)
draw a bunch of polygons
|
static void |
drawPolyLine(java.awt.Graphics g,
java.util.Collection<?> points)
draw the points on the Graphics Context.
|
static void |
error(java.lang.String message)
Popup an error dialog with message in it.
|
static void |
fillPolygons(java.awt.Graphics g,
java.util.Collection<?> v)
fill a bunch of polygons
|
static void |
fillPolygons(java.awt.Graphics g,
java.util.Iterator<?> iter)
fill a bunch of polygons
|
static javax.swing.ImageIcon |
getIcon(java.lang.String path)
Create an icon from the resource at path.
|
static int |
getMaxWidth(javax.swing.JComboBox<java.lang.String> combo,
java.awt.FontMetrics fm) |
static void |
notImplemented(java.lang.String message)
Popup a warning dialog displaying message.
|
static void |
setVisibleRowCount(javax.swing.JTable table,
int rows)
Set the preferred viewport size on a table based upon the number of rows
that should be visible and the current heights of the rows.
|
public static java.awt.Window basicGUIMain(java.awt.Component c, boolean dialog)
basicGUIMain(Component, boolean, String)
public static java.awt.Window basicGUIMain(java.awt.Component c, boolean dialog, java.lang.String title)
c
- the component to displaydialog
- if true
put in a JDialog, otherwise put in a
JFrametitle
- the title for the windowpublic static void centerWindow(java.awt.Window window)
public static void drawPolyLine(java.awt.Graphics g, java.util.Collection<?> points)
g
- the graphics contextpoints
- a collection of points, anything other than a point in this
vector is simply skippedpublic static void drawPolygons(java.awt.Graphics g, java.util.Collection<?> v)
g
- the graphics contextv
- a Container of polygons, other classes are ignoredpublic static void drawPolygons(java.awt.Graphics g, java.util.Iterator<?> iter)
g
- the graphics contextiter
- an Enumeration of polygons, other classes are ignoredpublic static void fillPolygons(java.awt.Graphics g, java.util.Collection<?> v)
g
- the graphics contextv
- a Container of polygons, other classes are ignoredpublic static void fillPolygons(java.awt.Graphics g, java.util.Iterator<?> iter)
g
- the graphics contextiter
- an Enumeration of polygons, other classes are ignoredpublic static int getMaxWidth(javax.swing.JComboBox<java.lang.String> combo, java.awt.FontMetrics fm)
public static javax.swing.ImageIcon getIcon(java.lang.String path)
public static void notImplemented(java.lang.String message)
public static void error(java.lang.String message)
public static void setVisibleRowCount(javax.swing.JTable table, int rows)
table
- the tablerows
- number of rows to have visible without scrolling