org.das2.graph
Class DasAnnotation

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.das2.graph.DasCanvasComponent
                  extended by org.das2.graph.DasAnnotation
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, Editable

public class DasAnnotation
extends DasCanvasComponent

This component-izes a GrannyTextRenderer, and composes with an Arrow.

See Also:
Serialized Form

Nested Class Summary
static class DasAnnotation.BorderType
           
static class DasAnnotation.DatumPairPointDescriptor
           
static interface DasAnnotation.PointDescriptor
           
 
Nested classes/interfaces inherited from class org.das2.graph.DasCanvasComponent
DasCanvasComponent.CanvasComponentAction
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String PROP_ARROWSTYLE
           
static java.lang.String PROP_BORDERTYPE
           
 
Fields inherited from class org.das2.graph.DasCanvasComponent
mouseAdapter, PROPERTIES_ACTION
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DasAnnotation(java.lang.String string)
          Creates a new instance of DasAnnotation
 
Method Summary
 boolean acceptContext(int x, int y)
          returns true if the component is suitable context for the point.
 java.awt.Shape getActiveRegion()
          returns the active region of the canvas component, which is not necessarily the bounds.
 Arrow.HeadStyle getArrowStyle()
           
 DasAnnotation.BorderType getBorderType()
           
 float getFontSize()
          Getter for property fontSize.
 DasAnnotation.PointDescriptor getPointAt()
           
 java.lang.String getText()
           
protected  void installComponent()
           
 void paintComponent(java.awt.Graphics g1)
           
 void resize()
          Called by the DasCanvas layout manager to request this component to set its bounds.
 void setArrowStyle(Arrow.HeadStyle newarrowStyle)
           
 void setBorderType(DasAnnotation.BorderType newborderType)
           
 void setFontSize(float fontSize)
          override the canvas font size.
 void setPointAt(DasAnnotation.PointDescriptor p)
           
 void setText(java.lang.String string)
           
 
Methods inherited from class org.das2.graph.DasCanvasComponent
addMouseModule, coalesceEvents, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getMouseAdapter, getRow, processDasUpdateEvent, processEvent, removeMouseModule, setBounds, setBounds, setColumn, setDasMouseInputAdapter, setDasName, setRow, showProperties, toString, uninstallComponent, update, updateImmediately
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, 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, hide, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_BORDERTYPE

public static final java.lang.String PROP_BORDERTYPE
See Also:
Constant Field Values

PROP_ARROWSTYLE

public static final java.lang.String PROP_ARROWSTYLE
See Also:
Constant Field Values
Constructor Detail

DasAnnotation

public DasAnnotation(java.lang.String string)
Creates a new instance of DasAnnotation

Method Detail

setText

public void setText(java.lang.String string)

getText

public java.lang.String getText()

resize

public void resize()
Description copied from class: DasCanvasComponent
Called by the DasCanvas layout manager to request this component to set its bounds.

Overrides:
resize in class DasCanvasComponent

getActiveRegion

public java.awt.Shape getActiveRegion()
Description copied from class: DasCanvasComponent
returns the active region of the canvas component, which is not necessarily the bounds.

Overrides:
getActiveRegion in class DasCanvasComponent

acceptContext

public boolean acceptContext(int x,
                             int y)
Description copied from class: DasCanvasComponent
returns true if the component is suitable context for the point. For example, the operator right-clicks at the point, is this point a transparent region of the component, and accepting context would be confusing to the operator? This was first introduced to support the annotation component, which draws a compact background bubble around a message, which is typically smaller than its bounds, plus an arrow.

Overrides:
acceptContext in class DasCanvasComponent
Returns:
true if the component accepts the context at this point.

paintComponent

public void paintComponent(java.awt.Graphics g1)
Overrides:
paintComponent in class javax.swing.JComponent

setPointAt

public void setPointAt(DasAnnotation.PointDescriptor p)

getPointAt

public DasAnnotation.PointDescriptor getPointAt()

installComponent

protected void installComponent()
Overrides:
installComponent in class DasCanvasComponent

getFontSize

public float getFontSize()
Getter for property fontSize.

Returns:
Value of property fontSize.

setFontSize

public void setFontSize(float fontSize)
override the canvas font size. If zero, then use the canvas size, otherwise, use this size.

Parameters:
fontSize - New value of property fontSize.

getBorderType

public DasAnnotation.BorderType getBorderType()

setBorderType

public void setBorderType(DasAnnotation.BorderType newborderType)

getArrowStyle

public Arrow.HeadStyle getArrowStyle()

setArrowStyle

public void setArrowStyle(Arrow.HeadStyle newarrowStyle)