API java : SynthGraphicsUtils


javax.swing.plaf.synth
Class SynthGraphicsUtils

java.lang.Object
  extended by javax.swing.plaf.synth.SynthGraphicsUtils

public class SynthGraphicsUtils
extends Object

Wrapper for primitive graphics calls.

Since:
1.5

Constructor Summary
SynthGraphicsUtils()
          Creates a SynthGraphicsUtils.
 
Method Summary
 int computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text)
          Returns the size of the passed in string.
 void drawLine(SynthContext context, Object paintKey, Graphics g, int x1, int y1, int x2, int y2)
          Draws a line between the two end points.
 int getMaximumCharHeight(SynthContext context)
          Returns the maximum height of the the Font from the passed in SynthContext.
 Dimension getMaximumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
          Returns the maximum size needed to properly render an icon and text.
 Dimension getMinimumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
          Returns the minimum size needed to properly render an icon and text.
 Dimension getPreferredSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
          Returns the preferred size needed to properly render an icon and text.
 String layoutText(SynthContext ss, FontMetrics fm, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int iconTextGap)
          Lays out text and an icon returning, by reference, the location to place the icon and text.
 void paintText(SynthContext ss, Graphics g, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex, int textOffset)
          Paints an icon and text.
 void paintText(SynthContext ss, Graphics g, String text, int x, int y, int mnemonicIndex)
          Paints text at the specified location.
 void paintText(SynthContext ss, Graphics g, String text, Rectangle bounds, int mnemonicIndex)
          Paints text at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynthGraphicsUtils

public SynthGraphicsUtils()
Creates a SynthGraphicsUtils.

Method Detail

drawLine

public void drawLine(SynthContext context,
                     Object paintKey,
                     Graphics g,
                     int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line between the two end points.

Parameters:
context - Identifies hosting region.
paintKey - Identifies the portion of the component being asked to paint, may be null.
g - Graphics object to paint to
x1 - x origin
y1 - y origin
x2 - x destination
y2 - y destination

layoutText

public String layoutText(SynthContext ss,
                         FontMetrics fm,
                         String text,
                         Icon icon,
                         int hAlign,
                         int vAlign,
                         int hTextPosition,
                         int vTextPosition,
                         Rectangle viewR,
                         Rectangle iconR,
                         Rectangle textR,
                         int iconTextGap)
Lays out text and an icon returning, by reference, the location to place the icon and text.

Parameters:
ss - SynthContext
fm - FontMetrics for the Font to use, this may be ignored
text - Text to layout
icon - Icon to layout
hAlign - horizontal alignment
vAlign - vertical alignment
hTextPosition - horizontal text position
vTextPosition - vertical text position
viewR - Rectangle to layout text and icon in.
iconR - Rectangle to place icon bounds in
textR - Rectangle to place text in
iconTextGap - gap between icon and text

computeStringWidth

public int computeStringWidth(SynthContext ss,
                              Font font,
                              FontMetrics metrics,
                              String text)
Returns the size of the passed in string.

Parameters:
ss - SynthContext
font - Font to use
metrics - FontMetrics, may be ignored
text - Text to get size of.

getMinimumSize

public Dimension getMinimumSize(SynthContext ss,
                                Font font,
                                String text,
                                Icon icon,
                                int hAlign,
                                int vAlign,
                                int hTextPosition,
                                int vTextPosition,
                                int iconTextGap,
                                int mnemonicIndex)
Returns the minimum size needed to properly render an icon and text.

Parameters:
ss - SynthContext
font - Font to use
text - Text to layout
icon - Icon to layout
hAlign - horizontal alignment
vAlign - vertical alignment
hTextPosition - horizontal text position
vTextPosition - vertical text position
iconTextGap - gap between icon and text
mnemonicIndex - Index into text to render the mnemonic at, -1 indicates no mnemonic.

getMaximumSize

public Dimension getMaximumSize(SynthContext ss,
                                Font font,
                                String text,
                                Icon icon,
                                int hAlign,
                                int vAlign,
                                int hTextPosition,
                                int vTextPosition,
                                int iconTextGap,
                                int mnemonicIndex)
Returns the maximum size needed to properly render an icon and text.

Parameters:
ss - SynthContext
font - Font to use
text - Text to layout
icon - Icon to layout
hAlign - horizontal alignment
vAlign - vertical alignment
hTextPosition - horizontal text position
vTextPosition - vertical text position
iconTextGap - gap between icon and text
mnemonicIndex - Index into text to render the mnemonic at, -1 indicates no mnemonic.

getMaximumCharHeight

public int getMaximumCharHeight(SynthContext context)
Returns the maximum height of the the Font from the passed in SynthContext.

Parameters:
context - SynthContext used to determine font.
Returns:
maximum height of the characters for the font from the passed in context.

getPreferredSize

public Dimension getPreferredSize(SynthContext ss,
                                  Font font,
                                  String text,
                                  Icon icon,
                                  int hAlign,
                                  int vAlign,
                                  int hTextPosition,
                                  int vTextPosition,
                                  int iconTextGap,
                                  int mnemonicIndex)
Returns the preferred size needed to properly render an icon and text.

Parameters:
ss - SynthContext
font - Font to use
text - Text to layout
icon - Icon to layout
hAlign - horizontal alignment
vAlign - vertical alignment
hTextPosition - horizontal text position
vTextPosition - vertical text position
iconTextGap - gap between icon and text
mnemonicIndex - Index into text to render the mnemonic at, -1 indicates no mnemonic.

paintText

public void paintText(SynthContext ss,
                      Graphics g,
                      String text,
                      Rectangle bounds,
                      int mnemonicIndex)
Paints text at the specified location. This will not attempt to render the text as html nor will it offset by the insets of the component.

Parameters:
ss - SynthContext
g - Graphics used to render string in.
text - Text to render
bounds - Bounds of the text to be drawn.
mnemonicIndex - Index to draw string at.

paintText

public void paintText(SynthContext ss,
                      Graphics g,
                      String text,
                      int x,
                      int y,
                      int mnemonicIndex)
Paints text at the specified location. This will not attempt to render the text as html nor will it offset by the insets of the component.

Parameters:
ss - SynthContext
g - Graphics used to render string in.
text - Text to render
x - X location to draw text at.
y - Upper left corner to draw text at.
mnemonicIndex - Index to draw string at.

paintText

public void paintText(SynthContext ss,
                      Graphics g,
                      String text,
                      Icon icon,
                      int hAlign,
                      int vAlign,
                      int hTextPosition,
                      int vTextPosition,
                      int iconTextGap,
                      int mnemonicIndex,
                      int textOffset)
Paints an icon and text. This will render the text as html, if necessary, and offset the location by the insets of the component.

Parameters:
ss - SynthContext
g - Graphics to render string and icon into
text - Text to layout
icon - Icon to layout
hAlign - horizontal alignment
vAlign - vertical alignment
hTextPosition - horizontal text position
vTextPosition - vertical text position
iconTextGap - gap between icon and text
mnemonicIndex - Index into text to render the mnemonic at, -1 indicates no mnemonic.
textOffset - Amount to offset the text when painting

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-3393
Document créé le 01/09/06 02:28, 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/SynthGraphicsUtils.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,35 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Il est parfois des regards d'enfant qui vous entraînent si loin dans vos souvenirs, qu'il est impossible de rester sans réponse à la question posée.

Marc Levy [Extrait de Et si c'était vrai...]
 
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)