|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.StyleContext
argutia.gui.MyStyles
public class MyStyles
Groupe des styles utilisés par l'interface graphique.
Nested Class Summary | |
---|---|
static class |
MyStyles.StyleNames
Énumération des styles utilisés par l'application. |
Nested classes/interfaces inherited from class javax.swing.text.StyleContext |
---|
StyleContext.NamedStyle, StyleContext.SmallAttributeSet |
Field Summary | |
---|---|
private int |
baseFontSize
Taille de base du texte en points. |
static String |
RB_MENU_FONT_SIZE_RATIO
Multiplicateur à appliquer à la taille du style MyStyles.StyleNames.NORMAL
pour définir la taille du style MyStyles.StyleNames.MENU . |
static String |
RB_SMALL_FONT_SIZE_RATIO
Multiplicateur à appliquer à la taille du style MyStyles.StyleNames.NORMAL
pour définir la taille du style MyStyles.StyleNames.SMALL . |
private static long |
serialVersionUID
The serial version of this class. |
Fields inherited from class javax.swing.text.StyleContext |
---|
DEFAULT_STYLE |
Constructor Summary | |
---|---|
MyStyles(Argutia.Builder builder)
Construit et initialise un StyleContext avec tous les styles nécessaires à
l'interface graphique. |
Method Summary | |
---|---|
int |
getBaseFontSize()
Retourne la taille de base du texte en points. |
Font |
getFont(MyStyles.StyleNames styleName)
Récupère la fonte du style spécifié. |
Style |
getStyle(MyStyles.StyleNames styleName)
Retourne le style de nom styleName . |
void |
setStyle(Component c,
MyStyles.StyleNames styleName)
Applique un style sur un composant graphique. |
private void |
setTabs(Style style,
int charactersPerTab)
Redéfinit les tabulations du style pour qu'elles adoptent la largeur spécifiée. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@ResourceBundle(value="argutia.argutia") public static final String RB_MENU_FONT_SIZE_RATIO
MyStyles.StyleNames.NORMAL
pour définir la taille du style MyStyles.StyleNames.MENU
.
"argutia.menu_font_size_ratio"
@ResourceBundle(value="argutia.argutia") public static final String RB_SMALL_FONT_SIZE_RATIO
MyStyles.StyleNames.NORMAL
pour définir la taille du style MyStyles.StyleNames.SMALL
.
"argutia.small_font_size_ratio"
private static final long serialVersionUID
Serializable
,
Constant Field Values2124483014256487509L
private int baseFontSize
MyStyles.StyleNames.NORMAL
,
getBaseFontSize()
Constructor Detail |
---|
public MyStyles(Argutia.Builder builder)
StyleContext
avec tous les styles nécessaires à
l'interface graphique.
builder
- Objet contenant les paramètres d'initialisation des styles.Method Detail |
---|
public int getBaseFontSize()
baseFontSize
public Font getFont(MyStyles.StyleNames styleName)
return getFont(getStyle(styleName));
JButton
, JLabel
ou encore TitledBorder
.styleName
- nom du style dont on souhaite récupérer la fonte.
public Style getStyle(MyStyles.StyleNames styleName)
styleName
.
return getStyle(styleName.toString());
styleName
- nom du style recherché.
styleName
.public void setStyle(Component c, MyStyles.StyleNames styleName)
c.setFont(getFont(styleName)); c.setForeground(getForeground(getStyle(styleName)));
JButton
, JLabel
ou encore JTextPane
.c
- composant sur lequel on souhaite appliquer un style.styleName
- nom du style à appliquer.private void setTabs(Style style, int charactersPerTab)
style
- style dont on redéfinit les tabulations.charactersPerTab
- largeur d'une tabulation en nombre de caractères 'w'.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |