public abstract class Glyph
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_BGCOLOR
_more_
|
static java.lang.String |
ATTR_CHILDREN
_more_
|
static java.lang.String |
ATTR_CLASS
_more_
|
static java.lang.String |
ATTR_COLOR
_more_
|
static java.lang.String |
ATTR_FILL
_more_
|
static java.lang.String |
ATTR_HEIGHT
_more_
|
static java.lang.String |
ATTR_IMAGE
_more_
|
static java.lang.String |
ATTR_LINEWIDTH
_more_
|
static java.lang.String |
ATTR_PARENT
_more_
|
static java.lang.String |
ATTR_PTS
_more_
|
static java.lang.String |
ATTR_STRETCHY
_more_
|
static java.lang.String |
ATTR_TEXT
_more_
|
static java.lang.String |
ATTR_TYPE
_more_
|
static java.lang.String |
ATTR_WIDTH
_more_
|
int |
baseline
_more_
|
static int |
H_SEL_WIDTH
_more_
|
static java.awt.Color |
highlightColor
_more_
|
static java.util.Hashtable |
idToGlyph
_more_
|
static int |
MIN_DISTANCE_TO_STRETCH
Some global consts
|
static java.lang.String |
PT_CENTER
_more_
|
static java.lang.String |
PT_H_LEFT
_more_
|
static java.lang.String |
PT_H_MIDDLE
_more_
|
static java.lang.String |
PT_H_RIGHT
_more_
|
static java.lang.String |
PT_LL
_more_
|
static java.lang.String |
PT_LM
_more_
|
static java.lang.String |
PT_LR
_more_
|
static java.lang.String |
PT_ML
_more_
|
static java.lang.String |
PT_MM
_more_
|
static java.lang.String |
PT_MR
_more_
|
static java.lang.String |
PT_P1
_more_
|
static java.lang.String |
PT_P2
_more_
|
static java.lang.String |
PT_PREFIX
_more_
|
static java.lang.String |
PT_UL
_more_
|
static java.lang.String |
PT_UM
_more_
|
static java.lang.String |
PT_UR
_more_
|
static java.lang.String |
PT_V_LOWER
_more_
|
static java.lang.String |
PT_V_MIDDLE
_more_
|
static java.lang.String |
PT_V_UPPER
_more_
|
static java.lang.String[] |
RECTPOINTNAMES
_more_
|
static java.lang.String[] |
RECTPOINTS
_more_
|
static int |
SEL_WIDTH
_more_
|
static java.lang.String |
TAG_GLYPH
_more_
|
boolean |
underline
_more_
|
java.lang.String |
url
_more_
|
Constructor and Description |
---|
Glyph()
_more_
|
Modifier and Type | Method and Description |
---|---|
void |
boundsChanged()
Hook for when the size or position of this glyph is changed
|
boolean |
canStretch()
_more_
|
protected java.lang.Object |
clone()
_more_
|
abstract double |
distance(int x,
int y)
_more_
|
static double |
distance(int x1,
int y1,
int x2,
int y2)
Utility method for distance between two points
|
void |
doRemove()
_more_
|
static java.lang.String |
flipY(java.lang.String pt)
_more_
|
java.lang.String |
getAttrs()
_more_
|
java.awt.Color |
getBackground()
_more_
|
java.awt.Color |
getBackground(java.awt.Color dflt)
_more_
|
boolean |
getBeingCreated()
_more_
|
abstract java.awt.Rectangle |
getBounds()
_more_
|
CanvasCommand |
getCreateCommand(DisplayCanvas canvas,
java.awt.AWTEvent event,
int x,
int y)
_more_
|
static java.awt.Cursor |
getCursor(java.lang.String rectPoint)
_more_
|
boolean |
getFilled()
_more_
|
java.awt.Color |
getForeground()
_more_
|
java.lang.String |
getId()
_more_
|
int |
getLineWidth()
_more_
|
CanvasCommand |
getMoveCommand(DisplayCanvas canvas,
java.awt.AWTEvent event,
int x,
int y)
_more_
|
boolean |
getPersistent()
_more_
|
static java.awt.geom.Point2D |
getPointOnRect(java.lang.String pt,
java.awt.geom.Rectangle2D r)
_more_
|
static java.awt.geom.Point2D |
getPointOnRect(java.lang.String pt,
java.awt.geom.Rectangle2D r,
java.awt.geom.Point2D point)
_more_
|
static java.lang.String |
getRectPointName(java.lang.String rectPoint)
_more_
|
java.awt.Rectangle |
getRepaintBounds()
_more_
|
java.lang.String |
getStretchPoint(int x,
int y)
_more_
|
static java.lang.String |
getStretchPoint(java.awt.geom.RectangularShape r,
int x,
int y)
_more_
|
boolean |
getStretchy()
_more_
|
java.lang.String |
getXml()
Return the string used to recreate me
|
void |
initDone()
_more_
|
java.lang.String |
makeAttr(java.lang.String name,
java.lang.String value)
_more_
|
abstract void |
moveBy(int x,
int y)
_more_
|
abstract void |
moveTo(int x,
int y)
_more_
|
void |
notifyChange()
_more_
|
void |
paint(java.awt.Graphics g,
DisplayCanvas c)
_more_
|
void |
paintHighlight(java.awt.Graphics g,
DisplayCanvas c)
_more_
|
void |
paintSelection(java.awt.Graphics g,
DisplayCanvas c)
By default paint little black rectangles at the corners and the sides
|
static void |
paintSelectionPoints(java.awt.Graphics g,
java.awt.geom.RectangularShape r,
int size)
By default paint little black rectangles at the corners and the sides
|
boolean |
pickable()
_more_
|
void |
processAttrs(java.lang.String s)
A Glyph can write out a persistent copy of itself as a set of
attribute/value pairs.
|
void |
setAttr(java.lang.String name,
java.lang.String value)
set my named atttribute to value
|
void |
setBackground(java.awt.Color c)
_more_
|
void |
setBeingCreated(boolean b)
_more_
|
void |
setFilled(boolean c)
_more_
|
void |
setForeground(java.awt.Color c)
_more_
|
void |
setId(java.lang.String newId)
_more_
|
void |
setLineWidth(int value)
_more_
|
void |
setParent(CompositeGlyph newParent)
_more_
|
void |
setPoints(int[] p,
int cnt)
Hook for setting points from the attribute line
|
void |
setStretchy(boolean b)
_more_
|
java.lang.String |
stretchTo(int x,
int y,
java.lang.String pt,
boolean correct)
_more_
|
static java.lang.String |
stretchTo(java.awt.Rectangle bounds,
int x,
int y,
java.lang.String pt)
_more_
|
static java.lang.String |
stretchTo(java.awt.Rectangle bounds,
int x,
int y,
java.lang.String pt,
boolean correct,
boolean symetric,
boolean equalSides)
_more_
|
static java.awt.Rectangle |
toRect(java.awt.geom.RectangularShape r)
_more_
|
java.awt.Point |
transformOutput(DisplayCanvas canvas,
java.awt.Point r)
_more_
|
java.awt.Rectangle |
transformOutput(DisplayCanvas canvas,
java.awt.Rectangle r)
_more_
|
int |
transformOutputX(DisplayCanvas canvas,
int x)
_more_
|
int |
transformOutputY(DisplayCanvas canvas,
int x)
_more_
|
public static final java.lang.String TAG_GLYPH
public static final java.lang.String ATTR_CLASS
public static final java.lang.String PT_CENTER
public static final java.lang.String PT_V_UPPER
public static final java.lang.String PT_V_MIDDLE
public static final java.lang.String PT_V_LOWER
public static final java.lang.String PT_H_LEFT
public static final java.lang.String PT_H_MIDDLE
public static final java.lang.String PT_H_RIGHT
public static final java.lang.String PT_UL
public static final java.lang.String PT_UM
public static final java.lang.String PT_UR
public static final java.lang.String PT_ML
public static final java.lang.String PT_MM
public static final java.lang.String PT_MR
public static final java.lang.String PT_LL
public static final java.lang.String PT_LM
public static final java.lang.String PT_LR
public static final java.lang.String[] RECTPOINTS
public static final java.lang.String[] RECTPOINTNAMES
public static final java.lang.String PT_PREFIX
public static final java.lang.String PT_P1
public static final java.lang.String PT_P2
public static final java.lang.String ATTR_CHILDREN
public static final java.lang.String ATTR_COLOR
public static final java.lang.String ATTR_BGCOLOR
public static final java.lang.String ATTR_FILL
public static final java.lang.String ATTR_HEIGHT
public static final java.lang.String ATTR_IMAGE
public static final java.lang.String ATTR_LINEWIDTH
public static final java.lang.String ATTR_PARENT
public static final java.lang.String ATTR_PTS
public static final java.lang.String ATTR_STRETCHY
public static final java.lang.String ATTR_TEXT
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ATTR_WIDTH
public static java.util.Hashtable idToGlyph
public static final int MIN_DISTANCE_TO_STRETCH
public static final int SEL_WIDTH
public static final int H_SEL_WIDTH
public static final java.awt.Color highlightColor
public boolean underline
public java.lang.String url
public int baseline
public static java.awt.Cursor getCursor(java.lang.String rectPoint)
rectPoint
- _more_public static java.lang.String getRectPointName(java.lang.String rectPoint)
rectPoint
- public static void paintSelectionPoints(java.awt.Graphics g, java.awt.geom.RectangularShape r, int size)
g
- The graphics to paint intor
- The rectangle to decoratesize
- Box sizepublic static java.lang.String flipY(java.lang.String pt)
pt
- public static java.awt.geom.Point2D getPointOnRect(java.lang.String pt, java.awt.geom.Rectangle2D r)
pt
- r
- public static java.awt.Rectangle toRect(java.awt.geom.RectangularShape r)
r
- _more_public static java.lang.String getStretchPoint(java.awt.geom.RectangularShape r, int x, int y)
r
- _more_x
- y
- public static java.awt.geom.Point2D getPointOnRect(java.lang.String pt, java.awt.geom.Rectangle2D r, java.awt.geom.Point2D point)
pt
- The point specr
- The rectanglepoint
- The point to setpublic static java.lang.String stretchTo(java.awt.Rectangle bounds, int x, int y, java.lang.String pt)
bounds
- x
- y
- pt
- public static java.lang.String stretchTo(java.awt.Rectangle bounds, int x, int y, java.lang.String pt, boolean correct, boolean symetric, boolean equalSides)
bounds
- _more_x
- y
- pt
- correct
- symetric
- _more_equalSides
- _more_public boolean getStretchy()
public void setStretchy(boolean b)
b
- public void setBeingCreated(boolean b)
b
- public boolean getBeingCreated()
public void initDone()
public void setId(java.lang.String newId)
newId
- public java.lang.String getId()
public void doRemove()
public void setParent(CompositeGlyph newParent)
newParent
- public boolean pickable()
public void notifyChange()
public CanvasCommand getCreateCommand(DisplayCanvas canvas, java.awt.AWTEvent event, int x, int y)
canvas
- event
- x
- y
- public CanvasCommand getMoveCommand(DisplayCanvas canvas, java.awt.AWTEvent event, int x, int y)
canvas
- event
- x
- y
- protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean getPersistent()
public boolean canStretch()
public void boundsChanged()
public void setPoints(int[] p, int cnt)
p
- cnt
- public void setForeground(java.awt.Color c)
c
- public java.awt.Color getForeground()
public void setBackground(java.awt.Color c)
c
- public java.awt.Color getBackground()
public java.awt.Color getBackground(java.awt.Color dflt)
dflt
- public void setLineWidth(int value)
value
- public int getLineWidth()
public void setFilled(boolean c)
c
- public boolean getFilled()
public void processAttrs(java.lang.String s)
s
- public void setAttr(java.lang.String name, java.lang.String value)
name
- value
- public java.lang.String getXml()
public java.lang.String makeAttr(java.lang.String name, java.lang.String value)
name
- value
- public java.lang.String getAttrs()
public void paint(java.awt.Graphics g, DisplayCanvas c)
g
- c
- public void paintSelection(java.awt.Graphics g, DisplayCanvas c)
g
- c
- public void paintHighlight(java.awt.Graphics g, DisplayCanvas c)
g
- c
- public abstract double distance(int x, int y)
x
- y
- public abstract void moveBy(int x, int y)
x
- y
- public abstract void moveTo(int x, int y)
x
- y
- public abstract java.awt.Rectangle getBounds()
public java.awt.Rectangle getRepaintBounds()
public java.lang.String getStretchPoint(int x, int y)
x
- y
- public java.lang.String stretchTo(int x, int y, java.lang.String pt, boolean correct)
x
- y
- pt
- correct
- public static double distance(int x1, int y1, int x2, int y2)
x1
- y1
- x2
- y2
- public int transformOutputX(DisplayCanvas canvas, int x)
canvas
- x
- public int transformOutputY(DisplayCanvas canvas, int x)
canvas
- x
- public java.awt.Rectangle transformOutput(DisplayCanvas canvas, java.awt.Rectangle r)
canvas
- r
- public java.awt.Point transformOutput(DisplayCanvas canvas, java.awt.Point r)
canvas
- r
-