|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.JAXXUtil
jaxx.runtime.SwingUtil
public class SwingUtil
The runtime swing util class with some nice stuff.
Note : Replace previous class jaxx.runtime.swing.Utils in previous versions.
| Nested Class Summary | |
|---|---|
static class |
SwingUtil.TabbedPaneIterator<O>
A simple iterator on a JTabbedPane. |
| Field Summary | |
|---|---|
static String |
COLOR_PREFIX
|
static String |
DEFAULT_ICON_PATH
|
static String |
DEFAULT_ICON_PATH_PROPERTY
|
static String |
ICON_PREFIX
|
| Fields inherited from class jaxx.runtime.JAXXUtil |
|---|
PARENT |
| Constructor Summary | |
|---|---|
SwingUtil()
|
|
| Method Summary | ||
|---|---|---|
static void |
addExpandOnClickListener(JTree tree)
Add a listener of tree selection model to expand a new selected node when it is selected. |
|
static void |
addExpandOnClickListener(org.jdesktop.swingx.JXTreeTable treeTable)
Add a listener of tree table selection model to expand a new selected node when it is selected. |
|
static org.jdesktop.jxlayer.JXLayer<?> |
boxComponentWithJxLayer(JComponent component)
Box a component in a JXLayer. |
|
static void |
center(Component parent,
Component component)
Centrer un component graphique au center d'un autre component. |
|
static int |
computeTableColumnWidth(JTable table,
Font font,
int columnIndex,
String suffix)
|
|
static ImageIcon |
createActionIcon(String name)
|
|
static ImageIcon |
createI18nIcon(String name)
|
|
static ImageIcon |
createIcon(String path)
|
|
static ImageIcon |
createImageIcon(String path)
|
|
static void |
expandTree(JTree tree)
Expand all childs of a tree. |
|
static void |
expandTreeTable(org.jdesktop.swingx.JXTreeTable treeTable)
Expand all childs of a tree table. |
|
static void |
fillComboBox(JAXXComboBox combo,
Collection<?> data,
Object select,
boolean firstNull)
Deprecated. since 1.7.XXX this code is moved to JAXXComboBox |
|
static void |
fillComboBox(JComboBox combo,
Collection<?> data,
Object select)
Fill a combo box model with some datas, and select after all the given object |
|
static void |
fillList(JList list,
Collection<?> data,
Object select)
Fill a list model with some datas, and select after all the given object |
|
static Component |
findComponentAt(Container cont,
int width,
int height,
int x,
int y)
|
|
static void |
fixTableColumnWidth(JTable table,
int columnIndex,
int width)
|
|
static Component |
getDeepestObjectAt(Component parent,
int x,
int y)
Gets the higest visible component in a ancestor hierarchy at specific x,y coordinates |
|
static org.jdesktop.jxlayer.JXLayer<JComponent> |
getLayer(JComponent comp)
|
|
static List<JComponent> |
getLayeredComponents(JAXXObject object)
|
|
static
|
getParentContainer(Object top,
Class<O> clazz)
Return parent's container corresponding to the Class clazz |
|
static Icon |
getUIManagerActionIcon(String key)
retreave for the UIManager the icon prefixed by action. |
|
static Icon |
getUIManagerIcon(String key)
|
|
static void |
initNimbusLoookAndFeel()
Try to load the Nimbus look and feel. |
|
static boolean |
isLayered(JComponent comp)
|
|
static void |
loadUIConfig(Properties incoming)
Load the ui.properties file and set in UIManager colors and
icons found. |
|
static void |
loadUIConfig(String defaultUIConfig,
String extraUIConfig)
Load the ui.properties file and set in UIManager colors and
icons found. |
|
static Map<String,JComponent> |
lookingForEditor(Class<?> clazz,
Container container)
recherche les composants portant le meme nom que les champs de la classe clazz. |
|
static TableCellRenderer |
newBooleanTableCellRenderer(DefaultTableCellRenderer renderer)
|
|
static TableCellRenderer |
newDeleteCellRenderer(DefaultTableCellRenderer renderer)
|
|
static EmptyNumberTableCellRenderer |
newEmptyNumberTableCellRenderer(TableCellRenderer renderer)
|
|
static
|
newEnumTableCellRenderer(TableCellRenderer renderer,
Class<E> enumClass)
|
|
static JLabel |
newLabel(String text,
Object iconKey,
int aligment)
|
|
static Dimension |
newMaxXDimension()
|
|
static Dimension |
newMaxXYDimension()
|
|
static Dimension |
newMaxYDimension()
|
|
static Dimension |
newMinDimension()
|
|
static TableCellRenderer |
newStringTableCellRenderer(DefaultTableCellRenderer renderer,
int length,
boolean tooltip)
|
|
static SwingUtil.TabbedPaneIterator<Component> |
newTabbedPaneIterator(JTabbedPane tabs)
Iterate the components of a JTabbedPane in natural order. |
|
static void |
openLink(HyperlinkEvent he)
Open a link coming from a HyperlinkEvent. |
|
static void |
openLink(String url)
|
|
static void |
setComponentHeight(Component component,
int height)
Set the height of a given component. |
|
static void |
setComponentWidth(Component component,
int width)
Set the width of the given component |
|
static void |
setI18nTableHeaderRenderer(JTable table,
String... libelles)
|
|
static void |
setTableColumnEditor(JTable table,
int columnIndex,
TableCellEditor editor)
|
|
static void |
setTableColumnRenderer(JTable table,
int columnIndex,
TableCellRenderer editor)
|
|
static void |
setText(JTextComponent c,
String text)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_ICON_PATH
public static final String DEFAULT_ICON_PATH_PROPERTY
public static final String ICON_PREFIX
public static final String COLOR_PREFIX
| Constructor Detail |
|---|
public SwingUtil()
| Method Detail |
|---|
public static Dimension newMinDimension()
public static Dimension newMaxXDimension()
public static Dimension newMaxYDimension()
public static Dimension newMaxXYDimension()
public static void setText(JTextComponent c,
String text)
public static void fillComboBox(JComboBox combo,
Collection<?> data,
Object select)
combo - the combo to filldata - data ot inject in comboselect - the object to select in combo after reflling his model
public static void fillList(JList list,
Collection<?> data,
Object select)
list - the list to filldata - data ot inject in comboselect - the object to select in combo after reflling his model
@Deprecated
public static void fillComboBox(JAXXComboBox combo,
Collection<?> data,
Object select,
boolean firstNull)
combo - the combo to filldata - data ot inject in comboselect - the object to select in combo after reflling his modelfirstNull - add a first null element
public static <O extends Container> O getParentContainer(Object top,
Class<O> clazz)
O - type of container to obtain from contexttop - the top containerclazz - desired
public static int computeTableColumnWidth(JTable table,
Font font,
int columnIndex,
String suffix)
public static void fixTableColumnWidth(JTable table,
int columnIndex,
int width)
public static void setTableColumnEditor(JTable table,
int columnIndex,
TableCellEditor editor)
public static void setTableColumnRenderer(JTable table,
int columnIndex,
TableCellRenderer editor)
public static void setI18nTableHeaderRenderer(JTable table,
String... libelles)
public static TableCellRenderer newStringTableCellRenderer(DefaultTableCellRenderer renderer,
int length,
boolean tooltip)
public static org.jdesktop.jxlayer.JXLayer<?> boxComponentWithJxLayer(JComponent component)
JXLayer.
component - the component to box
JXLayer boxing the componentpublic static List<JComponent> getLayeredComponents(JAXXObject object)
public static org.jdesktop.jxlayer.JXLayer<JComponent> getLayer(JComponent comp)
public static boolean isLayered(JComponent comp)
public static Map<String,JComponent> lookingForEditor(Class<?> clazz,
Container container)
clazz - la classe ou recherche les champscontainer - le container ou rechercher les composants d'edition
public static void center(Component parent,
Component component)
parent - le component parentcomponent - le component à centrer
public static void initNimbusLoookAndFeel()
throws UnsupportedLookAndFeelException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException
UnsupportedLookAndFeelException - if nimbus is not applicable
ClassNotFoundException
InstantiationException
IllegalAccessException
public static void loadUIConfig(String defaultUIConfig,
String extraUIConfig)
throws IOException
UIManager colors and
icons found.
defaultUIConfig - le path vers le fichier de la config d'ui par
défaut (doit etre dansle class-path)extraUIConfig - le path vers une surcharge de la config d'ui
(doit etre dans le class-path)
IOException - if could not load the ui.properties filepublic static void loadUIConfig(Properties incoming)
UIManager colors and
icons found.
incoming - the ui resources to load.public static SwingUtil.TabbedPaneIterator<Component> newTabbedPaneIterator(JTabbedPane tabs)
JTabbedPane in natural order.
Says using method Container.getComponent(int)
tabs - the
public static JLabel newLabel(String text,
Object iconKey,
int aligment)
public static Component getDeepestObjectAt(Component parent,
int x,
int y)
parent - x - y -
public static Component findComponentAt(Container cont,
int width,
int height,
int x,
int y)
public static TableCellRenderer newDeleteCellRenderer(DefaultTableCellRenderer renderer)
public static TableCellRenderer newBooleanTableCellRenderer(DefaultTableCellRenderer renderer)
public static EmptyNumberTableCellRenderer newEmptyNumberTableCellRenderer(TableCellRenderer renderer)
public static <E extends Enum<E>> EnumTableCellRenderer<E> newEnumTableCellRenderer(TableCellRenderer renderer,
Class<E> enumClass)
public static void openLink(HyperlinkEvent he)
HyperlinkEvent.
And try to open the link if an url in a browser.
he - the event to treatepublic static void openLink(String url)
public static void expandTree(JTree tree)
tree - the tree to expandpublic static void expandTreeTable(org.jdesktop.swingx.JXTreeTable treeTable)
treeTable - the tree to expandpublic static void addExpandOnClickListener(JTree tree)
tree - the tree to treatepublic static void addExpandOnClickListener(org.jdesktop.swingx.JXTreeTable treeTable)
treeTable - the tree to treate
public static void setComponentWidth(Component component,
int width)
component - the component to resizewidth - the new width to apply
public static void setComponentHeight(Component component,
int height)
component - the component to resizeheight - the new height to applypublic static ImageIcon createIcon(String path)
public static ImageIcon createImageIcon(String path)
path - the location of icons in root directory icons
getIconPath()+pathpublic static Icon getUIManagerIcon(String key)
key - the key of the icon to retreave from UIManager
null if no icon found in UIManagerpublic static Icon getUIManagerActionIcon(String key)
UIManager the icon prefixed by action.
key - the key of the action icon to retreave from UIManager
null if no icon found in UIManagerpublic static ImageIcon createActionIcon(String name)
public static ImageIcon createI18nIcon(String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||