public abstract class DasCanvasComponent extends javax.swing.JComponent implements Editable
Modifier and Type | Class and Description |
---|---|
protected static class |
DasCanvasComponent.CanvasComponentAction |
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected DasMouseInputAdapter |
mouseAdapter
the mouse adapter for handling mouse events.
|
static java.lang.String |
PROP_OPAQUEBACKGROUND |
static javax.swing.Action |
PROPERTIES_ACTION
action for entering the properties editor.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DasCanvasComponent()
constructs a DasCanvasComponent, creating the
DasMouseInputAdapter for it and assigning a
default name to it.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptContext(int x,
int y)
returns true if the component is suitable context for the point.
|
void |
addMouseModule(MouseModule module)
Add the MouseModule to the list of MouseModules
attached to the component via the DasMouseInputAdapter.
|
protected java.awt.AWTEvent |
coalesceEvents(java.awt.AWTEvent existingEvent,
java.awt.AWTEvent newEvent)
Potentially coalesce an event being posted with an existing
event.
|
javax.swing.Action[] |
getActions()
return a list of actions.
|
java.awt.Shape |
getActiveRegion()
returns the active region of the canvas component, which is not necessarily the bounds.
|
DasCanvas |
getCanvas()
get the DasCanvas which contains this DasCanvasComponent.
|
DasColumn |
getColumn()
accessor for the DasColumn used for positioning the component.
|
DasMouseInputAdapter |
getDasMouseInputAdapter()
Get the DasMouseInputAdapter, which handles mouse input for the component.
|
java.lang.String |
getDasName()
Get the String identifier for the component which identifies
the component within the application.
|
double |
getEmSize()
convenient method intended to encourage use of em's.
|
java.awt.Font |
getFont()
return the font used to paint the component.
|
double |
getLineThicknessDouble(java.lang.String lineThickness)
return the thickness of the lines (in points or pixels), as specified
in the lineThickness parameter.
|
DasRow |
getRow()
accessor for the DasRow used for positioning the component.
|
protected void |
installComponent()
currently does nothing.
|
boolean |
isOpaqueBackground() |
protected void |
processDasUpdateEvent(DasUpdateEvent e)
like processEvent, but we also check the dirty status
|
protected void |
processEvent(java.awt.AWTEvent e)
Processes events occurring on this component.
|
void |
removeMouseModule(MouseModule module)
Remove the MouseModule from the list of MouseModules
attached to the component via the DasMouseInputAdapter.
|
void |
resize()
Called by the DasCanvas layout manager to request this component
to set its bounds.
|
void |
setColumn(DasColumn c)
set the DasColumn for positioning the component horizontally.
|
void |
setDasName(java.lang.String name)
Set the String identifier for the component which identifies
the component within the application.
|
void |
setOpaqueBackground(boolean opaqueBackground) |
void |
setRow(DasRow r)
set the DasRow for positioning the component vertically.
|
void |
showProperties()
popup the PropertyEditor for editing the state
of this component.
|
java.lang.String |
toString() |
protected void |
uninstallComponent()
remove the component row and column update listener.
|
void |
update()
posts an update event on the SystemEventQueue, indicating that work needs to be
done to get the get the component back into a valid state.
|
protected void |
updateImmediately()
This method is called when a DasUpdateEvent is processed.
|
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, paintComponent, 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 javax.swing.Action PROPERTIES_ACTION
protected DasMouseInputAdapter mouseAdapter
public static final java.lang.String PROP_OPAQUEBACKGROUND
public DasCanvasComponent()
public void addMouseModule(MouseModule module)
module
- the mouse module to addMouseModule
public void removeMouseModule(MouseModule module)
module
- the mouse module to removeMouseModule
public DasRow getRow()
public DasColumn getColumn()
public void resize()
public void setRow(DasRow r)
r
- the DasRowpublic void setColumn(DasColumn c)
c
- the DasColumnpublic void showProperties()
public java.lang.String toString()
toString
in class java.awt.Component
protected void updateImmediately()
public void update()
protected void processEvent(java.awt.AWTEvent e)
process<event type>Event
method for the given class of event.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent
in class java.awt.Container
e
- the eventComponent.processComponentEvent(java.awt.event.ComponentEvent)
,
Component.processFocusEvent(java.awt.event.FocusEvent)
,
Component.processKeyEvent(java.awt.event.KeyEvent)
,
Component.processMouseEvent(java.awt.event.MouseEvent)
,
Component.processMouseMotionEvent(java.awt.event.MouseEvent)
,
Component.processInputMethodEvent(java.awt.event.InputMethodEvent)
,
Component.processHierarchyEvent(java.awt.event.HierarchyEvent)
,
Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent)
,
processDasUpdateEvent(org.das2.event.DasUpdateEvent)
protected void processDasUpdateEvent(DasUpdateEvent e)
e
- the eventprotected java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent existingEvent, java.awt.AWTEvent newEvent)
EventQueue.postEvent
if an event with the same ID as the event to be posted is found in
the queue (both events must have this component as their source).
This method either returns a coalesced event which replaces
the existing event (and the new event is then discarded), or
null
to indicate that no combining should be done
(add the second event to the end of the queue). Either event
parameter may be modified and returned, as the other one is discarded
unless null
is returned.
This implementation of coalesceEvents
coalesces
DasUpdateEvent
s, returning the existingEvent parameter
coalesceEvents
in class java.awt.Component
existingEvent
- the event already on the EventQueue
newEvent
- the event being posted to the
EventQueue
null
indicating that no
coalescing was doneprotected void installComponent()
protected void uninstallComponent()
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public double getEmSize()
public final double getLineThicknessDouble(java.lang.String lineThickness)
lineThickness
- public boolean isOpaqueBackground()
public void setOpaqueBackground(boolean opaqueBackground)
public DasCanvas getCanvas()
public java.lang.String getDasName()
public final void setDasName(java.lang.String name) throws DasNameException
name
- unique String identifying the component within
the application.DasNameException
public java.awt.Shape getActiveRegion()
public boolean acceptContext(int x, int y)
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 javax.swing.Action[] getActions()
public final DasMouseInputAdapter getDasMouseInputAdapter()