java.lang.Objectjavax.swing.text.GlyphView.GlyphPainter
public abstract static class GlyphView.GlyphPainter
A class to perform rendering of the glyphs. This can be implemented to be stateless, or to hold some information as a cache to facilitate faster rendering and model/view translation. At a minimum, the GlyphPainter allows a View implementation to perform its duties independant of a particular version of JVM and selection of capabilities (i.e. shaping for i18n, etc).
| Constructor Summary | |
|---|---|
GlyphView.GlyphPainter()
|
|
| Method Summary | |
|---|---|
abstract float |
getAscent(GlyphView v)
|
abstract int |
getBoundedPosition(GlyphView v,
int p0,
float x,
float len)
Determines the model location that represents the maximum advance that fits within the given span. |
abstract float |
getDescent(GlyphView v)
|
abstract float |
getHeight(GlyphView v)
|
int |
getNextVisualPositionFrom(GlyphView v,
int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
Provides a way to determine the next visually represented model location that one might place a caret. |
GlyphView.GlyphPainter |
getPainter(GlyphView v,
int p0,
int p1)
Create a painter to use for the given GlyphView. |
abstract float |
getSpan(GlyphView v,
int p0,
int p1,
TabExpander e,
float x)
Determine the span the glyphs given a start location (for tab expansion). |
abstract Shape |
modelToView(GlyphView v,
int pos,
Position.Bias bias,
Shape a)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
abstract void |
paint(GlyphView v,
Graphics g,
Shape a,
int p0,
int p1)
Paint the glyphs representing the given range. |
abstract int |
viewToModel(GlyphView v,
float x,
float y,
Shape a,
Position.Bias[] biasReturn)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlyphView.GlyphPainter()
| Method Detail |
|---|
public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x)
public abstract float getHeight(GlyphView v)
public abstract float getAscent(GlyphView v)
public abstract float getDescent(GlyphView v)
public abstract void paint(GlyphView v, Graphics g, Shape a, int p0, int p1)
public abstract Shape modelToView(GlyphView v, int pos, Position.Bias bias, Shape a) throws BadLocationException
v - the GlyphView containing the
destination coordinate spacepos - the position to convertbias - either Position.Bias.Forward
or Position.Bias.Backwarda - Bounds of the View
BadLocationException - if the given position does not represent a
valid location in the associated documentView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)public abstract int viewToModel(GlyphView v, float x, float y, Shape a, Position.Bias[] biasReturn)
v - the GlyphView to provide a mapping forx - the X coordinatey - the Y coordinatea - the allocated region to render intobiasReturn - either Position.Bias.Forward
or Position.Bias.Backward
is returned as the zero-th element of this array
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])public abstract int getBoundedPosition(GlyphView v, int p0, float x, float len)
v - the view to find the model location to break at.p0 - the location in the model where the
fragment should start it's representation >= 0.x - the graphic location along the axis that the
broken view would occupy >= 0. This may be useful for
things like tab calculations.len - specifies the distance into the view
where a potential break is desired >= 0.
View.breakView(int, int, float, float)public GlyphView.GlyphPainter getPainter(GlyphView v, int p0, int p1)
v - the GlyphView to provide a painter forp0 - the starting document offset >= 0p1 - the ending document offset >= p0public int getNextVisualPositionFrom(GlyphView v, int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
v - the view to usepos - the position to convert >= 0b - either Position.Bias.Forward
or Position.Bias.Backwarda - the allocated region to render intodirection - the direction from the current position that can
be thought of as the arrow keys typically found on a keyboard.
This may be SwingConstants.WEST, SwingConstants.EAST,
SwingConstants.NORTH, or SwingConstants.SOUTH.biasRet - either Position.Bias.Forward
or Position.Bias.Backward
is returned as the zero-th element of this array
BadLocationException
IllegalArgumentException - for an invalid directionCes 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)