gui
Class Wrapper

java.lang.Object
  extended by gui.Wrapper

public class Wrapper
extends java.lang.Object

The Wrapper class provides convenience static methods for wrapping components and viewables in panels, scrollpanes, and title bordered panels. The methods all have variants that permit sizing of the wrapped component or wrapped viewable.


Method Summary
static WrapMethod createPaneledWrapMethod()
          This method is experimental - it may be of little use.
static WrapMethod createUnwrappedWrapMethod()
          This method is experimental - it may be of little use.
static javax.swing.JPanel named(javax.swing.JComponent c)
          Wrapper.named(c) returns a title bordered panel containing c.
static javax.swing.JPanel named(javax.swing.JComponent c, int w, int h)
          Wrapper.named(c, w, h) returns a sized title bordered panel containing c.
static javax.swing.JPanel named(NamedViewable nv)
          Wrapper.named(nv) returns a title bordered panel containing the view component of v.
static javax.swing.JPanel named(NamedViewable nv, int w, int h)
          Wrapper.named(nv, w, h) returns a sized title bordered panel containing the view component of v.
static javax.swing.JPanel named(Viewable v)
          Wrapper.named(v) returns a title bordered panel containing the view component of v.
static javax.swing.JPanel named(Viewable v, int w, int h)
          Wrapper.named(v, w, h) returns a sized title bordered panel containing the view component of v.
static javax.swing.JPanel paneled(javax.swing.JComponent c)
          Wrapper.paneled(c) returns a panel containing c.
static javax.swing.JPanel paneled(javax.swing.JComponent c, int w, int h)
          Wrapper.paneled(c, w, h) returns a sized panel containing c.
static javax.swing.JPanel paneled(Viewable v)
          Wrapper.paneled(v) returns a panel containing the view component of v.
static javax.swing.JPanel paneled(Viewable v, int w, int h)
          Wrapper.paneled(v, w, h) returns a sized panel containing the view component of v.
static javax.swing.JScrollPane scrolled(javax.swing.JComponent c)
          Wrapper.scrolled(c) returns a scroll pane containing the view component of c.
static javax.swing.JScrollPane scrolled(javax.swing.JComponent c, int w, int h)
          Wrapper.scrolled(c, w, h) returns a sized scroll pane containing c.
static javax.swing.JScrollPane scrolled(Viewable v)
          Wrapper.scrolled(v) returns a sized scroll pane containing the view component of v.
static javax.swing.JScrollPane scrolled(Viewable v, int w, int h)
          Wrapper.scrolled(v, w, h) returns a sized scroll pane containing the view component of v.
static javax.swing.JPanel titled(javax.swing.JComponent c, java.lang.String ttl)
          Wrapper.titled(c, ttl) returns a scroll pane containing c.
static javax.swing.JPanel titled(javax.swing.JComponent c, java.lang.String ttl, int w, int h)
          Wrapper.titled(c, ttl, w, h) returns a sized title bordered panel containing c.
static javax.swing.JPanel titled(Viewable v, java.lang.String ttl)
          Wrapper.titled(v, ttl) returns a title bordered panel containing the view component of v.
static javax.swing.JPanel titled(Viewable v, java.lang.String ttl, int w, int h)
          Wrapper.titled(v, ttl, w, h) returns a sized title bordered panel containing the view component of v.
static javax.swing.JComponent unwrapped(javax.swing.JComponent c)
          Wrapper.unwrapped(c) returns c as is.
static
<T extends javax.swing.JComponent>
T
unwrapped(T c, int w, int h)
          Wrapper.unwrapped(c, w, h) returns c with its minimum, preferred, and maximum sizes set to w by h.
static javax.swing.JComponent unwrapped(Viewable v)
          Wrapper.unwrapped(v) returns the view component of v as is.
static javax.swing.JComponent unwrapped(Viewable v, int w, int h)
          Wrapper.unwrapped(v, w, h) returns the view component of v with its minimum, preferred, and maximum sizes set to w by h.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unwrapped

public static javax.swing.JComponent unwrapped(javax.swing.JComponent c)
Wrapper.unwrapped(c) returns c as is.

Parameters:
c - the component
Returns:
the component c as is

unwrapped

public static <T extends javax.swing.JComponent> T unwrapped(T c,
                                                             int w,
                                                             int h)
Wrapper.unwrapped(c, w, h) returns c with its minimum, preferred, and maximum sizes set to w by h.

Parameters:
c - the component
w - the width of the returned component
h - the height of the returned component
Returns:
the sized component c

unwrapped

public static javax.swing.JComponent unwrapped(Viewable v)
Wrapper.unwrapped(v) returns the view component of v as is.

Parameters:
v - the viewable whose view component is to be returned
Returns:
the view component of v

unwrapped

public static javax.swing.JComponent unwrapped(Viewable v,
                                               int w,
                                               int h)
Wrapper.unwrapped(v, w, h) returns the view component of v with its minimum, preferred, and maximum sizes set to w by h.

Parameters:
v - the viewable whose view component is to be returned
w - the width of the returned component
h - the height of the returned component
Returns:
the sized view component of v

paneled

public static javax.swing.JPanel paneled(javax.swing.JComponent c)
Wrapper.paneled(c) returns a panel containing c.

Parameters:
c - the component to be wrapped
Returns:
a panel containing c

paneled

public static javax.swing.JPanel paneled(javax.swing.JComponent c,
                                         int w,
                                         int h)
Wrapper.paneled(c, w, h) returns a sized panel containing c. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
c - the component to be wrapped
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized panel containing c

paneled

public static javax.swing.JPanel paneled(Viewable v)
Wrapper.paneled(v) returns a panel containing the view component of v.

Parameters:
v - the viewable whose view component is to be wrapped
Returns:
a panel containing the view component of v

paneled

public static javax.swing.JPanel paneled(Viewable v,
                                         int w,
                                         int h)
Wrapper.paneled(v, w, h) returns a sized panel containing the view component of v. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
v - the viewable whose view component is to be wrapped
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized panel containing the view component of v

scrolled

public static javax.swing.JScrollPane scrolled(javax.swing.JComponent c)
Wrapper.scrolled(c) returns a scroll pane containing the view component of c.

Parameters:
c - the component to be scrolled
Returns:
a scroll pane containing c

scrolled

public static javax.swing.JScrollPane scrolled(javax.swing.JComponent c,
                                               int w,
                                               int h)
Wrapper.scrolled(c, w, h) returns a sized scroll pane containing c. The minimum, preferred, and maximum sizes of the scroll pane are set to w by h.

Parameters:
c - the component to be scrolled
w - the width of the returned scroll pane
h - the height of the returned scroll pane
Returns:
a sized scroll pane containing c

scrolled

public static javax.swing.JScrollPane scrolled(Viewable v)
Wrapper.scrolled(v) returns a sized scroll pane containing the view component of v. The minimum, preferred, and maximum sizes of the scroll pane are set to w by h.

Parameters:
v - the viewable whose view component is to be wrapped
Returns:
a sized scroll pane containing c

scrolled

public static javax.swing.JScrollPane scrolled(Viewable v,
                                               int w,
                                               int h)
Wrapper.scrolled(v, w, h) returns a sized scroll pane containing the view component of v. The minimum, preferred, and maximum sizes of the scroll pane are set to w by h.

Parameters:
v - the viewable whose view component is to be wrapped
w - the width of the returned scroll pane
h - the height of the returned scroll pane
Returns:
a scroll pane containing c

titled

public static javax.swing.JPanel titled(javax.swing.JComponent c,
                                        java.lang.String ttl)
Wrapper.titled(c, ttl) returns a scroll pane containing c. The border is titled with the title ttl.

Parameters:
c - the component to be wrapped
ttl - the panel border title
Returns:
a scroll pane containing c

titled

public static javax.swing.JPanel titled(javax.swing.JComponent c,
                                        java.lang.String ttl,
                                        int w,
                                        int h)
Wrapper.titled(c, ttl, w, h) returns a sized title bordered panel containing c. The border is titled with the title ttl. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
c - the component to be wrapped
ttl - the panel border title
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized title bordered panel containing c

titled

public static javax.swing.JPanel titled(Viewable v,
                                        java.lang.String ttl)
Wrapper.titled(v, ttl) returns a title bordered panel containing the view component of v. The border is titled with the title ttl.

Parameters:
v - the viewable whose view component is to be wrapped
ttl - the panel border title
Returns:
a title bordered panel containing c

titled

public static javax.swing.JPanel titled(Viewable v,
                                        java.lang.String ttl,
                                        int w,
                                        int h)
Wrapper.titled(v, ttl, w, h) returns a sized title bordered panel containing the view component of v. The border is titled with the title ttl. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
v - the viewable whose view component is to be wrapped
ttl - the panel border title
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized title bordered panel containing the view component of v

named

public static javax.swing.JPanel named(javax.swing.JComponent c)
Wrapper.named(c) returns a title bordered panel containing c. The border is titled with the name of c. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
c - the component to be wrapped
Returns:
a title bordered panel containing c

named

public static javax.swing.JPanel named(javax.swing.JComponent c,
                                       int w,
                                       int h)
Wrapper.named(c, w, h) returns a sized title bordered panel containing c. The border is titled with the name of c. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
c - the component to be wrapped
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized title bordered panel containing c

named

public static javax.swing.JPanel named(Viewable v)
Wrapper.named(v) returns a title bordered panel containing the view component of v. The border is titled with the name of v's view component.

Parameters:
v - the viewable whose view component is to be wrapped
Returns:
a title bordered panel containing c

named

public static javax.swing.JPanel named(Viewable v,
                                       int w,
                                       int h)
Wrapper.named(v, w, h) returns a sized title bordered panel containing the view component of v. The border is titled with the name of v's view component. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
v - the viewable whose view component is to be wrapped
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized title bordered panel containing the view component of v

named

public static javax.swing.JPanel named(NamedViewable nv)
Wrapper.named(nv) returns a title bordered panel containing the view component of v. The border is titled with the name of nv.

Parameters:
nv - the named viewable whose view component is to be wrapped
Returns:
a title bordered panel containing the view component of nv

named

public static javax.swing.JPanel named(NamedViewable nv,
                                       int w,
                                       int h)
Wrapper.named(nv, w, h) returns a sized title bordered panel containing the view component of v. The border is titled with the name of nv. The minimum, preferred, and maximum sizes of the panel are set to w by h.

Parameters:
nv - the named viewable whose view component is to be wrapped
w - the width of the returned panel
h - the height of the returned panel
Returns:
a sized title bordered panel containing the view component of nv

createPaneledWrapMethod

public static WrapMethod createPaneledWrapMethod()
This method is experimental - it may be of little use.


createUnwrappedWrapMethod

public static WrapMethod createUnwrappedWrapMethod()
This method is experimental - it may be of little use.