jmce - 1_02

jmce.swing
Class Util

java.lang.Object
  extended by jmce.swing.Util

public class Util
extends java.lang.Object

Swing utility class.

Version:
1.02
Author:
Mario Viara

Field Summary
static java.awt.Font fontLabel
           
static java.awt.Font fontTitle
           
 
Constructor Summary
Util()
           
 
Method Summary
static javax.swing.Icon getIcon(java.lang.Class parent, java.lang.String name)
           
static javax.swing.Icon getIcon(java.lang.String name)
          Return an icon using the default parent package
static void repaintLater(Repaintable c)
          When a component updated very fast need to change the appearance can call this method and at regular interval (tipically 100 ms) the component will be update in the swing thread.
static void setBox(javax.swing.JComponent j)
           
static void setLocationCenterTo(java.awt.Component c, java.awt.Container parent)
          Set a component location center to the parent
static void setRepaintDelay(int n)
          Set the delay for repaint ms.
static javax.swing.border.TitledBorder setTitle(javax.swing.JComponent j, java.lang.String title)
           
static javax.swing.border.TitledBorder setTitle(javax.swing.JComponent j, java.lang.String title, java.awt.Color c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontTitle

public static final java.awt.Font fontTitle

fontLabel

public static final java.awt.Font fontLabel
Constructor Detail

Util

public Util()
Method Detail

setRepaintDelay

public static void setRepaintDelay(int n)
Set the delay for repaint ms.

Since:
1.01

repaintLater

public static void repaintLater(Repaintable c)
When a component updated very fast need to change the appearance can call this method and at regular interval (tipically 100 ms) the component will be update in the swing thread. It is very important that all component use this method to change the UI otherwise the performance of the simulator will be very poor.


setBox

public static void setBox(javax.swing.JComponent j)

setTitle

public static javax.swing.border.TitledBorder setTitle(javax.swing.JComponent j,
                                                       java.lang.String title)

setTitle

public static javax.swing.border.TitledBorder setTitle(javax.swing.JComponent j,
                                                       java.lang.String title,
                                                       java.awt.Color c)

getIcon

public static javax.swing.Icon getIcon(java.lang.String name)
Return an icon using the default parent package

Since:
1.02

getIcon

public static javax.swing.Icon getIcon(java.lang.Class parent,
                                       java.lang.String name)

setLocationCenterTo

public static void setLocationCenterTo(java.awt.Component c,
                                       java.awt.Container parent)
Set a component location center to the parent

Since:
1.02

jmce - 1_02