ucar.unidata.idv.control.multi
Class DisplayComponent

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.collab.PropertiedThing
          extended by ucar.unidata.idv.control.multi.DisplayComponent
All Implemented Interfaces:
PropertyChangeListener, EventListener, Sharable
Direct Known Subclasses:
ChartWrapper, DisplayControlWrapper, DisplayGroup, FieldSelectorWrapper, ViewWrapper

public abstract class DisplayComponent
extends PropertiedThing
implements PropertyChangeListener

Base class of things that are shown in the MultiDisplayHolder

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

Field Summary
static String CMD_SAVEIMAGE
          Action command to save an image_
static String CMD_SAVEMOVIE
          Action command to save an moveie
protected  MultiDisplayHolder displayControl
          The displaycontrol I'm in
protected  JLabel displayLabel
          The label
protected  boolean hasBeenInitialized
          Has this component been initialized
 boolean isRemoved
          Has this component been removed
static String PROP_REMOVED
          Property change id
 
Fields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog
 
Constructor Summary
DisplayComponent()
          default ctor
DisplayComponent(String name)
          ctor
 
Method Summary
protected  List addGroupMenuItems(List items)
          Add the parent group's menu items
 void animationTimeChanged(Real time)
          Set animation time on components
protected  boolean applyProperties()
          Apply properties
protected  boolean doApplyProperties()
          Apply the properties
protected abstract  JComponent doMakeContents()
          Make the gui
protected  JLabel doMakeDisplayLabel()
          Create, if needed, and return the component label
 void doRemove()
          Been removed, do any cleanup
 void doSaveImage()
          Write the image
 void doSaveMovie()
          Create a movie
 Color getBackgroundColor()
          Get the BackgroundColor property.
 JComponent getContents()
          Create, if needed, and return the gui contents
 List getDisplayables()
          Get the list of displayables
protected  MultiDisplayHolder getDisplayControl()
          Get the display control I'm in
 DisplayGroup getDisplayGroup()
          Get the DisplayGroup property.
protected  JLabel getDisplayLabel()
          Create, if needed, and return the component label
 boolean getIsRemoved()
          Get the IsRemoved property.
 boolean getLabelShown()
          Get the LabelShown property.
 String getName()
          Get the Name property.
protected  List getPopupMenuItems(List items)
          Get the menu items for the popup menu
protected  void getPropertiesComponents(List comps, int tabIdx)
          Create the properties contents
 String getTypeName()
          Return the human readable name of this component
 void initAfterUnPersistence(MultiDisplayHolder displayControl, ControlContext vc, Hashtable properties)
          Called by the IntegratedDataViewer to initialize after this control has been unpersisted
 void initDone()
          Finish with initialization
 void loadData()
          Tell components to load
 boolean removeDisplayComponent()
          Remove me
 void setBackgroundColor(Color value)
          Set the BackgroundColor property.
 void setDisplayControl(MultiDisplayHolder displayControl)
          Set the display control I'm in
 void setDisplayGroup(DisplayGroup value)
          Set the DisplayGroup property.
 void setIsRemoved(boolean value)
          Set the IsRemoved property.
 void setLabelShown(boolean value)
          Set the LabelShown property.
 void setName(String value)
          Set the Name property.
 void showPopup(JComponent where, int x, int y)
          SHow the popup menu
 boolean showProperties()
          Show the properties dialog
 String toString()
          to string
 
Methods inherited from class ucar.unidata.collab.PropertiedThing
addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, isShowing, propertyChange, removePropertyChangeListener, showProperties
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

PROP_REMOVED

public static final String PROP_REMOVED
Property change id

See Also:
Constant Field Values

isRemoved

public boolean isRemoved
Has this component been removed


hasBeenInitialized

protected boolean hasBeenInitialized
Has this component been initialized


CMD_SAVEIMAGE

public static final String CMD_SAVEIMAGE
Action command to save an image_

See Also:
Constant Field Values

CMD_SAVEMOVIE

public static final String CMD_SAVEMOVIE
Action command to save an moveie

See Also:
Constant Field Values

displayLabel

protected JLabel displayLabel
The label


displayControl

protected MultiDisplayHolder displayControl
The displaycontrol I'm in

Constructor Detail

DisplayComponent

public DisplayComponent()
default ctor


DisplayComponent

public DisplayComponent(String name)
ctor

Parameters:
name - name
Method Detail

initDone

public void initDone()
Finish with initialization


initAfterUnPersistence

public void initAfterUnPersistence(MultiDisplayHolder displayControl,
                                   ControlContext vc,
                                   Hashtable properties)
Called by the IntegratedDataViewer to initialize after this control has been unpersisted

Parameters:
displayControl - The display control I am part of
vc - The context in which this control exists
properties - Properties that may hold things

doMakeContents

protected abstract JComponent doMakeContents()
Make the gui

Returns:
The gui

getContents

public JComponent getContents()
Create, if needed, and return the gui contents

Returns:
gui contents

setDisplayControl

public void setDisplayControl(MultiDisplayHolder displayControl)
Set the display control I'm in

Parameters:
displayControl - The display control

getDisplayControl

protected MultiDisplayHolder getDisplayControl()
Get the display control I'm in

Returns:
The display control

animationTimeChanged

public void animationTimeChanged(Real time)
Set animation time on components

Parameters:
time - time

loadData

public void loadData()
              throws RemoteException,
                     VisADException
Tell components to load

Throws:
RemoteException - On badness
VisADException - On badness

doSaveMovie

public void doSaveMovie()
Create a movie


doSaveImage

public void doSaveImage()
Write the image


addGroupMenuItems

protected List addGroupMenuItems(List items)
Add the parent group's menu items

Parameters:
items - menu items
Returns:
the items

getDisplayables

public List getDisplayables()
Get the list of displayables

Returns:
empty list

removeDisplayComponent

public boolean removeDisplayComponent()
Remove me

Returns:
was removed

doApplyProperties

protected boolean doApplyProperties()
Apply the properties

Overrides:
doApplyProperties in class PropertiedThing
Returns:
Success

doRemove

public void doRemove()
Been removed, do any cleanup


setName

public void setName(String value)
Set the Name property.

Parameters:
value - The new value for Name

getName

public String getName()
Get the Name property.

Returns:
The Name

setDisplayGroup

public void setDisplayGroup(DisplayGroup value)
Set the DisplayGroup property.

Parameters:
value - The new value for DisplayGroup

getDisplayGroup

public DisplayGroup getDisplayGroup()
Get the DisplayGroup property.

Returns:
The DisplayGroup

toString

public String toString()
to string

Overrides:
toString in class Object
Returns:
string

setBackgroundColor

public void setBackgroundColor(Color value)
Set the BackgroundColor property.

Parameters:
value - The new value for BackgroundColor

getBackgroundColor

public Color getBackgroundColor()
Get the BackgroundColor property.

Returns:
The BackgroundColor

getTypeName

public String getTypeName()
Return the human readable name of this component

Returns:
component type name

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       int tabIdx)
Create the properties contents

Overrides:
getPropertiesComponents in class PropertiedThing
Parameters:
comps - List of components
tabIdx - Which tab

applyProperties

protected boolean applyProperties()
Apply properties

Overrides:
applyProperties in class PropertiedThing
Returns:
Was successful

getPopupMenuItems

protected List getPopupMenuItems(List items)
Get the menu items for the popup menu

Parameters:
items - List of items to add to
Returns:
The items list

showProperties

public boolean showProperties()
Show the properties dialog

Overrides:
showProperties in class PropertiedThing
Returns:
Was it ok

showPopup

public void showPopup(JComponent where,
                      int x,
                      int y)
SHow the popup menu

Parameters:
where - component to show near to
x - x
y - y

getDisplayLabel

protected JLabel getDisplayLabel()
Create, if needed, and return the component label

Returns:
component label

doMakeDisplayLabel

protected JLabel doMakeDisplayLabel()
Create, if needed, and return the component label

Returns:
component label

setLabelShown

public void setLabelShown(boolean value)
Set the LabelShown property.

Parameters:
value - The new value for LabelShown

getLabelShown

public boolean getLabelShown()
Get the LabelShown property.

Returns:
The LabelShown

setIsRemoved

public void setIsRemoved(boolean value)
Set the IsRemoved property.

Parameters:
value - The new value for IsRemoved

getIsRemoved

public boolean getIsRemoved()
Get the IsRemoved property.

Returns:
The IsRemoved