API java : SynthLookAndFeel


javax.swing.plaf.synth
Class SynthLookAndFeel

java.lang.Object
  extended by javax.swing.LookAndFeel
      extended by javax.swing.plaf.basic.BasicLookAndFeel
          extended by javax.swing.plaf.synth.SynthLookAndFeel
All Implemented Interfaces:
Serializable

public class SynthLookAndFeel
extends BasicLookAndFeel

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.

Since:
1.5

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

SynthLookAndFeel

public SynthLookAndFeel()
Creates a SynthLookAndFeel.

For the returned SynthLookAndFeel to be useful you need to invoke load to specify the set of SynthStyles, or invoke setStyleFactory.

See Also:
load(java.io.InputStream, java.lang.Class), setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)
Method Detail

setStyleFactory

public static void setStyleFactory(SynthStyleFactory cache)
Sets the SynthStyleFactory that the UI classes provided by synth will use to obtain a SynthStyle.

Parameters:
cache - SynthStyleFactory the UIs should use.

getStyleFactory

public static SynthStyleFactory getStyleFactory()
Returns the current SynthStyleFactory.

Returns:
SynthStyleFactory

getStyle

public static SynthStyle getStyle(JComponent c,
                                  Region region)
Gets a SynthStyle for the specified region of the specified component. This is not for general consumption, only custom UIs should call this method.

Parameters:
c - JComponent to get the SynthStyle for
region - Identifies the region of the specified component
Returns:
SynthStyle to use.

updateStyles

public static void updateStyles(Component c)
Updates the style associated with c, and all its children. This is a lighter version of SwingUtilities.updateComponentTreeUI.

Parameters:
c - Component to update style for.

getRegion

public static Region getRegion(JComponent c)
Returns the Region for the JComponent c.

Parameters:
c - JComponent to fetch the Region for
Returns:
Region corresponding to c

createUI

public static ComponentUI createUI(JComponent c)
Creates the Synth look and feel ComponentUI for the passed in JComponent.

Parameters:
c - JComponent to create the ComponentUI for
Returns:
ComponentUI to use for c

load

public void load(InputStream input,
                 Class<?> resourceBase)
          throws ParseException,
                 IllegalArgumentException
Loads the set of 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.

Parameters:
input - InputStream to load from
resourceBase - Used to resolve any images or other resources
Throws:
ParseException - If there is an error in parsing
IllegalArgumentException - if input or resourceBase is null

initialize

public void initialize()
Called by UIManager when this look and feel is installed.

Overrides:
initialize in class BasicLookAndFeel
See Also:
LookAndFeel.uninitialize(), UIManager.setLookAndFeel(javax.swing.LookAndFeel)

uninitialize

public void uninitialize()
Called by UIManager when this look and feel is uninstalled.

Overrides:
uninitialize in class BasicLookAndFeel
See Also:
LookAndFeel.initialize()

getDefaults

public UIDefaults getDefaults()
Returns the defaults for this SynthLookAndFeel.

Overrides:
getDefaults in class BasicLookAndFeel
Returns:
Defaults able.
See Also:
LookAndFeel.initialize(), LookAndFeel.uninitialize(), UIManager.setLookAndFeel(javax.swing.LookAndFeel)

isSupportedLookAndFeel

public boolean isSupportedLookAndFeel()
Returns true, SynthLookAndFeel is always supported.

Specified by:
isSupportedLookAndFeel in class LookAndFeel
Returns:
true.
See Also:
UIManager.setLookAndFeel(javax.swing.LookAndFeel)

isNativeLookAndFeel

public boolean isNativeLookAndFeel()
Returns false, SynthLookAndFeel is not a native look and feel.

Specified by:
isNativeLookAndFeel in class LookAndFeel
Returns:
true.

getDescription

public String getDescription()
Returns a textual description of SynthLookAndFeel.

Specified by:
getDescription in class LookAndFeel
Returns:
textual description of synth.

getName

public String getName()
Return a short string that identifies this look and feel.

Specified by:
getName in class LookAndFeel
Returns:
a short string identifying this look and feel.

getID

public String getID()
Return a string that identifies this look and feel.

Specified by:
getID in class LookAndFeel
Returns:
a short string identifying this look and feel.

shouldUpdateStyleOnAncestorChanged

public boolean shouldUpdateStyleOnAncestorChanged()
Returns whether or not the UIs should update their 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.

Returns:
whether or not the UIs should update their SynthStyles from the SynthStyleFactory when the ancestor changed.

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

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 :

Quels sont les motivations de cette démarche?

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.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

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.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-3229
Document créé le 31/08/06 23:00, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-javax/swing/plaf/synth/SynthLookAndFeel.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,36 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
La distinction entre le vrai et le faux s'applique aux idées, non aux sentiments. Un sentiment peut être superficiel, il ne sera jamais menteur.

Arthur Koestler [Extrait de La corde raide]
 
l'infobrol
Nous sommes le Samedi 02 Juin 2012, 08:37, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)