java.lang.Objectjavax.swing.LookAndFeel
javax.swing.plaf.basic.BasicLookAndFeel
javax.swing.plaf.synth.SynthLookAndFeel
public class SynthLookAndFeel
SynthLookAndFeel provides the basis for creating a customized look and
feel. SynthLookAndFeel does not directly provide a look, all painting is
delegated.
You need to either provide a configuration file, by way of the
load(java.io.InputStream, java.lang.Class>) method, or provide your own SynthStyleFactory
to setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory). Refer to the
package summary for an example of
loading a file, and SynthStyleFactory for
an example of providing your own SynthStyleFactory to
setStyleFactory.
Warning:
This class implements Serializable as a side effect of it
extending BasicLookAndFeel. It is not intended to be serialized.
An attempt to serialize it will
result in NotSerializableException.
| Constructor Summary | |
|---|---|
SynthLookAndFeel()
Creates a SynthLookAndFeel. |
|
| Method Summary | |
|---|---|
static ComponentUI |
createUI(JComponent c)
Creates the Synth look and feel ComponentUI for
the passed in JComponent. |
UIDefaults |
getDefaults()
Returns the defaults for this SynthLookAndFeel. |
String |
getDescription()
Returns a textual description of SynthLookAndFeel. |
String |
getID()
Return a string that identifies this look and feel. |
String |
getName()
Return a short string that identifies this look and feel. |
static Region |
getRegion(JComponent c)
Returns the Region for the JComponent c. |
static SynthStyle |
getStyle(JComponent c,
Region region)
Gets a SynthStyle for the specified region of the specified component. |
static SynthStyleFactory |
getStyleFactory()
Returns the current SynthStyleFactory. |
void |
initialize()
Called by UIManager when this look and feel is installed. |
boolean |
isNativeLookAndFeel()
Returns false, SynthLookAndFeel is not a native look and feel. |
boolean |
isSupportedLookAndFeel()
Returns true, SynthLookAndFeel is always supported. |
void |
load(InputStream input,
Class<?> resourceBase)
Loads the set of SynthStyles that will be used by
this SynthLookAndFeel. |
static void |
setStyleFactory(SynthStyleFactory cache)
Sets the SynthStyleFactory that the UI classes provided by synth will use to obtain a SynthStyle. |
boolean |
shouldUpdateStyleOnAncestorChanged()
Returns whether or not the UIs should update their SynthStyles from the SynthStyleFactory
when the ancestor of the JComponent changes. |
void |
uninitialize()
Called by UIManager when this look and feel is uninstalled. |
static void |
updateStyles(Component c)
Updates the style associated with c, and all its children. |
| Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel |
|---|
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSound |
| Methods inherited from class javax.swing.LookAndFeel |
|---|
getDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SynthLookAndFeel()
For the returned SynthLookAndFeel to be useful you need to
invoke load to specify the set of
SynthStyles, or invoke setStyleFactory.
| Method Detail |
|---|
public static void setStyleFactory(SynthStyleFactory cache)
cache - SynthStyleFactory the UIs should use.public static SynthStyleFactory getStyleFactory()
public static SynthStyle getStyle(JComponent c, Region region)
c - JComponent to get the SynthStyle forregion - Identifies the region of the specified component
public static void updateStyles(Component c)
c, and all its children.
This is a lighter version of
SwingUtilities.updateComponentTreeUI.
c - Component to update style for.public static Region getRegion(JComponent c)
c.
c - JComponent to fetch the Region for
cpublic static ComponentUI createUI(JComponent c)
ComponentUI for
the passed in JComponent.
c - JComponent to create the ComponentUI for
cpublic void load(InputStream input, Class<?> resourceBase) throws ParseException, IllegalArgumentException
SynthStyles that will be used by
this SynthLookAndFeel. resourceBase is
used to resolve any path based resources, for example an
Image would be resolved by
resourceBase.getResource(path). Refer to
Synth File Format
for more information.
input - InputStream to load fromresourceBase - Used to resolve any images or other resources
ParseException - If there is an error in parsing
IllegalArgumentException - if input or resourceBase is nullpublic void initialize()
initialize in class BasicLookAndFeelpublic void uninitialize()
uninitialize in class BasicLookAndFeelLookAndFeel.initialize()public UIDefaults getDefaults()
getDefaults in class BasicLookAndFeelLookAndFeel.initialize(),
LookAndFeel.uninitialize(),
UIManager.setLookAndFeel(javax.swing.LookAndFeel)public boolean isSupportedLookAndFeel()
isSupportedLookAndFeel in class LookAndFeelUIManager.setLookAndFeel(javax.swing.LookAndFeel)public boolean isNativeLookAndFeel()
isNativeLookAndFeel in class LookAndFeelpublic String getDescription()
getDescription in class LookAndFeelpublic String getName()
getName in class LookAndFeelpublic String getID()
getID in class LookAndFeelpublic boolean shouldUpdateStyleOnAncestorChanged()
SynthStyles from the SynthStyleFactory
when the ancestor of the JComponent changes. A subclass
that provided a SynthStyleFactory that based the
return value from getStyle off the containment hierarchy
would override this method to return true.
SynthStyles from the SynthStyleFactory
when the ancestor changed.Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
8 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)