ucar.unidata.ui
Class ComponentGroup

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.collab.PropertiedThing
          extended by ucar.unidata.ui.ComponentHolder
              extended by ucar.unidata.ui.ComponentGroup
All Implemented Interfaces:
PropertyChangeListener, EventListener, Sharable
Direct Known Subclasses:
IdvComponentGroup

public class ComponentGroup
extends ComponentHolder

Holds a group of display components

Version:
$Revision: 1.13 $
Author:
IDV Development Team

Field Summary
protected  JComponent container
          The gui
static String LAYOUT_BORDER
          type of layout
static String LAYOUT_DESKTOP
          type of layout
static String LAYOUT_GRAPH
          type of layout
static String LAYOUT_GRID
          type of layout
static String LAYOUT_GRIDBAG
          type of layout
static String LAYOUT_HSPLIT
          type of layout
static List LAYOUT_LIST
           
static String LAYOUT_MENU
          type of layout
static String[] LAYOUT_NAMES
          user readable names of layouts
static String LAYOUT_TABS
          type of layout
static String LAYOUT_TREE
          type of layout
static String LAYOUT_VSPLIT
          type of layout
static String[] LAYOUTS
          all of the layouts
protected  JComponent outerContainer
          outermost gui component
protected  JTabbedPane tabbedPane
          Tabbed pane
 
Fields inherited from class ucar.unidata.ui.ComponentHolder
ATTR_NAME, BORDER_NAMES, BORDERS, displayBtn, header, isRemoved, nameFld, parent
 
Fields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog
 
Constructor Summary
ComponentGroup()
          default ctor
ComponentGroup(String name)
          ctor
 
Method Summary
 void addComponent(ComponentHolder displayComponent)
          Add the wrapper
 void addComponent(ComponentHolder displayComponent, int index)
          Add the wrapper
protected  boolean applyProperties()
          Apply properties
protected  void doDrop(Object obj)
           
 JComponent doMakeContents()
          Create and return the gui contents
 void doRemove()
          do cleanup
 boolean dropOk(Object object)
           
 void editLayout()
          _more_
 List findComponentsWithType(Class compClass)
          Recursively find all contained components of the given class
 List getDisplayComponents()
          Get the DisplayComponents property.
 int getGridColumns()
          Get the GridColumns property.
 boolean getIconified()
          Get the Iconified property.
 Rectangle getLastPosition()
          Get the LastPosition property.
 String getLayout()
          Get the Layout property.
 int getNumColumns()
          Get the NumColumns property.
 int getNumRows()
          Get the NumRows property.
protected  List getPopupMenuItems(List items)
          Make the edit menu items
protected  void getPropertiesComponents(List comps, int tabIdx)
          Show dialog
 String getTypeName()
          What type of thing is this
 int indexOf(ComponentHolder displayComponent)
          What is the index of the child component
 void initWith(Element node)
          _more_
static boolean isAncestor(ComponentGroup parent, ComponentHolder descendant)
          _more_
static void main(String[] args)
          _more_
 DefaultMutableTreeNode makeTree(DefaultMutableTreeNode parent)
          _more_
 void print(String tab)
          _more_
 void redoLayout()
          Layout components
 void removeComponent(ComponentHolder displayComponent)
          remove the wrapper
 void setDisplayComponents(List value)
          Set the DisplayComponents property.
 void setGridColumns(int value)
          Set the GridColumns property.
 void setIconified(boolean value)
          Set the Iconified property.
 void setLastPosition(Rectangle value)
          Set the LastPosition property.
 void setLayout(String value)
          Set the Layout property.
 void setNumColumns(int value)
          Set the NumColumns property.
 void setNumRows(int value)
          Set the NumRows property.
 void setRowsColumns(int rows, int cols)
          Set layout
 void setState(Element node)
          _more_
protected  void subtreeChanged()
          _more_
 String toString()
          to string
protected  JComponent wrapContents(JComponent contents)
           
 String[] xxxxgetPropertyTabs()
          _more_
 
Methods inherited from class ucar.unidata.ui.ComponentHolder
clearContents, doMakeHeader, getBeingShown, getBorder, getBorderLayoutLocation, getCategory, getContents, getHierachicalName, getIcon, getInternalFrame, getLayoutRect, getName, getParent, getRoot, getShowHeader, removeDisplayComponent, setBorder, setBorder, setBorderLayoutLocation, setCategory, setLayoutRect, setName, setParent, setShowHeader, showPopup
 
Methods inherited from class ucar.unidata.collab.PropertiedThing
addPropertyChangeListener, doApplyProperties, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, isShowing, propertyChange, removePropertyChangeListener, showProperties, showProperties
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LAYOUT_GRIDBAG

public static final String LAYOUT_GRIDBAG
type of layout

See Also:
Constant Field Values

LAYOUT_GRID

public static final String LAYOUT_GRID
type of layout

See Also:
Constant Field Values

LAYOUT_TABS

public static final String LAYOUT_TABS
type of layout

See Also:
Constant Field Values

LAYOUT_HSPLIT

public static final String LAYOUT_HSPLIT
type of layout

See Also:
Constant Field Values

LAYOUT_VSPLIT

public static final String LAYOUT_VSPLIT
type of layout

See Also:
Constant Field Values

LAYOUT_GRAPH

public static final String LAYOUT_GRAPH
type of layout

See Also:
Constant Field Values

LAYOUT_TREE

public static final String LAYOUT_TREE
type of layout

See Also:
Constant Field Values

LAYOUT_BORDER

public static final String LAYOUT_BORDER
type of layout

See Also:
Constant Field Values

LAYOUT_DESKTOP

public static final String LAYOUT_DESKTOP
type of layout

See Also:
Constant Field Values

LAYOUT_MENU

public static final String LAYOUT_MENU
type of layout

See Also:
Constant Field Values

LAYOUT_NAMES

public static final String[] LAYOUT_NAMES
user readable names of layouts


LAYOUTS

public static final String[] LAYOUTS
all of the layouts


LAYOUT_LIST

public static final List LAYOUT_LIST

container

protected JComponent container
The gui


outerContainer

protected JComponent outerContainer
outermost gui component


tabbedPane

protected JTabbedPane tabbedPane
Tabbed pane

Constructor Detail

ComponentGroup

public ComponentGroup()
default ctor


ComponentGroup

public ComponentGroup(String name)
ctor

Parameters:
name - name
Method Detail

initWith

public void initWith(Element node)
_more_

Overrides:
initWith in class ComponentHolder
Parameters:
node - _more_

setState

public void setState(Element node)
_more_

Overrides:
setState in class ComponentHolder
Parameters:
node - _more_

getTypeName

public String getTypeName()
What type of thing is this

Overrides:
getTypeName in class ComponentHolder
Returns:
type name

doMakeContents

public JComponent doMakeContents()
Create and return the gui contents

Overrides:
doMakeContents in class ComponentHolder
Returns:
gui contents

wrapContents

protected JComponent wrapContents(JComponent contents)
Overrides:
wrapContents in class ComponentHolder

dropOk

public boolean dropOk(Object object)

doDrop

protected void doDrop(Object obj)

getPopupMenuItems

protected List getPopupMenuItems(List items)
Make the edit menu items

Overrides:
getPopupMenuItems in class ComponentHolder
Parameters:
items - Holds the menu items
Returns:
The list of items

xxxxgetPropertyTabs

public String[] xxxxgetPropertyTabs()
_more_

Returns:
_more_

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       int tabIdx)
Show dialog

Overrides:
getPropertiesComponents in class ComponentHolder
Parameters:
comps - List of components
tabIdx - which tab

makeTree

public DefaultMutableTreeNode makeTree(DefaultMutableTreeNode parent)
_more_

Overrides:
makeTree in class ComponentHolder
Parameters:
parent - _more_
Returns:
_more_

findComponentsWithType

public List findComponentsWithType(Class compClass)
Recursively find all contained components of the given class

Parameters:
compClass - The class to look for
Returns:
List of components

redoLayout

public void redoLayout()
Layout components


editLayout

public void editLayout()
_more_


addComponent

public void addComponent(ComponentHolder displayComponent)
Add the wrapper

Parameters:
displayComponent - new one

indexOf

public int indexOf(ComponentHolder displayComponent)
What is the index of the child component

Parameters:
displayComponent - child component
Returns:
its index

addComponent

public void addComponent(ComponentHolder displayComponent,
                         int index)
Add the wrapper

Parameters:
displayComponent - new one
index - Where

subtreeChanged

protected void subtreeChanged()
_more_


applyProperties

protected boolean applyProperties()
Apply properties

Overrides:
applyProperties in class ComponentHolder
Returns:
Was successful

removeComponent

public void removeComponent(ComponentHolder displayComponent)
remove the wrapper

Parameters:
displayComponent - the wrapper to remove

doRemove

public void doRemove()
do cleanup

Overrides:
doRemove in class ComponentHolder

setDisplayComponents

public void setDisplayComponents(List value)
Set the DisplayComponents property.

Parameters:
value - The new value for DisplayComponents

getDisplayComponents

public List getDisplayComponents()
Get the DisplayComponents property.

Returns:
The DisplayComponents

setRowsColumns

public void setRowsColumns(int rows,
                           int cols)
Set layout

Parameters:
rows - rows
cols - cols

setNumRows

public void setNumRows(int value)
Set the NumRows property.

Parameters:
value - The new value for NumRows

getNumRows

public int getNumRows()
Get the NumRows property.

Returns:
The NumRows

setNumColumns

public void setNumColumns(int value)
Set the NumColumns property.

Parameters:
value - The new value for NumColumns

getNumColumns

public int getNumColumns()
Get the NumColumns property.

Returns:
The NumColumns

toString

public String toString()
to string

Overrides:
toString in class ComponentHolder
Returns:
string

setLastPosition

public void setLastPosition(Rectangle value)
Set the LastPosition property.

Parameters:
value - The new value for LastPosition

getLastPosition

public Rectangle getLastPosition()
Get the LastPosition property.

Returns:
The LastPosition

setIconified

public void setIconified(boolean value)
Set the Iconified property.

Parameters:
value - The new value for Iconified

getIconified

public boolean getIconified()
Get the Iconified property.

Returns:
The Iconified

setLayout

public void setLayout(String value)
Set the Layout property.

Parameters:
value - The new value for Layout

getLayout

public String getLayout()
Get the Layout property.

Returns:
The Layout

setGridColumns

public void setGridColumns(int value)
Set the GridColumns property.

Parameters:
value - The new value for GridColumns

getGridColumns

public int getGridColumns()
Get the GridColumns property.

Returns:
The GridColumns

main

public static void main(String[] args)
_more_

Parameters:
args - _more_

isAncestor

public static boolean isAncestor(ComponentGroup parent,
                                 ComponentHolder descendant)
_more_

Parameters:
parent - _more_
descendant - _more_
Returns:
_more_

print

public void print(String tab)
_more_

Overrides:
print in class ComponentHolder
Parameters:
tab - _more_