|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.ocd.dcf.DCComponent
Component
The Component class is the base class for DCF based Components. The Component supports the IXMLPersistable interface.
The Component can be placed on the Desktop or reside inside a traditional Swing container When placed on the Desktop the Component is placed in its own delegate Window.
The Component also supports the basic DCF drag and drop operations.
Sub classes should overridge the setBLXElement and getXMLElement methods to add support for storing their own data in XML.
Inner Class Summary | |
static class |
DCComponent.DesktopWindow
Used to fix a problem with Window Focus see JDK Bug: 4186928 |
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.util.HashSet |
dcComponentListeners
|
protected static java.awt.Frame |
desktopFrame
|
protected boolean |
draggable_flag
|
protected java.awt.dnd.DragGestureRecognizer |
dragRecognizer
|
protected java.awt.dnd.DragSource |
dragSource
|
protected java.awt.dnd.DragSourceListener |
dragSourceListener
|
protected java.lang.String |
extensionHREF
|
protected java.lang.String |
extensionName
|
protected java.lang.String |
extensionVersion
|
protected boolean |
onDesktop_flag
|
protected java.net.URL |
relativeURL
|
protected java.awt.datatransfer.Transferable |
transferObject
|
protected boolean |
visible_flag
|
protected java.awt.Window |
window
|
protected boolean |
xmlChanged_flag
|
protected static IXMLParser |
xmlParser
|
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 | |
DCComponent()
|
Method Summary | |
void |
addDCComponentListener(DCComponentListener pListener)
Add A DCComponentListener. |
static void |
addDesktopFrameListener(java.awt.event.WindowListener listener)
Add a window listener to the Main Desktop Frame |
protected org.w3c.dom.Node |
appendChild(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
org.w3c.dom.Node child)
Add a Child Node to a Parent Node for the Given Document |
protected org.w3c.dom.Document |
createDOMDocument()
Helper Method Used by sub-classes to easily create a DOM Document using the xmlParser |
void |
dispose()
Dispose of this Component. |
org.w3c.dom.Element |
getBLXElement()
Get the BLX-Node for this Component. |
java.awt.Image |
getComponentDragImage()
Returns the Image that will be used while this Component is being Dragged |
static java.awt.Frame |
getDesktopFrame()
Get the Desktop Frame that owns all components on the Desktop |
java.lang.String |
getID()
Get this Components unique ID |
java.awt.Point |
getLocation()
Get the Location of this Component Relative to its Parent. |
java.awt.Frame |
getOwnerFrame()
Get OwnerFrame of this Componet This component will return the Frame that owns this Component |
java.awt.datatransfer.Transferable |
getTransferable()
Gets this components Transferable Object |
org.w3c.dom.Element |
getXMLElement()
Get the Data Node for this Component. |
boolean |
isDraggable()
Return true if this Component is Draggable |
boolean |
isOnDesktop()
Returns true if this component is on the Desktop |
protected void |
placeOnDesktop()
placed the component on the desktop |
void |
removeDCComponentListener(DCComponentListener pListener)
Remove a Disposed Listener |
static void |
removeDesktopFrameListener(java.awt.event.WindowListener listener)
Add a window listener to the Main Desktop Frame |
protected void |
removeFromDesktop()
Remove the component from the Desktop |
void |
setBLXElement(org.w3c.dom.Element pElement,
java.net.URL pRelativeURL)
Set the Node on this Component |
static void |
setDesktopFrameIconImage(java.awt.Image pImage)
Set the Image used for the DCComponents Desktop Frame This Frame is the owner of all DCComponents when they are on the Desktop |
static void |
setDesktopFrameTitle(java.lang.String pTitle)
Set the Title used for the DCComponents Desktop Frame This Frame is the owner of all DCComponents when they are on the Desktop |
static void |
setDesktopFrameVisible(boolean pVisible)
Set Visiblity of the Desktop Frame This Frame is the owner of all DCComponents when they are on the Desktop If the frame is Visible then it will be in an Iconified state |
void |
setDraggable(boolean pDraggable)
True if This Component can be dragged. |
protected void |
setDragSourceListener(java.awt.dnd.DragSourceListener pListener)
Sets the Drag Source Listener of this Component |
void |
setLocation(int pX,
int pY)
Sets the Location of the Component in its parent or on the Screen |
void |
setOnDesktop(boolean pUseDesktop)
Place the Component on the Desktop or remove it from the Desktop When placed on the Desktop the Component is placed in its own Window When removed from the Desktop the component acts like a standard JComponent |
void |
setSize(int width,
int height)
Set the Size of this Component |
void |
setTransferable(java.awt.datatransfer.Transferable pTransfer)
Sets this component Transferable Object |
void |
setVisible(boolean pVisible)
Hides or Shows this Component |
void |
setXMLChanged(boolean pChanged)
Set the xmlChanged Flag Only sub classes can call this |
boolean |
xmlHasChanged()
Return true if this components state has changed in a way that Requires a new XML Node to be fetched |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setName, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean onDesktop_flag
protected boolean visible_flag
protected boolean draggable_flag
protected java.awt.Window window
protected java.awt.dnd.DragSource dragSource
protected java.awt.dnd.DragGestureRecognizer dragRecognizer
protected java.awt.dnd.DragSourceListener dragSourceListener
protected static java.awt.Frame desktopFrame
protected java.util.HashSet dcComponentListeners
protected java.awt.datatransfer.Transferable transferObject
protected boolean xmlChanged_flag
protected static IXMLParser xmlParser
protected java.lang.String extensionName
protected java.lang.String extensionHREF
protected java.lang.String extensionVersion
protected java.net.URL relativeURL
Constructor Detail |
public DCComponent()
Method Detail |
public void setOnDesktop(boolean pUseDesktop)
When a component is set on the Desktop its visibility is set to false. setVisible(true) must be called after calling setOnDesktop(true)
pUseDesktop
- true if the component should be placed on the Desktoppublic boolean isOnDesktop()
protected void placeOnDesktop()
public java.awt.Frame getOwnerFrame()
public java.awt.datatransfer.Transferable getTransferable()
public void setTransferable(java.awt.datatransfer.Transferable pTransfer)
pTransfer
- Object used for passing data during Drag and Dropprotected void removeFromDesktop()
public void setSize(int width, int height)
setSize
in class java.awt.Component
width
- height
- public void dispose()
The component should not be used after calling dispose.
public void addDCComponentListener(DCComponentListener pListener)
pListener
- public void removeDCComponentListener(DCComponentListener pListener)
pListener
- to removepublic java.lang.String getID()
public java.awt.Point getLocation()
getLocation
in class java.awt.Component
public void setLocation(int pX, int pY)
setLocation
in class java.awt.Component
pX
- pY
- public void setVisible(boolean pVisible)
setVisible
in class javax.swing.JComponent
pVisible
- protected void setDragSourceListener(java.awt.dnd.DragSourceListener pListener)
pListener
- public void setDraggable(boolean pDraggable)
pDraggable
- public java.awt.Image getComponentDragImage()
public boolean isDraggable()
public boolean xmlHasChanged()
xmlHasChanged
in interface IXMLPersistable
public org.w3c.dom.Element getXMLElement()
getXMLElement
in interface IXMLPersistable
protected org.w3c.dom.Document createDOMDocument()
public org.w3c.dom.Element getBLXElement()
getBLXElement
in interface IXMLPersistable
public void setXMLChanged(boolean pChanged)
Changed
- protected org.w3c.dom.Node appendChild(org.w3c.dom.Document doc, org.w3c.dom.Node parent, org.w3c.dom.Node child) throws org.w3c.dom.DOMException
doc
- Document of Nodesparent
- Node child should be added to. This node will be imported into doc if
it hasn't alreadychild
- Node that will be added to parent nodepublic void setBLXElement(org.w3c.dom.Element pElement, java.net.URL pRelativeURL)
setBLXElement
in interface IXMLPersistable
pElement
- Node that contains this components settingspRelativeURL
- the URL that all HREFs would be relative topublic static java.awt.Frame getDesktopFrame()
public static void addDesktopFrameListener(java.awt.event.WindowListener listener)
public static void removeDesktopFrameListener(java.awt.event.WindowListener listener)
public static void setDesktopFrameIconImage(java.awt.Image pImage)
public static void setDesktopFrameTitle(java.lang.String pTitle)
public static void setDesktopFrameVisible(boolean pVisible)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |