public abstract class CallOut extends JPanel
Stencil
applied to the application's window.
This class provides the basic functionality but is not meant
to be instantiated, only used as base for the actual classes
that customize the appearance of the call-out by overriding
paintComponent(Graphics)
Modifier and Type | Class and Description |
---|---|
protected class |
CallOut.Content |
protected class |
CallOut.Target |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected Paint |
background |
protected Vector<Line2D> |
connectors |
protected CallOut.Content |
content |
protected Point |
contentLocation |
protected String |
fontFamily |
protected int |
fontSize |
protected Highlight |
highlight |
protected Vector<CallOut.Target> |
highlightTargets |
protected Stroke |
stroke |
protected Paint |
strokePaint |
protected Vector<CallOut.Target> |
targets |
protected boolean |
targetsChanged |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
protected |
CallOut() |
Modifier and Type | Method and Description |
---|---|
Component |
add(Component component) |
Component |
add(Component component,
int index) |
void |
add(Component component,
Object constraints) |
Component |
add(String name,
Component component) |
void |
addHighlightTarget(JComponent target)
Add a highlight target.
|
void |
addTarget(JComponent target)
Add a target for the call-out.
|
protected void |
checkTargetChanges() |
protected Line2D |
computeConnector(JComponent targetComponent) |
protected Line2D |
computeConnector(Rectangle target) |
void |
doLayout() |
protected Point |
findPlaceFor(Dimension size)
Find a place for the given source that does not conflict with the targets.
|
Rectangle |
getContentBounds()
Get the bounding box of the call-out's content.
|
void |
paint(Graphics g) |
abstract void |
paintComponent(Graphics g)
Paint the call-out.
|
void |
setBackground(Color colour) |
void |
setBackground(Paint paint)
Set the background paint.
|
Component |
setContent(String innerHTML)
Set the content of the call-out to the given HTML text.
|
void |
setHighlight(Highlight highlight)
Set the highlight to be used for hightlight targets.
|
void |
setStroke(Paint paint,
float thickness)
Set the stroke for border drawing.
|
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, 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, 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, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected Paint strokePaint
protected Stroke stroke
protected Paint background
protected Highlight highlight
protected int fontSize
protected String fontFamily
protected CallOut.Content content
protected Point contentLocation
protected Vector<CallOut.Target> targets
protected Vector<CallOut.Target> highlightTargets
protected boolean targetsChanged
public void setStroke(Paint paint, float thickness)
paint
- colour, texture, etc.thickness
- floating-point number in pixels, e.g. 2.0fpublic void setBackground(Paint paint)
paint
- colour, texture, etc.public void setBackground(Color colour)
setBackground
in class JComponent
public void setHighlight(Highlight highlight)
highlight
- the highlight style to be usedpublic void addTarget(JComponent target)
target
- component that gets this call-out assigned to itpublic void addHighlightTarget(JComponent target)
target
- component that gets this highlight assigned to itpublic Component setContent(String innerHTML)
innerHTML
- new content as HTMLpublic Rectangle getContentBounds()
public abstract void paintComponent(Graphics g)
paint(Graphics)
When this function is called, the variable
targetsChanged
is true
if there have been changes in the position
or size of the targets, so that any cached computations can be
updated.paintComponent
in class JComponent
g
- graphics context where the call-out will be paintedpublic void paint(Graphics g)
paint
in class JComponent
protected Line2D computeConnector(JComponent targetComponent)
protected void checkTargetChanges()