java.lang.Objectjavax.swing.plaf.synth.SynthGraphicsUtils
public class SynthGraphicsUtils
Wrapper for primitive graphics calls.
| 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 |
|---|
public SynthGraphicsUtils()
SynthGraphicsUtils.
| Method Detail |
|---|
public void drawLine(SynthContext context, Object paintKey, Graphics g, int x1, int y1, int x2, int y2)
context - Identifies hosting region.paintKey - Identifies the portion of the component being asked
to paint, may be null.g - Graphics object to paint tox1 - x originy1 - y originx2 - x destinationy2 - y destinationpublic 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)
ss - SynthContextfm - FontMetrics for the Font to use, this may be ignoredtext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positionviewR - Rectangle to layout text and icon in.iconR - Rectangle to place icon bounds intextR - Rectangle to place text iniconTextGap - gap between icon and textpublic int computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text)
ss - SynthContextfont - Font to usemetrics - FontMetrics, may be ignoredtext - Text to get size of.public Dimension getMinimumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.public Dimension getMaximumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.public int getMaximumCharHeight(SynthContext context)
context - SynthContext used to determine font.
public Dimension getPreferredSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex)
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.public void paintText(SynthContext ss, Graphics g, String text, Rectangle bounds, int mnemonicIndex)
ss - SynthContextg - Graphics used to render string in.text - Text to renderbounds - Bounds of the text to be drawn.mnemonicIndex - Index to draw string at.public void paintText(SynthContext ss, Graphics g, String text, int x, int y, int mnemonicIndex)
ss - SynthContextg - Graphics used to render string in.text - Text to renderx - X location to draw text at.y - Upper left corner to draw text at.mnemonicIndex - Index to draw string at.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)
ss - SynthContextg - Graphics to render string and icon intotext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.textOffset - Amount to offset the text when paintingCes 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)