|
From: <de...@us...> - 2012-09-04 08:27:37
|
Revision: 7604
http://fudaa.svn.sourceforge.net/fudaa/?rev=7604&view=rev
Author: deniger
Date: 2012-09-04 08:27:26 +0000 (Tue, 04 Sep 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
Modified: trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
===================================================================
--- trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-09-03 22:29:12 UTC (rev 7603)
+++ trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-09-04 08:27:26 UTC (rev 7604)
@@ -134,6 +134,9 @@
public static Color getDefaultLabelForegroundColor() {
return UIManager.getColor("Label.foreground");
}
+ public static Font getDefaultLabelFont() {
+ return UIManager.getFont("Label.font");
+ }
public static Color getDefaultTitleBorderColor() {
return UIManager.getColor("TitledBorder.titleColor");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-17 22:31:04
|
Revision: 7757
http://fudaa.svn.sourceforge.net/fudaa/?rev=7757&view=rev
Author: deniger
Date: 2012-10-17 22:30:58 +0000 (Wed, 17 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
Modified: trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
===================================================================
--- trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-10-17 22:23:21 UTC (rev 7756)
+++ trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-10-17 22:30:58 UTC (rev 7757)
@@ -23,9 +23,11 @@
* @version $Id: CtuluLibSwing.java,v 1.8 2007-05-04 13:43:23 deniger Exp $
*/
public final class CtuluLibSwing {
+
private static Font minFont;
- private CtuluLibSwing() {}
+ private CtuluLibSwing() {
+ }
public static Frame getFrameAncestorHelper(final Component _c) {
final Frame res = getFrameAncestor(_c);
@@ -46,22 +48,25 @@
* @return le fils direct de _parent ayant le nom donne ou null si non trouve
*/
public static JComponent findChildByName(JComponent _parent, String _name) {
- if (_parent == null || _name == null) return null;
+ if (_parent == null || _name == null) {
+ return null;
+ }
for (int i = _parent.getComponentCount() - 1; i >= 0; i--) {
- if (_name.equals(_parent.getComponent(i).getName())) return (JComponent) _parent.getComponent(i);
+ if (_name.equals(_parent.getComponent(i).getName())) {
+ return (JComponent) _parent.getComponent(i);
+ }
}
return null;
}
/**
* Ajouter un actionListener a la checkbox _res afin d'activer ou non un panneau (et tous ces composants).
- *
+ *
* @param _target le panneau dont les composants seront activ\xE9es ou non, selon l'\xE9tat de la checkbox _res
* @param _res la checkbox permettant de activer ou non un panneau
*/
public static void addActionListenerForCheckBoxTitle(final JPanel _target, final JCheckBox _res) {
_res.addItemListener(new ItemListener() {
-
public void itemStateChanged(final ItemEvent _e) {
final boolean enable = _res.isSelected();
setEnable(_target, _res, enable);
@@ -79,7 +84,9 @@
}
public static String getHelpUrl(final JComponent _c) {
- if (_c == null) { return null; }
+ if (_c == null) {
+ return null;
+ }
String r = (String) _c.getClientProperty(CtuluLib.getHelpProperty());
if (r == null) {
final Container parent = _c.getParent();
@@ -91,11 +98,17 @@
}
public static Frame getFrameAncestor(final Component _c) {
- if (_c instanceof Frame) { return (Frame) _c; }
+ if (_c instanceof Frame) {
+ return (Frame) _c;
+ }
Frame fr = (Frame) SwingUtilities.getAncestorOfClass(JFrame.class, _c);
- if (fr != null) return fr;
+ if (fr != null) {
+ return fr;
+ }
final BuApplication app = (BuApplication) SwingUtilities.getAncestorOfClass(BuApplication.class, _c);
- if (app != null) { return app; }
+ if (app != null) {
+ return app;
+ }
return null;
}
@@ -108,14 +121,20 @@
public static JDialog createDialogOnActiveWindow(String _title) {
Window w = getActiveWindow();
- if (w instanceof Frame) { return new JDialog((Frame) w, _title); }
- if (w instanceof Dialog) { return new JDialog((Dialog) w, _title); }
+ if (w instanceof Frame) {
+ return new JDialog((Frame) w, _title);
+ }
+ if (w instanceof Dialog) {
+ return new JDialog((Dialog) w, _title);
+ }
return new JDialog(BuLib.HELPER, _title);
}
public static BuList createBuList(final Object[] _o) {
- if (_o == null) { return new BuList(); }
+ if (_o == null) {
+ return new BuList();
+ }
final BuList l = new BuList();
l.setModel(CtuluLibSwing.createListModel(_o));
return l;
@@ -134,8 +153,10 @@
public static Color getDefaultLabelForegroundColor() {
return UIManager.getColor("Label.foreground");
}
+
public static Font getDefaultLabelFont() {
- return UIManager.getFont("Label.font");
+ final Font font = UIManager.getFont("Label.font");
+ return new Font(font.getName(), font.getStyle(), font.getSize());
}
public static Color getDefaultTitleBorderColor() {
@@ -156,7 +177,7 @@
/**
* Permet d'afficher un dialogue simplement.
- *
+ *
* @param _parent
* @param _title
* @param _optionPane return JOptionPane constante
@@ -171,10 +192,16 @@
d.dispose();
final Object selectedValue = _optionPane.getValue();
- if (selectedValue == null) { return JOptionPane.CLOSED_OPTION; }
- if (selectedValue instanceof Integer) { return ((Integer) selectedValue).intValue(); }
- Frame f=getFrameAncestor(_parent);
- if(f!=null) f.toFront();
+ if (selectedValue == null) {
+ return JOptionPane.CLOSED_OPTION;
+ }
+ if (selectedValue instanceof Integer) {
+ return ((Integer) selectedValue).intValue();
+ }
+ Frame f = getFrameAncestor(_parent);
+ if (f != null) {
+ f.toFront();
+ }
return JOptionPane.CLOSED_OPTION;
}
@@ -214,7 +241,9 @@
}
pn.addLabel(_lb);
JComboBox res = pn.addComboBox(_values, pn);
- if (pn.afficheModaleOk(_parent, _title)) { return res.getSelectedIndex(); }
+ if (pn.afficheModaleOk(_parent, _title)) {
+ return res.getSelectedIndex();
+ }
return -1;
}
@@ -224,7 +253,6 @@
public static AbstractListModel createListModel(final Object[] _o) {
return new AbstractListModel() {
-
public int getSize() {
return _o.length;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-14 08:32:10
|
Revision: 7879
http://fudaa.svn.sourceforge.net/fudaa/?rev=7879&view=rev
Author: deniger
Date: 2012-11-14 08:31:59 +0000 (Wed, 14 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
Modified: trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
===================================================================
--- trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-11-13 15:46:43 UTC (rev 7878)
+++ trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2012-11-14 08:31:59 UTC (rev 7879)
@@ -138,6 +138,15 @@
return l;
}
+ public static BuList createBuList(final java.util.List _o) {
+ if (_o == null) {
+ return new BuList();
+ }
+ final BuList l = new BuList();
+ l.setModel(CtuluLibSwing.createListModel(_o));
+ return l;
+ }
+
/**
* @return font "SansSerif", Font.PLAIN, 10
*/
@@ -263,6 +272,20 @@
};
}
+ public static AbstractListModel createListModel(final java.util.List _o) {
+ return new AbstractListModel() {
+ @Override
+ public int getSize() {
+ return _o.size();
+ }
+
+ @Override
+ public Object getElementAt(final int _i) {
+ return _o.get(_i);
+ }
+ };
+ }
+
public static void griserPanel(final Container _target, final boolean _enable) {
setEnable(_target, _enable);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2013-09-03 19:24:52
|
Revision: 8482
http://sourceforge.net/p/fudaa/svn/8482
Author: deniger
Date: 2013-09-03 19:24:49 +0000 (Tue, 03 Sep 2013)
Log Message:
-----------
CRUE-573
Modified Paths:
--------------
trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
Modified: trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java
===================================================================
--- trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2013-09-03 19:24:37 UTC (rev 8481)
+++ trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluLibSwing.java 2013-09-03 19:24:49 UTC (rev 8482)
@@ -56,6 +56,18 @@
return null;
}
+ public static JComponent findChildByClass(JComponent _parent, Class _name) {
+ if (_parent == null || _name == null) {
+ return null;
+ }
+ for (int i = _parent.getComponentCount() - 1; i >= 0; i--) {
+ if (_name.equals(_parent.getComponent(i).getClass())) {
+ return (JComponent) _parent.getComponent(i);
+ }
+ }
+ return null;
+ }
+
/**
* Ajouter un actionListener a la checkbox _res afin d'activer ou non un panneau (et tous ces composants).
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|