WISA.wisa3D.builder
Class DataContainer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--WISA.wisa3D.builder.DataContainer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
DataBox, SubdataBox, TreeDataBox

public abstract class DataContainer
extends javax.swing.JComponent

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.Object data
          The data object of this DataContainer.
protected  java.lang.Class dataClass
          The Class of the data of this DataContainer.
protected  int subDataCount
          The number of subdata of the data.
 
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
DataContainer(java.lang.Class dataClass)
          Construct a DataContainer representing a data object of the specified class.
DataContainer(java.lang.Object data)
          Construct a DataContainer with the given data.
 
Method Summary
 java.awt.Color getBackground()
          Get the background color for this DataContainer.
static java.awt.Color getBackground(java.lang.Class dataClass)
          Get the background color for the specified class.
static java.lang.Class getBaseClass(java.lang.Class dataClass)
          Get the base class for the specified dataClass.
 java.lang.Object getData()
          Get the data this DataContainer is representing.
 java.lang.Class getDataClass()
          Get the Class of the data this DataContainer is representing.
 java.lang.String getDataName()
          Get a String representation of the data of this DataContainer.
static java.lang.String getDataName(java.lang.Class dataClass)
          Get a String representation of the specified class of data.
static java.lang.String getDataName(java.lang.Object data)
          Get a String representation of the specified data.
 java.lang.Object[] getSubData()
          Return the subdata of the data of this DataContainer.
 java.lang.Class[] getSubDataClasses()
          Get the classes of the subdata of the data this DataContainer represents.
 int getSubDataCount()
          Return the number of the subdata of the data of this DataContainer.
static java.lang.Class[] getSupportedBaseClasses()
          Get the supported base classes.
static java.lang.Class[] getSupportedSubClasses(java.lang.Class baseClass)
           
protected abstract  void init()
           
 
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, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected java.lang.Object data
The data object of this DataContainer. May be null.


dataClass

protected java.lang.Class dataClass
The Class of the data of this DataContainer.


subDataCount

protected int subDataCount
The number of subdata of the data.

Constructor Detail

DataContainer

public DataContainer(java.lang.Object data)
Construct a DataContainer with the given data.

Parameters:
data - The data this DataContainer should represent.

DataContainer

public DataContainer(java.lang.Class dataClass)
Construct a DataContainer representing a data object of the specified class.

Parameters:
dataClass - The kind of data this DataContainer is representing.
Method Detail

init

protected abstract void init()

getData

public java.lang.Object getData()
Get the data this DataContainer is representing.

Returns:
The data of this DataContainer or null.

getDataClass

public java.lang.Class getDataClass()
Get the Class of the data this DataContainer is representing.

Returns:
The Class of the data of this DataContainer.

getBackground

public java.awt.Color getBackground()
Get the background color for this DataContainer. The background color of a DataContainer cannot be set by setBackground because it depends on the data class.

Overrides:
getBackground in class java.awt.Component
Returns:
The background color of this DataContainer.

getDataName

public java.lang.String getDataName()
Get a String representation of the data of this DataContainer.

Returns:
A String representation of the data.

getSubData

public java.lang.Object[] getSubData()
Return the subdata of the data of this DataContainer.

Returns:
An array with the subdata of the data of this DataContainer or null.

getSubDataClasses

public java.lang.Class[] getSubDataClasses()
Get the classes of the subdata of the data this DataContainer represents.

Returns:
The classes of the subdata of the data of this DataContainer.

getSubDataCount

public int getSubDataCount()
Return the number of the subdata of the data of this DataContainer.

Returns:
The number of the subdata of the data of this DataContainer or null.

getBaseClass

public static java.lang.Class getBaseClass(java.lang.Class dataClass)
Get the base class for the specified dataClass.


getBackground

public static java.awt.Color getBackground(java.lang.Class dataClass)
Get the background color for the specified class.

Returns:
The background color for the specified class.

getDataName

public static java.lang.String getDataName(java.lang.Object data)
Get a String representation of the specified data.

Returns:
The name of the given data.

getDataName

public static java.lang.String getDataName(java.lang.Class dataClass)
Get a String representation of the specified class of data.

Returns:
The name of the given data class.

getSupportedBaseClasses

public static java.lang.Class[] getSupportedBaseClasses()
Get the supported base classes.


getSupportedSubClasses

public static java.lang.Class[] getSupportedSubClasses(java.lang.Class baseClass)