javax.swing.text
Class LabelView
- Cloneable, SwingConstants, TabableView
A
GlyphView
that caches the textattributes for most effective
rendering.
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
breakView , changedUpdate , checkPainter , clone , createFragment , getAlignment , getBackground , getBreakWeight , getEndOffset , getFont , getForeground , getGlyphPainter , getNextVisualPositionFrom , getPartialSpan , getPreferredSpan , getStartOffset , getTabExpander , getTabbedSpan , getText , insertUpdate , isStrikeThrough , isSubscript , isSuperscript , isUnderline , modelToView , paint , removeUpdate , setGlyphPainter , viewToModel |
append , breakView , changedUpdate , createFragment , dump , forwardUpdate , forwardUpdateToView , getAlignment , getAttributes , getBreakWeight , getChildAllocation , getContainer , getDocument , getElement , getEndOffset , getGraphics , getMaximumSpan , getMinimumSpan , getNextVisualPositionFrom , getParent , getPreferredSpan , getResizeWeight , getStartOffset , getToolTipText , getView , getViewCount , getViewFactory , getViewIndex , getViewIndex , insert , insertUpdate , isVisible , modelToView , modelToView , modelToView , paint , preferenceChanged , remove , removeAll , removeUpdate , replace , setParent , setSize , updateChildren , updateLayout , viewToModel , viewToModel |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
LabelView
public LabelView(Element element)
Creates a new GlyphView
for the given Element
.
element
- the element that is rendered by this GlyphView
getFontMetrics
protected FontMetrics getFontMetrics()
this is not used anymore
Returns the font metrics of the current font.
- the font metrics of the current font
isStrikeThrough
public boolean isStrikeThrough()
Returns true
if the glyphs are rendered strike-through,
false
otherwise.
- isStrikeThrough in interface GlyphView
true
if the glyphs are rendered strike-through,
false
otherwise
isSubscript
public boolean isSubscript()
Returns true
if the glyphs are rendered as subscript,
false
otherwise.
- isSubscript in interface GlyphView
true
if the glyphs are rendered as subscript,
false
otherwise
isSuperscript
public boolean isSuperscript()
Returns true
if the glyphs are rendered as superscript,
false
otherwise.
- isSuperscript in interface GlyphView
true
if the glyphs are rendered as superscript,
false
otherwise
isUnderline
public boolean isUnderline()
Returns true
if the glyphs are rendered underlined,
false
otherwise.
- isUnderline in interface GlyphView
true
if the glyphs are rendered underlined,
false
otherwise
setBackground
protected void setBackground(Color bg)
Sets the background color for the glyphs. A value of null
means the background of the parent view should shine through.
bg
- the background to set or null
setStrikeThrough
protected void setStrikeThrough(boolean flag)
Sets the strike-through flag.
flag
- true
if the glyphs are rendered strike-through,
false
otherwise
setSubscript
protected void setSubscript(boolean flag)
Sets the subscript flag.
flag
- true
if the glyphs are rendered as subscript,
false
otherwise
setSuperscript
protected void setSuperscript(boolean flag)
Sets the superscript flag.
flag
- true
if the glyphs are rendered as superscript,
false
otherwise
setUnderline
protected void setUnderline(boolean flag)
Sets the underline flag.
flag
- true
if the glyphs are rendered underlined,
false
otherwise
LabelView.java -- A view to render styled text
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.