public class TextDescriptor
extends java.lang.Object
This class should be thread-safe
Modifier and Type | Class and Description |
---|---|
static class |
AbstractTextDescriptor.ActiveFont
ActiveFont is a class that describes fonts currently in use.
|
static class |
AbstractTextDescriptor.Display
enumeration which represents text visibility .
|
static class |
AbstractTextDescriptor.DispPos
DispPos is a typesafe enum class that describes text's display position on a Variable.
|
static class |
AbstractTextDescriptor.Position
Position is a typesafe enum class that describes the text position of a Variable.
|
static class |
AbstractTextDescriptor.Rotation
Rotation is a typesafe enum class that describes text's rotation in a Variable.
|
static class |
AbstractTextDescriptor.Size
Size is a class that describes text's size on a Variable.
|
static class |
AbstractTextDescriptor.TextType |
static class |
AbstractTextDescriptor.Unit
Unit is a typesafe enum class that describes text's units on a Variable.
|
Modifier and Type | Field and Description |
---|---|
static TextDescriptor |
EMPTY
empty text descriptor.
|
Modifier and Type | Method and Description |
---|---|
static int |
cacheSize() |
boolean |
equals(java.lang.Object anObject)
Compares this text descriptor to the specified object.
|
static TextDescriptor |
getAnnotationTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on Annotations.
|
static TextDescriptor |
getArcTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on ArcInsts.
|
static TextDescriptor |
getCellTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on Cell Variables.
|
int |
getColorIndex()
Method to return the color index of the TextDescriptor.
|
static java.awt.Font |
getDefaultFont()
Method to get a default Font to use.
|
static int |
getDefaultFontSize() |
AbstractTextDescriptor.Display |
getDisplay()
Method to return mode how this TextDescriptor is displayable.
|
AbstractTextDescriptor.DispPos |
getDispPart()
Method to return the text display part of the TextDescriptor.
|
static TextDescriptor |
getExportTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on Exports.
|
int |
getFace()
Method to return the text font of the TextDescriptor.
|
java.awt.Font |
getFont(EditWindow0 wnd,
int minimalTextSize)
Method to get a Font to use for this TextDescriptor in a given EditWindow.
|
static java.awt.font.GlyphVector |
getGlyphs(java.lang.String text,
java.awt.Font font)
Method to convert a string and descriptor to a GlyphVector.
|
static TextDescriptor |
getInstanceTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on Cell Instance Names.
|
static TextDescriptor |
getNodeTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on NodeInsts.
|
static TextDescriptor |
getPortInstTextDescriptor()
Method to return a displayable TextDescriptor that is a default for Variables on PortInsts.
|
AbstractTextDescriptor.Position |
getPos()
Method to return the text position of the TextDescriptor.
|
AbstractTextDescriptor.Rotation |
getRotation()
Method to return the text rotation of the TextDescriptor.
|
AbstractTextDescriptor.Size |
getSize()
Method to return the text size of the text in this TextDescriptor.
|
double |
getTrueSize(double scale,
EditWindow0 wnd)
Method to find the true size in points for this TextDescriptor in a given scale.
|
double |
getTrueSize(EditWindow0 wnd)
Method to find the true size in points for this TextDescriptor in a given EditWindow0.
|
AbstractTextDescriptor.Unit |
getUnit()
Method to return the Unit of the TextDescriptor.
|
double |
getXOff()
Method to return the X offset of the text in the TextDescriptor.
|
double |
getYOff()
Method to return the Y offset of the text in the TextDescriptor.
|
int |
hashCode()
Returns a hash code for this
TextDescriptor . |
boolean |
isAbsoluteSize()
Returns true if this ImmutableTextDescriptor describes absolute text.
|
boolean |
isBold()
Method to return true if the text in the TextDescriptor is bold.
|
boolean |
isDisplay()
Method to return true if this TextDescriptor is displayable.
|
boolean |
isInherit()
Method to return true if the text in the TextDescriptor is inheritable.
|
boolean |
isInterior()
Method to return true if the text in the TextDescriptor is interior.
|
boolean |
isItalic()
Method to return true if the text in the TextDescriptor is italic.
|
boolean |
isParam()
Method to return true if the text in the TextDescriptor is a parameter.
|
boolean |
isUnderline()
Method to return true if the text in the TextDescriptor is underlined.
|
long |
lowLevelGet()
Low-level method to get the bits in the TextDescriptor.
|
int |
lowLevelGet0()
Low-level method to get the first word of the bits in the TextDescriptor.
|
int |
lowLevelGet1()
Low-level method to get the second word of the bits in the TextDescriptor.
|
static TextDescriptor |
newTextDescriptor(com.sun.electric.database.variable.AbstractTextDescriptor td) |
TextDescriptor |
withAbsSize(int s)
Returns TextDescriptor which differs from this TextDescriptor by text size.
|
TextDescriptor |
withBold(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by bold flag.
|
TextDescriptor |
withColorIndex(int colorIndex)
Returns TextDescriptor which differs from this TextDescriptor by colorIndex.
|
TextDescriptor |
withDisplay(AbstractTextDescriptor.Display display)
Returns TextDescriptor which differs from this TextDescriptor by displayable mode.
|
TextDescriptor |
withDisplay(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by displayable flag.
|
TextDescriptor |
withDisplayWithoutParam() |
TextDescriptor |
withDispPart(AbstractTextDescriptor.DispPos dispPos)
Returns TextDescriptor which differs from this TextDescriptor by dislay part.
|
TextDescriptor |
withFace(int f)
Returns TextDescriptor which differs from this TextDescriptor by text font.
|
TextDescriptor |
withInherit(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by inheritable flag.
|
TextDescriptor |
withInterior(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by interior flag.
|
TextDescriptor |
withItalic(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by italic flag.
|
TextDescriptor |
withOff(double xd,
double yd)
Returns TextDescriptor which differs from this TextDescriptor by
X and Y offsets of the text in the Variable's TextDescriptor.
|
TextDescriptor |
withParam(boolean state)
Returns TextDescriptor which deffers from this TextDescriptor by parameter flag.
|
TextDescriptor |
withPos(AbstractTextDescriptor.Position p)
Returns TextDescriptor which differs from this TextDescriptor by position.
|
TextDescriptor |
withRelSize(double s)
Returns TextDescriptor which differs from this TextDescriptor by text size.
|
TextDescriptor |
withRotation(AbstractTextDescriptor.Rotation r)
Returns TextDescriptor which differs from this TextDescriptor by rotation.
|
TextDescriptor |
withUnderline(boolean state)
Returns TextDescriptor which differs from this TextDescriptor by underline flag.
|
TextDescriptor |
withUnit(AbstractTextDescriptor.Unit u)
Returns TextDescriptor which differs from this TextDescriptor by unit.
|
public static final TextDescriptor EMPTY
public static TextDescriptor newTextDescriptor(com.sun.electric.database.variable.AbstractTextDescriptor td)
public TextDescriptor withDisplay(boolean state)
state
- true, if new TextDescriptor is displayable.public TextDescriptor withDisplay(AbstractTextDescriptor.Display display)
display
- new displayable mode.public TextDescriptor withPos(AbstractTextDescriptor.Position p)
p
- the text position of new TextDescriptor.java.lang.NullPointerException
- if p is null.public TextDescriptor withAbsSize(int s)
s
- the point size of new TextDescriptor.public TextDescriptor withRelSize(double s)
s
- the unit size of new TextDescriptor.public TextDescriptor withFace(int f)
f
- the text font of new TextDescriptor.public TextDescriptor withRotation(AbstractTextDescriptor.Rotation r)
r
- the text rotation of new TextDescriptor.public TextDescriptor withDispPart(AbstractTextDescriptor.DispPos dispPos)
dispPos
- the text display part of new TextDescriptor.java.lang.NullPointerException
- if dispPos is nullpublic TextDescriptor withItalic(boolean state)
state
- true if text of new TextDescriptor is italic.public TextDescriptor withBold(boolean state)
state
- true if text of new TextDescriptor is bold.public TextDescriptor withUnderline(boolean state)
state
- true if text of new TextDescriptor is underlined.public TextDescriptor withInterior(boolean state)
state
- true if text with new TextDescriptor is interior.public TextDescriptor withInherit(boolean state)
state
- true if Variable with new TextDescriptor is inheritable.public TextDescriptor withParam(boolean state)
state
- true if Variable with new TextDescriptor is parameter.public TextDescriptor withOff(double xd, double yd)
xd
- the X offset of the text in new Variable's TextDescriptor.yd
- the Y offset of the text in new Variable's TextDescriptor.public TextDescriptor withUnit(AbstractTextDescriptor.Unit u)
u
- the Unit of new TextDescriptor.public TextDescriptor withColorIndex(int colorIndex)
colorIndex
- color index of new TextDescriptor.public TextDescriptor withDisplayWithoutParam()
public static int cacheSize()
public AbstractTextDescriptor.Display getDisplay()
public long lowLevelGet()
public int getColorIndex()
public static TextDescriptor getNodeTextDescriptor()
public static TextDescriptor getArcTextDescriptor()
public static TextDescriptor getExportTextDescriptor()
public static TextDescriptor getPortInstTextDescriptor()
public static TextDescriptor getAnnotationTextDescriptor()
public static TextDescriptor getInstanceTextDescriptor()
public static TextDescriptor getCellTextDescriptor()
public int hashCode()
TextDescriptor
.hashCode
in class java.lang.Object
public boolean equals(java.lang.Object anObject)
true
if and only if the argument is not
null
and is a TextDescriptor
object with
the same fields.equals
in class java.lang.Object
anObject
- the object to compare this TextDescriptor
against.true
if the TextDescriptor
are equal;
false
otherwise.public int lowLevelGet0()
public int lowLevelGet1()
public boolean isDisplay()
public AbstractTextDescriptor.Position getPos()
public boolean isAbsoluteSize()
public AbstractTextDescriptor.Size getSize()
public static int getDefaultFontSize()
public double getTrueSize(EditWindow0 wnd)
wnd
- the EditWindow0 in which drawing will occur.public double getTrueSize(double scale, EditWindow0 wnd)
scale
- scale to draw.wnd
- the EditWindow0 in which drawing will occur.public int getFace()
public java.awt.Font getFont(EditWindow0 wnd, int minimalTextSize)
wnd
- the EditWindow0 in which drawing will occur.minimalTextSize
- Return null for texts smaller than thispublic static java.awt.Font getDefaultFont()
public static java.awt.font.GlyphVector getGlyphs(java.lang.String text, java.awt.Font font)
text
- the string to convert.font
- the Font to use.public AbstractTextDescriptor.Rotation getRotation()
public AbstractTextDescriptor.DispPos getDispPart()
public boolean isItalic()
public boolean isBold()
public boolean isUnderline()
public boolean isInterior()
public boolean isInherit()
public boolean isParam()
public double getXOff()
public double getYOff()
public AbstractTextDescriptor.Unit getUnit()