Package ucar.unidata.ui.drawing
Class Glyph
java.lang.Object
ucar.unidata.ui.drawing.Glyph
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
LineGlyph,PolyGlyph,RectangleGlyph
Base (abstract) class for representing things that are drawn on
the screen. Holds some basic attributes (but no positional attrs)
and has a facility for recreating itself via xml.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_int_more_static final int_more_static final Color_more_static Hashtable_more_static final intSome global constsstatic final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String_more_static final String[]_more_static final String[]_more_static final int_more_static final String_more_boolean_more__more_ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidHook for when the size or position of this glyph is changedboolean_more_protected Objectclone()_more_abstract doubledistance(int x, int y) _more_static doubledistance(int x1, int y1, int x2, int y2) Utility method for distance between two pointsvoiddoRemove()_more_static String_more_getAttrs()_more__more_getBackground(Color dflt) _more_boolean_more_abstract Rectangle_more_getCreateCommand(DisplayCanvas canvas, AWTEvent event, int x, int y) _more_static Cursor_more_boolean_more__more_getId()_more_int_more_getMoveCommand(DisplayCanvas canvas, AWTEvent event, int x, int y) _more_boolean_more_static Point2DgetPointOnRect(String pt, Rectangle2D r) _more_static Point2DgetPointOnRect(String pt, Rectangle2D r, Point2D point) _more_static StringgetRectPointName(String rectPoint) _more__more_getStretchPoint(int x, int y) _more_static StringgetStretchPoint(RectangularShape r, int x, int y) _more_boolean_more_getXml()Return the string used to recreate mevoidinitDone()_more__more_abstract voidmoveBy(int x, int y) _more_abstract voidmoveTo(int x, int y) _more_void_more_voidpaint(Graphics g, DisplayCanvas c) _more_void_more_voidBy default paint little black rectangles at the corners and the sidesstatic voidpaintSelectionPoints(Graphics g, RectangularShape r, int size) By default paint little black rectangles at the corners and the sidesbooleanpickable()_more_voidA Glyph can write out a persistent copy of itself as a set of attribute/value pairs.voidset my named atttribute to valuevoid_more_voidsetBeingCreated(boolean b) _more_voidsetFilled(boolean c) _more_void_more_void_more_voidsetLineWidth(int value) _more_voidsetParent(CompositeGlyph newParent) _more_voidsetPoints(int[] p, int cnt) Hook for setting points from the attribute linevoidsetStretchy(boolean b) _more__more_static String_more_static StringstretchTo(Rectangle bounds, int x, int y, String pt, boolean correct, boolean symetric, boolean equalSides) _more_static Rectangle_more_transformOutput(DisplayCanvas canvas, Point r) _more_transformOutput(DisplayCanvas canvas, Rectangle r) _more_inttransformOutputX(DisplayCanvas canvas, int x) _more_inttransformOutputY(DisplayCanvas canvas, int x) _more_
-
Field Details
-
TAG_GLYPH
_more_- See Also:
-
ATTR_CLASS
_more_- See Also:
-
PT_CENTER
_more_- See Also:
-
PT_V_UPPER
_more_- See Also:
-
PT_V_MIDDLE
_more_- See Also:
-
PT_V_LOWER
_more_- See Also:
-
PT_H_LEFT
_more_- See Also:
-
PT_H_MIDDLE
_more_- See Also:
-
PT_H_RIGHT
_more_- See Also:
-
PT_UL
_more_- See Also:
-
PT_UM
_more_- See Also:
-
PT_UR
_more_- See Also:
-
PT_ML
_more_- See Also:
-
PT_MM
_more_- See Also:
-
PT_MR
_more_- See Also:
-
PT_LL
_more_- See Also:
-
PT_LM
_more_- See Also:
-
PT_LR
_more_- See Also:
-
RECTPOINTS
_more_ -
RECTPOINTNAMES
_more_ -
PT_PREFIX
_more_- See Also:
-
PT_P1
_more_- See Also:
-
PT_P2
_more_- See Also:
-
ATTR_CHILDREN
_more_- See Also:
-
ATTR_COLOR
_more_- See Also:
-
ATTR_BGCOLOR
_more_- See Also:
-
ATTR_FILL
_more_- See Also:
-
ATTR_HEIGHT
_more_- See Also:
-
ATTR_IMAGE
_more_- See Also:
-
ATTR_LINEWIDTH
_more_- See Also:
-
ATTR_PARENT
_more_- See Also:
-
ATTR_PTS
_more_- See Also:
-
ATTR_STRETCHY
_more_- See Also:
-
ATTR_TEXT
_more_- See Also:
-
ATTR_TYPE
_more_- See Also:
-
ATTR_WIDTH
_more_- See Also:
-
idToGlyph
_more_ -
MIN_DISTANCE_TO_STRETCH
public static final int MIN_DISTANCE_TO_STRETCHSome global consts- See Also:
-
SEL_WIDTH
public static final int SEL_WIDTH_more_- See Also:
-
H_SEL_WIDTH
public static final int H_SEL_WIDTH_more_- See Also:
-
highlightColor
_more_ -
underline
public boolean underline_more_ -
url
_more_ -
baseline
public int baseline_more_
-
-
Constructor Details
-
Glyph
public Glyph()_more_
-
-
Method Details
-
getCursor
_more_- Parameters:
rectPoint- _more_- Returns:
- _more_
-
getRectPointName
_more_- Parameters:
rectPoint-- Returns:
- _more_
-
paintSelectionPoints
By default paint little black rectangles at the corners and the sides- Parameters:
g- The graphics to paint intor- The rectangle to decoratesize- Box size
-
flipY
_more_- Parameters:
pt-- Returns:
- _more_
-
getPointOnRect
_more_- Parameters:
pt-r-- Returns:
- _more_
-
toRect
_more_- Parameters:
r- _more_- Returns:
- _more_
-
getStretchPoint
_more_- Parameters:
r- _more_x-y-- Returns:
- _more_
-
getPointOnRect
_more_- Parameters:
pt- The point specr- The rectanglepoint- The point to set- Returns:
- _more_
-
stretchTo
_more_- Parameters:
bounds-x-y-pt-- Returns:
- _more_
-
stretchTo
public static String stretchTo(Rectangle bounds, int x, int y, String pt, boolean correct, boolean symetric, boolean equalSides) _more_- Parameters:
bounds- _more_x-y-pt-correct-symetric- _more_equalSides- _more_- Returns:
- _more_
-
getStretchy
public boolean getStretchy()_more_- Returns:
- _more_
-
setStretchy
public void setStretchy(boolean b) _more_- Parameters:
b-
-
setBeingCreated
public void setBeingCreated(boolean b) _more_- Parameters:
b-
-
getBeingCreated
public boolean getBeingCreated()_more_- Returns:
- _more_
-
initDone
public void initDone()_more_ -
setId
_more_- Parameters:
newId-
-
getId
_more_- Returns:
- _more_
-
doRemove
public void doRemove()_more_ -
setParent
_more_- Parameters:
newParent-
-
pickable
public boolean pickable()_more_- Returns:
- _more_
-
notifyChange
public void notifyChange()_more_ -
getCreateCommand
_more_- Parameters:
canvas-event-x-y-- Returns:
- _more_
-
getMoveCommand
_more_- Parameters:
canvas-event-x-y-- Returns:
- _more_
-
clone
_more_- Overrides:
clonein classObject- Returns:
- _more_
- Throws:
CloneNotSupportedException
-
getPersistent
public boolean getPersistent()_more_- Returns:
- _more_
-
canStretch
public boolean canStretch()_more_- Returns:
- _more_
-
boundsChanged
public void boundsChanged()Hook for when the size or position of this glyph is changed -
setPoints
public void setPoints(int[] p, int cnt) Hook for setting points from the attribute line- Parameters:
p-cnt-
-
setForeground
_more_- Parameters:
c-
-
getForeground
_more_- Returns:
- _more_
-
setBackground
_more_- Parameters:
c-
-
getBackground
_more_- Returns:
- _more_
-
getBackground
_more_- Parameters:
dflt-- Returns:
- _more_
-
setLineWidth
public void setLineWidth(int value) _more_- Parameters:
value-
-
getLineWidth
public int getLineWidth()_more_- Returns:
- _more_
-
setFilled
public void setFilled(boolean c) _more_- Parameters:
c-
-
getFilled
public boolean getFilled()_more_- Returns:
- _more_
-
processAttrs
A Glyph can write out a persistent copy of itself as a set of attribute/value pairs. This method parses the line of attr/values of the form: ATTR=VALUE;ATTR=VALUE;- Parameters:
s-
-
setAttr
set my named atttribute to value- Parameters:
name-value-
-
getXml
Return the string used to recreate me- Returns:
- _more_
-
makeAttr
_more_- Parameters:
name-value-- Returns:
- _more_
-
getAttrs
_more_- Returns:
- _more_
-
paint
_more_- Parameters:
g-c-
-
paintSelection
By default paint little black rectangles at the corners and the sides- Parameters:
g-c-
-
paintHighlight
_more_- Parameters:
g-c-
-
distance
public abstract double distance(int x, int y) _more_- Parameters:
x-y-- Returns:
- _more_
-
moveBy
public abstract void moveBy(int x, int y) _more_- Parameters:
x-y-
-
moveTo
public abstract void moveTo(int x, int y) _more_- Parameters:
x-y-
-
getBounds
_more_- Returns:
- _more_
-
getRepaintBounds
_more_- Returns:
- _more_
-
getStretchPoint
_more_- Parameters:
x-y-- Returns:
- _more_
-
stretchTo
_more_- Parameters:
x-y-pt-correct-- Returns:
- _more_
-
distance
public static double distance(int x1, int y1, int x2, int y2) Utility method for distance between two points- Parameters:
x1-y1-x2-y2-- Returns:
- _more_
-
transformOutputX
_more_- Parameters:
canvas-x-- Returns:
- _more_
-
transformOutputY
_more_- Parameters:
canvas-x-- Returns:
- _more_
-
transformOutput
_more_- Parameters:
canvas-r-- Returns:
- _more_
-
transformOutput
_more_- Parameters:
canvas-r-- Returns:
- _more_
-