public class AttachedLabel extends DasCanvasComponent implements java.lang.Cloneable
DasCanvasComponent.CanvasComponentAction
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
axisLabel |
static int |
BOTTOM
This value indicates that the axis should be located at the bottom of its cell
|
static int |
HORIZONTAL
This value indicates that the axis should be oriented horizontally
|
static int |
LEFT
This value indicates that the axis should be located to the left of its cell
|
static int |
RIGHT
This value indicateds that the axis should be located to the right of its cell
|
static int |
TOP
This value indicates that the axis should be located at the top of its cell
|
static int |
VERTICAL
This value indicates that the axis should be oriented vertically
|
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 |
---|
AttachedLabel(java.lang.String label,
int orientation,
double emOffset)
constructs an AttachedLabel.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
clones the component
|
java.awt.Shape |
getActiveRegion()
returns the active region of the canvas component, which is not necessarily the bounds.
|
int |
getDevicePosition()
Deprecated.
It's not clear how this should be used, and it does not appear to be used within dasCore and dasApps.
|
int |
getDLength() |
double |
getEmOffset()
Getter for property emOffset.
|
java.lang.String |
getLabel()
Accessor method for the title property of this axis.
|
protected java.awt.Rectangle |
getLabelBounds()
get the Rectangle precisely enclosing the label.
|
java.awt.Font |
getLabelFont()
get the current font of the compoennt.
|
int |
getOrientation()
return orientation int
|
protected int |
getTitlePositionOffset()
calculates the distance from the box to the label.
|
boolean |
isHorizontal()
true if the label is horizontal
|
protected static java.lang.String |
orientationToString(int i)
return a string for the int orientation encoding.
|
protected void |
paintComponent(java.awt.Graphics graphics)
paints the axis component.
|
protected void |
paintHorizontalLabel(java.awt.Graphics2D g)
Paint the axis if it is horizontal
|
protected void |
paintVerticalLabel(java.awt.Graphics2D g)
Paint the axis if it is vertical
|
protected static int |
parseOrientationString(java.lang.String orientationString) |
void |
resize()
revalidate component after resize.
|
void |
setEmOffset(double emOffset)
Setter for property emOffset.
|
void |
setLabel(java.lang.String t)
Mutator method for the title property of this axis.
|
void |
setLabelFont(java.awt.Font labelFont)
set the font of the label.
|
void |
setOrientation(int orientation)
Sets the side of the row,column box to locate the label.
|
acceptContext, addMouseModule, coalesceEvents, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getLineThicknessDouble, getRow, installComponent, isOpaqueBackground, processDasUpdateEvent, processEvent, removeMouseModule, setColumn, setDasName, setOpaqueBackground, setRow, showProperties, toString, uninstallComponent, update, updateImmediately
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, 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 int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int HORIZONTAL
public static final int VERTICAL
protected java.lang.String axisLabel
public AttachedLabel(java.lang.String label, int orientation, double emOffset)
label
- The granny string to be displayed.orientation
- identifies the side of the box. See TOP, BOTTOM, LEFT, RIGHT.emOffset
- The offset from the edge of the box to the label, in "ems"-- the roughly the width of a letter "M," and
more precisely the size of the current font.public void setOrientation(int orientation)
orientation
- should be one of AttachedLabel.TOP, AttachedLabel.BOTTOM, AttachedLabel.LEFT, AttachedLabel.RIGHTpublic void setLabel(java.lang.String t)
t
- The new title for this axispublic java.lang.String getLabel()
null
if the axis has no title.public final int getDevicePosition()
public int getDLength()
protected void paintComponent(java.awt.Graphics graphics)
paintComponent
in class javax.swing.JComponent
graphics
- protected void paintHorizontalLabel(java.awt.Graphics2D g)
protected void paintVerticalLabel(java.awt.Graphics2D g)
protected int getTitlePositionOffset()
public java.awt.Font getLabelFont()
public void setLabelFont(java.awt.Font labelFont)
labelFont
- Font for the component. Currently this is ignored.public java.lang.Object clone()
clone
in class java.lang.Object
public void resize()
resize
in class DasCanvasComponent
protected java.awt.Rectangle getLabelBounds()
public int getOrientation()
public boolean isHorizontal()
protected static java.lang.String orientationToString(int i)
i
- protected static int parseOrientationString(java.lang.String orientationString)
orientationString
- left, right, horizontal, etc.public java.awt.Shape getActiveRegion()
DasCanvasComponent
getActiveRegion
in class DasCanvasComponent
public double getEmOffset()
public void setEmOffset(double emOffset)
emOffset
- New value of property emOffset.