org.ocd.desktop
Class MasterTile

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.ocd.dcf.DCComponent
                                |
                                +--org.ocd.desktop.MasterTile
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, ILaunchListener, java.awt.image.ImageObserver, IXMLPersistable, java.awt.MenuContainer, java.io.Serializable

public class MasterTile
extends DCComponent
implements java.awt.event.ActionListener, ILaunchListener, java.awt.event.ComponentListener

MasterTile

Since:
$Date: 2002/08/07 02:58:34 $
Version:
$Revision: 1.22 $
Author:
$Author: drichan $
See Also:
Serialized Form

Inner classes inherited from class org.ocd.dcf.DCComponent
DCComponent.DesktopWindow
 
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
static java.lang.String BG
           
protected  javax.swing.ImageIcon bgImage
           
protected static int BOTTOM_LEFT
           
protected static java.lang.String BOTTOM_LEFT_STR
           
protected static int BOTTOM_RIGHT
           
protected static java.lang.String BOTTOM_RIGHT_STR
           
protected  javax.swing.ImageIcon busyIcon
           
static java.lang.String CLOSED_ATTR
           
protected  boolean closed_flag
           
protected static java.awt.Dimension CLOSED_SIZE
           
protected  ICompFactory componentFactory
           
protected  IDesktop desktop
           
protected  DesktopService desktopService
           
protected  java.util.ArrayList dockedTiles
           
static java.lang.String ELEMENT_NAME
           
protected  boolean launchInProgress_flag
          Set to true when we are trying to launch a Command
protected  LaunchPanel launchPanel
           
static java.lang.String LEFT_SIDE
           
protected  javax.swing.ImageIcon leftSideImage
           
static java.lang.String LOCATION_ATTR
           
protected  int locGrid
           
protected  TileSet masterTileSet
           
protected  javax.swing.JMenuItem newStickyMI
           
protected  javax.swing.JMenuItem newTileSetMI
           
protected  javax.swing.ImageIcon openBgImage
           
protected  DCPopupMenu popupMenu
           
protected  Preferences preference
          Prefence Object used to store preferences for the master tile
static java.lang.String RIGHT_SIDE
           
protected  javax.swing.ImageIcon rightSideImage
           
protected static int SIDE_WIDTH
           
protected static int TOP_LEFT
           
protected static java.lang.String TOP_LEFT_STR
           
protected static int TOP_RIGHT
           
protected static java.lang.String TOP_RIGHT_STR
           
 
Fields inherited from class org.ocd.dcf.DCComponent
dcComponentListeners, desktopFrame, draggable_flag, dragRecognizer, dragSource, dragSourceListener, extensionHREF, extensionName, extensionVersion, onDesktop_flag, relativeURL, transferObject, visible_flag, window, xmlChanged_flag, 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 org.ocd.blx.IXMLPersistable
BLX_CLASS_NAME_ATTR, BLX_COMP_HEIGHT_ATTR, BLX_COMP_ID, BLX_COMP_NODE_NAME, BLX_COMP_WIDTH_ATTR, BLX_COMP_X_ATTR, BLX_COMP_Y_ATTR, BLX_DOCUMENT_NAME, BLX_EXT_HREF_ATTR, BLX_EXT_VERSION_ATTR, BLX_EXTENSION_ATTR, BLX_FACTORY_NODE_NAME, BLX_FACTORY_TYPE_ATTR, BLX_HREF_ATTR, BLX_NS, BLX_OBJ_NODE_NAME, COMP_TYPE, COMPONENT_FACTORY_TYPE, COMPONENT_FACTORY_TYPE_STR, FACTORY_TYPE, FILE_EXT, OBJECT_FACTORY_TYPE, OBJECT_FACTORY_TYPE_STR, OBJECT_TYPE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MasterTile()
          Create a Master Tile
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent pEvent)
          Action Performed
 void componentHidden(java.awt.event.ComponentEvent e)
          Invoked when the component has been made invisible.
 void componentMoved(java.awt.event.ComponentEvent e)
          Invoked when the component's position changes.
 void componentResized(java.awt.event.ComponentEvent e)
          Invoked when the component's size changes.
 void componentShown(java.awt.event.ComponentEvent e)
          Invoked when the component has been made visible.
protected  int convertGridLocFromString(java.lang.String pLocation)
          Converts the grid location from a String
protected  java.lang.String convertGridLocToString(int pLocation)
          Converts the grid location to a String
 int getGridLocation()
          Gets the Location of the Master Tile on the Destop
 org.w3c.dom.Element getXMLElement()
          Get the XML Setting for this Component
 boolean isClosed()
          Is the Master Tile Closed
 void launchCompleted(ICmdAction action)
          Launch Panel as finished launching an Action
 void launchStarted(ICmdAction action)
          Launch Panel as triggered an ICmdAction
 void paintComponent(java.awt.Graphics pGraphics)
          PaintComponent
 void setBLXElement(org.w3c.dom.Element pElement, java.net.URL pRelativeURL)
          Set the Node on this Component
 void setClosed(boolean pClosed)
          Close or Open the Master Tile
protected  void setClosed(boolean pClosed, boolean pForce)
          Close or Open the Master Tile Used to force a Size change in the MasterTile
 void setGridLocation(int pLocation)
          Set the Location of the Master Tile to one of the corners of the desktop
 void setLocation(int x, int y)
          setLocation Overridden to place master tile in one of four corners
 void setOnDesktop(boolean pUseDesktop)
          SetOnDesktop Overridden to support proper placement of Master TileSet
 void setVisible(boolean pVisible)
          setVisible Overridden to support proper placement of Master TileSet
 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 org.ocd.dcf.DCComponent
addDCComponentListener, addDesktopFrameListener, appendChild, createDOMDocument, dispose, getBLXElement, getComponentDragImage, getDesktopFrame, getID, getLocation, getOwnerFrame, getTransferable, isDraggable, isOnDesktop, placeOnDesktop, removeDCComponentListener, removeDesktopFrameListener, removeFromDesktop, setDesktopFrameIconImage, setDesktopFrameTitle, setDesktopFrameVisible, setDraggable, setDragSourceListener, setSize, setTransferable, setXMLChanged
 
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, 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

closed_flag

protected boolean closed_flag

SIDE_WIDTH

protected static final int SIDE_WIDTH

CLOSED_SIZE

protected static final java.awt.Dimension CLOSED_SIZE

TOP_LEFT

protected static final int TOP_LEFT

BOTTOM_LEFT

protected static final int BOTTOM_LEFT

TOP_RIGHT

protected static final int TOP_RIGHT

BOTTOM_RIGHT

protected static final int BOTTOM_RIGHT

TOP_LEFT_STR

protected static final java.lang.String TOP_LEFT_STR

BOTTOM_LEFT_STR

protected static final java.lang.String BOTTOM_LEFT_STR

TOP_RIGHT_STR

protected static final java.lang.String TOP_RIGHT_STR

BOTTOM_RIGHT_STR

protected static final java.lang.String BOTTOM_RIGHT_STR

BG

public static final java.lang.String BG

LEFT_SIDE

public static final java.lang.String LEFT_SIDE

RIGHT_SIDE

public static final java.lang.String RIGHT_SIDE

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME

CLOSED_ATTR

public static final java.lang.String CLOSED_ATTR

LOCATION_ATTR

public static final java.lang.String LOCATION_ATTR

bgImage

protected javax.swing.ImageIcon bgImage

busyIcon

protected javax.swing.ImageIcon busyIcon

openBgImage

protected javax.swing.ImageIcon openBgImage

leftSideImage

protected javax.swing.ImageIcon leftSideImage

rightSideImage

protected javax.swing.ImageIcon rightSideImage

locGrid

protected int locGrid

componentFactory

protected ICompFactory componentFactory

desktopService

protected DesktopService desktopService

desktop

protected IDesktop desktop

launchPanel

protected LaunchPanel launchPanel

masterTileSet

protected TileSet masterTileSet

popupMenu

protected DCPopupMenu popupMenu

newTileSetMI

protected javax.swing.JMenuItem newTileSetMI

newStickyMI

protected javax.swing.JMenuItem newStickyMI

launchInProgress_flag

protected transient boolean launchInProgress_flag
Set to true when we are trying to launch a Command

preference

protected Preferences preference
Prefence Object used to store preferences for the master tile

dockedTiles

protected java.util.ArrayList dockedTiles
Constructor Detail

MasterTile

public MasterTile()
Create a Master Tile
Method Detail

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Invoked when the component has been made visible. MasterTile is listening for changes to launchPanel
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Invoked when the component's position changes. MasterTile is listening for changes to launchPanel
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Invoked when the component's size changes. MasterTile is listening for changes to launchPanel
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Invoked when the component has been made invisible. MasterTile is listening for changes to launchPanel
Specified by:
componentHidden in interface java.awt.event.ComponentListener

isClosed

public boolean isClosed()
Is the Master Tile Closed

setClosed

public void setClosed(boolean pClosed)
Close or Open the Master Tile

setClosed

protected void setClosed(boolean pClosed,
                         boolean pForce)
Close or Open the Master Tile Used to force a Size change in the MasterTile

paintComponent

public void paintComponent(java.awt.Graphics pGraphics)
PaintComponent
Overrides:
paintComponent in class javax.swing.JComponent

setOnDesktop

public void setOnDesktop(boolean pUseDesktop)
SetOnDesktop Overridden to support proper placement of Master TileSet
Overrides:
setOnDesktop in class DCComponent
Following copied from class: org.ocd.dcf.DCComponent
Parameters:
pUseDesktop - true if the component should be placed on the Desktop

setVisible

public void setVisible(boolean pVisible)
setVisible Overridden to support proper placement of Master TileSet
Overrides:
setVisible in class DCComponent
Following copied from class: org.ocd.dcf.DCComponent
Parameters:
pVisible -  

setLocation

public void setLocation(int x,
                        int y)
setLocation Overridden to place master tile in one of four corners
Overrides:
setLocation in class DCComponent
Parameters:
x -  
y -  

setGridLocation

public void setGridLocation(int pLocation)
Set the Location of the Master Tile to one of the corners of the desktop
Parameters:
pLocation - TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT

getGridLocation

public int getGridLocation()
Gets the Location of the Master Tile on the Destop
Returns:
TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT

convertGridLocToString

protected java.lang.String convertGridLocToString(int pLocation)
Converts the grid location to a String
Returns:
String of TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT

convertGridLocFromString

protected int convertGridLocFromString(java.lang.String pLocation)
Converts the grid location from a String
Returns:
String of TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent pEvent)
Action Performed
Specified by:
actionPerformed in interface java.awt.event.ActionListener

xmlHasChanged

public boolean xmlHasChanged()
Return true if this components state has changed in a way that Requires a new XML Node to be fetched
Overrides:
xmlHasChanged in class DCComponent
Returns:
true if component has changed

setBLXElement

public void setBLXElement(org.w3c.dom.Element pElement,
                          java.net.URL pRelativeURL)
Set the Node on this Component
Overrides:
setBLXElement in class DCComponent
Parameters:
pElement - Node that contains this components settings
pRelativeURL - the URL that all HREFs would be relative to

getXMLElement

public org.w3c.dom.Element getXMLElement()
Get the XML Setting for this Component
Overrides:
getXMLElement in class DCComponent
Returns:
Element

launchCompleted

public void launchCompleted(ICmdAction action)
Launch Panel as finished launching an Action
Specified by:
launchCompleted in interface ILaunchListener
Parameters:
action - that has finished

launchStarted

public void launchStarted(ICmdAction action)
Launch Panel as triggered an ICmdAction
Specified by:
launchStarted in interface ILaunchListener
Parameters:
action - that has been Launched