public class DasAnnotation extends DasCanvasComponent
Modifier and Type | Class and Description |
---|---|
static class |
DasAnnotation.DatumPairPointDescriptor
create a PointDescriptor using and x and y Datum.
|
static interface |
DasAnnotation.PointDescriptor
something to point at
|
DasCanvasComponent.CanvasComponentAction
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_ANCHORBACKGROUND |
static java.lang.String |
PROP_ANCHORBORDERTYPE |
static java.lang.String |
PROP_ANCHOROFFSET |
static java.lang.String |
PROP_ANCHORPOSITION |
static java.lang.String |
PROP_ANCHORTYPE |
static java.lang.String |
PROP_ARROWSTYLE |
static java.lang.String |
PROP_BORDERTYPE |
static java.lang.String |
PROP_FONT_SIZE
the font size in pixels.
|
static java.lang.String |
PROP_GLOW |
static java.lang.String |
PROP_LINETHICKNESS |
static java.lang.String |
PROP_OVERRIDECOLORS |
static java.lang.String |
PROP_PADDING
the amount of space between the text and the border, measured
in ems, pts, pxs, or percents.
|
static java.lang.String |
PROP_POINTATOFFSET |
static java.lang.String |
PROP_POINTATX |
static java.lang.String |
PROP_POINTATY |
static java.lang.String |
PROP_REFERENCEX |
static java.lang.String |
PROP_REFERENCEY |
static java.lang.String |
PROP_ROTATE |
static java.lang.String |
PROP_SCALE |
static java.lang.String |
PROP_SHOWARROW |
static java.lang.String |
PROP_SPLITANCHORTYPE |
static java.lang.String |
PROP_SYMBOL |
static java.lang.String |
PROP_TEXT |
static java.lang.String |
PROP_TEXTCOLOR |
static java.lang.String |
PROP_URL |
static java.lang.String |
PROP_VERTICALANCHORTYPE |
static java.lang.String |
PROP_XRANGE |
static java.lang.String |
PROP_YRANGE |
mouseAdapter, PROP_OPAQUEBACKGROUND, PROPERTIES_ACTION
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DasAnnotation(java.lang.String string)
Create the annotation
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptContext(int x,
int y)
returns true if the component is suitable context for the point.
|
void |
addPainter(java.lang.String id,
GrannyTextRenderer.Painter p)
add a painter for the grannyTextRenderer.
|
void |
clearPainters()
remove all the painters
|
boolean |
contains(int x,
int y)
This item should only accept mouse events on the bubble
|
java.awt.Shape |
getActiveRegion()
returns the active region of the canvas component, which is not necessarily the bounds.
|
java.awt.Color |
getAnchorBackground() |
BorderType |
getAnchorBorderType() |
java.lang.String |
getAnchorOffset() |
AnchorPosition |
getAnchorPosition()
get the location within the box where the annotation will be drawn.
|
AnchorType |
getAnchorType() |
Arrow.HeadStyle |
getArrowStyle()
get the arrow style
|
BorderType |
getBorderType()
the border type
|
float |
getFontSize()
the font size in points.
|
java.lang.String |
getLineThickness() |
java.lang.String |
getPadding() |
DasAnnotation.PointDescriptor |
getPointAt()
return the thing we are pointing at.
|
java.lang.String |
getPointAtOffset() |
Datum |
getPointAtX() |
Datum |
getPointAtY() |
java.lang.String |
getReferenceX() |
java.lang.String |
getReferenceY() |
int |
getRotate() |
double |
getScale() |
PlotSymbol |
getSymbol() |
java.lang.String |
getText()
get the text, which can be Granny Text.
|
java.awt.Color |
getTextColor() |
java.lang.String |
getUrl() |
AnchorType |
getVerticalAnchorType() |
DatumRange |
getXrange() |
DatumRange |
getYrange() |
protected void |
installComponent()
currently does nothing.
|
boolean |
isGlow() |
boolean |
isOverrideColors() |
boolean |
isShowArrow() |
boolean |
isSplitAnchorType() |
void |
paintComponent(java.awt.Graphics g1) |
void |
removePainter(java.lang.String id)
remove the painter with the given id.
|
void |
resize()
Called by the DasCanvas layout manager to request this component
to set its bounds.
|
void |
setAnchorBackground(java.awt.Color anchorBackground) |
void |
setAnchorBorderType(BorderType anchorBorderType) |
void |
setAnchorOffset(java.lang.String anchorOffset)
the offset in x and y for the text bubble from the anchor.
|
void |
setAnchorPosition(AnchorPosition anchorPosition)
set the location within the box where the annotation will be drawn.
|
void |
setAnchorType(AnchorType anchorType) |
void |
setArrowStyle(Arrow.HeadStyle newarrowStyle)
set the arrow style to BIG,SMALL,DRAFTING.
|
void |
setBorderType(BorderType newborderType)
set the border type to NONE, rounded rectangle, etc.
|
void |
setFontSize(float fontSize)
override the canvas font size.
|
void |
setGlow(boolean glow) |
void |
setLineThickness(java.lang.String lineThickness) |
void |
setOverrideColors(boolean overrideColors)
true will use the colors specified, otherwise the canvas colors are used.
|
void |
setPadding(java.lang.String padding) |
void |
setPlot(DasPlot p) |
void |
setPointAt(DasAnnotation.PointDescriptor p)
set the thing to point at.
|
void |
setPointAtOffset(java.lang.String pointAtOffset) |
void |
setPointAtX(Datum pointAtX) |
void |
setPointAtY(Datum pointAtY) |
void |
setReferenceX(java.lang.String referenceX)
single or semicolon-separated list of values.
|
void |
setReferenceY(java.lang.String referenceY)
single or semicolon-separated list of values.
|
void |
setRotate(int rotate) |
void |
setScale(double scale)
set the amount to scale the image by, if using URL to point at an image, where 0.5 is half of the
original image size.
|
void |
setShowArrow(boolean showArrow) |
void |
setSplitAnchorType(boolean splitAnchorType) |
void |
setSymbol(PlotSymbol symbol)
set the symbol used to mark the reference locations
|
void |
setText(java.lang.String string)
Set the text, which can be Granny Text, or image URL.
|
void |
setTextColor(java.awt.Color textColor)
the color of the text, or if transparent then the border
color should be used.
|
void |
setUrl(java.lang.String url)
set the URL to the location of a png or jpg file.
|
void |
setVerticalAnchorType(AnchorType verticalAnchorType)
when splitAnchorType==True, use this for the vertical position instead
of the anchorType property.
|
void |
setXrange(DatumRange xrange) |
void |
setYrange(DatumRange yrange) |
addMouseModule, coalesceEvents, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getLineThicknessDouble, getRow, isOpaqueBackground, processDasUpdateEvent, processEvent, removeMouseModule, setColumn, setDasName, setOpaqueBackground, setRow, showProperties, toString, uninstallComponent, update, updateImmediately
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PROP_TEXT
public static final java.lang.String PROP_URL
public static final java.lang.String PROP_PADDING
public static final java.lang.String PROP_SCALE
public static final java.lang.String PROP_FONT_SIZE
public static final java.lang.String PROP_BORDERTYPE
public static final java.lang.String PROP_ANCHORPOSITION
public static final java.lang.String PROP_XRANGE
public static final java.lang.String PROP_YRANGE
public static final java.lang.String PROP_POINTATX
public static final java.lang.String PROP_POINTATY
public static final java.lang.String PROP_REFERENCEX
public static final java.lang.String PROP_REFERENCEY
public static final java.lang.String PROP_ROTATE
public static final java.lang.String PROP_GLOW
public static final java.lang.String PROP_SYMBOL
public static final java.lang.String PROP_POINTATOFFSET
public static final java.lang.String PROP_SHOWARROW
public static final java.lang.String PROP_ANCHORBORDERTYPE
public static final java.lang.String PROP_ANCHORBACKGROUND
public static final java.lang.String PROP_ANCHORTYPE
public static final java.lang.String PROP_SPLITANCHORTYPE
public static final java.lang.String PROP_VERTICALANCHORTYPE
public static final java.lang.String PROP_ARROWSTYLE
public static final java.lang.String PROP_LINETHICKNESS
public static final java.lang.String PROP_OVERRIDECOLORS
public static final java.lang.String PROP_TEXTCOLOR
public static final java.lang.String PROP_ANCHOROFFSET
public DasAnnotation(java.lang.String string)
string
- the message, which may contain %p which will be replaced with a label.public void addPainter(java.lang.String id, GrannyTextRenderer.Painter p)
id
- id for the painter, where the id is found in the granny text stringp
- the painter code which draws on a graphics context.GrannyTextRenderer.addPainter(java.lang.String, org.das2.util.GrannyTextRenderer.Painter)
public void removePainter(java.lang.String id)
id
- id for the painter, where the id is found in the granny text stringpublic void clearPainters()
public void setText(java.lang.String string)
string
- the textGrannyTextRenderer
public java.lang.String getText()
GrannyTextRenderer
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- public java.lang.String getPadding()
public void setPadding(java.lang.String padding)
public double getScale()
public void setScale(double scale)
scale
- public void resize()
DasCanvasComponent
resize
in class DasCanvasComponent
public java.awt.Shape getActiveRegion()
DasCanvasComponent
getActiveRegion
in class DasCanvasComponent
public boolean acceptContext(int x, int y)
DasCanvasComponent
acceptContext
in class DasCanvasComponent
x
- the x location on the canvas, with (0,0) being the upper-left corner.y
- the y location on the canvas, with (0,0) being the upper-left corner.public boolean contains(int x, int y)
contains
in class javax.swing.JComponent
x
- y
- public void paintComponent(java.awt.Graphics g1)
paintComponent
in class javax.swing.JComponent
public void setPointAt(DasAnnotation.PointDescriptor p)
p
- the thing.public DasAnnotation.PointDescriptor getPointAt()
protected void installComponent()
DasCanvasComponent
installComponent
in class DasCanvasComponent
public float getFontSize()
public void setFontSize(float fontSize)
fontSize
- New value of property fontSize.public BorderType getBorderType()
public void setBorderType(BorderType newborderType)
newborderType
- the border typepublic AnchorPosition getAnchorPosition()
public void setAnchorPosition(AnchorPosition anchorPosition)
anchorPosition
- public void setPlot(DasPlot p)
public DatumRange getXrange()
public void setXrange(DatumRange xrange)
public DatumRange getYrange()
public void setYrange(DatumRange yrange)
public Datum getPointAtX()
public void setPointAtX(Datum pointAtX)
public Datum getPointAtY()
public void setPointAtY(Datum pointAtY)
public java.lang.String getReferenceX()
public void setReferenceX(java.lang.String referenceX)
referenceX
- public java.lang.String getReferenceY()
public void setReferenceY(java.lang.String referenceY)
referenceY
- public int getRotate()
public void setRotate(int rotate)
public boolean isGlow()
public void setGlow(boolean glow)
public PlotSymbol getSymbol()
public void setSymbol(PlotSymbol symbol)
symbol
- public java.lang.String getPointAtOffset()
public void setPointAtOffset(java.lang.String pointAtOffset)
public boolean isShowArrow()
public void setShowArrow(boolean showArrow)
public BorderType getAnchorBorderType()
public void setAnchorBorderType(BorderType anchorBorderType)
public java.awt.Color getAnchorBackground()
public void setAnchorBackground(java.awt.Color anchorBackground)
public AnchorType getAnchorType()
public void setAnchorType(AnchorType anchorType)
public boolean isSplitAnchorType()
public void setSplitAnchorType(boolean splitAnchorType)
public AnchorType getVerticalAnchorType()
public void setVerticalAnchorType(AnchorType verticalAnchorType)
verticalAnchorType
- public Arrow.HeadStyle getArrowStyle()
public void setArrowStyle(Arrow.HeadStyle newarrowStyle)
newarrowStyle
- the arrow stylepublic java.lang.String getLineThickness()
public void setLineThickness(java.lang.String lineThickness)
public boolean isOverrideColors()
public void setOverrideColors(boolean overrideColors)
overrideColors
- public java.awt.Color getTextColor()
public void setTextColor(java.awt.Color textColor)
textColor
- public java.lang.String getAnchorOffset()
public void setAnchorOffset(java.lang.String anchorOffset)
anchorOffset
-