All Methods
zio package

context

zio
Class ZComponent

java.lang.Object
  extended byzio.ZObject
      extended byzio.ZComponent

public class ZComponent
extends ZObject

Converts JComponents to ZObjects. If you want to use a Swing object that is not (yet) available in these classes, you can still use it by wrapping a ZComponent object around it.


Constructor Summary
ZComponent(javax.swing.JComponent c)
          Creates a ZObject corresponding to a JComponent.
 
Method Summary
 ZComponent background(java.awt.Color c)
          Suffix that determines the background color of the JComponent.
 ZComponent debug(java.lang.String debugId)
          Suffix that creates debug output.
 ZComponent expandH()
          Suffix that enables the JComponent to be stretched in the horizontal direction.
 ZComponent expandV()
          Suffix that enables the JComponent to be stretched in the vertical direction.
 ZComponent foreground(java.awt.Color c)
          Suffix that determines the foreground color of the JComponent area.
 ZComponent framed(int margin)
          Suffix that creates an etched frame around the ZComponent.
 javax.swing.JComponent getJComponent()
          Method for obtaining the JComponent.
 ZComponent size(java.awt.Dimension desiredSize)
          Suffix that overrides Swing's notion of what the JComponent's minimum/preferred should be.
 ZComponent unframed(int margin)
          Suffix that creates the margin used with a frame without creating the frame.
 
Methods inherited from class zio.ZObject
getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZComponent

public ZComponent(javax.swing.JComponent c)
Creates a ZObject corresponding to a JComponent. Do NOT use this for a JComponent obtained with with getContentPane (or any other Swing method that gives you a Component which belongs to another Component).

Parameters:
c - the JComponent to be brought into the zio system
Method Detail

debug

public final ZComponent debug(java.lang.String debugId)
Suffix that creates debug output.

Parameters:
debugId - a string to identify this component in the debug output

size

public final ZComponent size(java.awt.Dimension desiredSize)
Suffix that overrides Swing's notion of what the JComponent's minimum/preferred should be. It is very common for this suffix to be needed as Swing often does not set a minimum size.

Parameters:
desiredSize - the desired size

expandV

public final ZComponent expandV()
Suffix that enables the JComponent to be stretched in the vertical direction.


expandH

public final ZComponent expandH()
Suffix that enables the JComponent to be stretched in the horizontal direction.


foreground

public final ZComponent foreground(java.awt.Color c)
Suffix that determines the foreground color of the JComponent area.

Parameters:
c - the desired foreground color

background

public final ZComponent background(java.awt.Color c)
Suffix that determines the background color of the JComponent.

Parameters:
c - the desired background color

framed

public ZComponent framed(int margin)
Suffix that creates an etched frame around the ZComponent. Do not use with unframed() suffix.

Parameters:
margin - size of margin between ZComponent and frame

unframed

public ZComponent unframed(int margin)
Suffix that creates the margin used with a frame without creating the frame. Do not use with framed() suffix.

Parameters:
margin - size of margin around the ZComponent

getJComponent

public javax.swing.JComponent getJComponent()
Method for obtaining the JComponent.

Returns:
the JComponent this ZComponent is associated with

author
context