public class AnnotationListChooser extends javax.swing.JPanel implements TabComponent
AnnotationListChooser
class is a panel that allows
the user to manipulate a list of annotations. The user may add a
new line, polyline, curve, text, box, circle, polygon or closed
curve, and edit the annotation visibility, name, color, linestyle,
or fill color.
The chooser signals a change in the annotation overlay list by
firing a property change event whose property name is given by
ANNOTATION_LIST_PROPERTY
. See the AbstractOverlayListPanel
class for details on how the property
change events should be interpreted.
Annotations require that extra information be provided from the user object. The chooser signals that it requires input for an annotation by firing an action event whose action command specifies the type of input required as:
LINE_COMMAND
POLYLINE_COMMAND
BOX_COMMAND
POLYGON_COMMAND
CIRCLE_COMMAND
CURVE_COMMAND
TEXT_COMMAND
addAnnotation()
method. javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANNOTATION_LIST_PROPERTY
The annotattion list property.
|
static java.lang.String |
BOX_COMMAND
The box annotation command.
|
static java.lang.String |
CIRCLE_COMMAND
The circle annotation command.
|
static java.lang.String |
CURVE_COMMAND
The curve annotation command.
|
static java.lang.String |
LINE_COMMAND
The line annotation command.
|
static java.lang.String |
POLYGON_COMMAND
The polygon annotation command.
|
static java.lang.String |
POLYLINE_COMMAND
The polyline annotation command.
|
static java.lang.String |
TEXT_COMMAND
The text annotation command.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
AnnotationListChooser()
Creates a new annotation list chooser.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(java.awt.Shape shape)
Adds a new annotation.
|
void |
addAnnotationActionListener(java.awt.event.ActionListener listener)
Adds the specified listener for receiving annotation input action
commands.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Redirects overlay property listeners to the list panel.
|
void |
deactivate()
Deactivates the annotation chooser so that no annotation is selected.
|
java.lang.String |
getAnnotationCommand()
Gets the last annotation command executed.
|
javax.swing.Icon |
getIcon()
Gets the annotation list tab icon.
|
java.lang.String |
getTitle()
Gets the annotation list chooser title.
|
java.lang.String |
getToolTip()
Gets the annotation list chooser tooltip.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
add, add, add, add, add, addContainerListener, addImpl, 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, processEvent, 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, coalesceEvents, 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, getFont, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String ANNOTATION_LIST_PROPERTY
public static final java.lang.String LINE_COMMAND
public static final java.lang.String POLYLINE_COMMAND
public static final java.lang.String BOX_COMMAND
public static final java.lang.String POLYGON_COMMAND
public static final java.lang.String CIRCLE_COMMAND
public static final java.lang.String CURVE_COMMAND
public static final java.lang.String TEXT_COMMAND
public AnnotationListChooser()
public java.lang.String getAnnotationCommand()
public void addAnnotationActionListener(java.awt.event.ActionListener listener)
listener
- the listener to add.public java.lang.String getToolTip()
getToolTip
in interface TabComponent
public java.lang.String getTitle()
getTitle
in interface TabComponent
public javax.swing.Icon getIcon()
getIcon
in interface TabComponent
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class java.awt.Container
public void addAnnotation(java.awt.Shape shape)
shape
- the new data annotation shape to add. The shape is
considered to be in data coordinates.public void deactivate()