com.tensegrity.skeleton.container
Class AbstractSwingToolContainer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.tensegrity.skeleton.container.AbstractSwingToolContainer
All Implemented Interfaces:
javax.accessibility.Accessible, Container, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, ToolContainer
Direct Known Subclasses:
SwingAttributeTableContainer, SwingAttributeTreeContainer, SwingLayoutToolsContainer, SwingNavigatorContainer, SwingOutlinerContainer, SwingRepositoryContainer

public abstract class AbstractSwingToolContainer
extends javax.swing.JPanel
implements ToolContainer

Abstract class for swing related ToolContainer implementations.

Version:
$Id: AbstractSwingToolContainer.java,v 1.33 2006/01/05 12:33:31 BurkhardWick Exp $
Author:
GillesIachelini
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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 static javax.swing.border.Border defaultBorder
          A default border for this container of 1 pixel in the "control" color.
protected  boolean isSelected
          The isSelected field contains the current selection state of this Container.
protected static javax.swing.border.Border selectedBorder
          The selectedBorder should be used to indicated that this Container is activated/selected.
 
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
AbstractSwingToolContainer(ApplicationFrame applicationFrame)
          Creates the AbstractSwingToolContainer by assigning the parameter ApplicationFrame and the associated UIManager.
AbstractSwingToolContainer(ApplicationFrame frame, java.lang.String helpID)
          Constructor specifying the ApplicationFrame and a help id for this container by that help can be looked up.
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
           
 java.awt.Component add(java.awt.Component comp, int index)
           
 ApplicationFrame getApplicationFrame()
          Returns the enclosing ApplicationFrame of this Container.
 ContainerAction getContainerAction()
          This factory method returns a new ContainerAction associated with this Container.
 Slide getSlideByTitle(java.lang.String title)
          Returns the slide with the given title or null, if there is no corresponding slide
 java.util.Iterator getSlides()
          Returns all contained slides or null, if there is no slide
protected  UIManager getUiManager()
          Returns the UiManager.
protected abstract  void init()
          Subclasses implement this method to start their initialization code.
protected  void manageVerticalScrollbarPolicy(java.awt.Component[] comps)
           This recursive method looks up the passed array of Component and if one of them is a JScrollPane, it hides the vertical scroll bar then sets the scroll bar policy as expected.
 void remove(java.awt.Component comp)
           
 void remove(int index)
           
 void setBorder(javax.swing.border.Border border)
           
protected  void setScrollbarIncrement(java.awt.Component[] comps, int unitinc_horizontal, int unitinc_vertical)
           
 void setSelected(boolean b)
          Sets the selected flag of this container.
protected  void setUiManager(UIManager uiManager)
          Allows subclasses to manually set the UIManager.
 void updateUI()
          Overwritten to ensure the correct coloring of the Borders.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
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, 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, getBackground, 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
 
Methods inherited from interface com.tensegrity.skeleton.container.ToolContainer
getHeight, getWidth, repaint
 
Methods inherited from interface com.tensegrity.gui.container.Container
getName, setName
 

Field Detail

isSelected

protected boolean isSelected
The isSelected field contains the current selection state of this Container.


defaultBorder

protected static javax.swing.border.Border defaultBorder
A default border for this container of 1 pixel in the "control" color.


selectedBorder

protected static javax.swing.border.Border selectedBorder
The selectedBorder should be used to indicated that this Container is activated/selected.

Constructor Detail

AbstractSwingToolContainer

public AbstractSwingToolContainer(ApplicationFrame applicationFrame)
Creates the AbstractSwingToolContainer by assigning the parameter ApplicationFrame and the associated UIManager. The Constructor implicitly calls the init method to allow subclasses further initialization.

Parameters:
applicationFrame - Enclosing ApplicationFrame

AbstractSwingToolContainer

public AbstractSwingToolContainer(ApplicationFrame frame,
                                  java.lang.String helpID)
Constructor specifying the ApplicationFrame and a help id for this container by that help can be looked up.

Parameters:
frame - the enclosing ApplicationFrame
helpID - the unique help id for this container corresponding to the one specified in the map.jhm file.
Method Detail

updateUI

public void updateUI()
Overwritten to ensure the correct coloring of the Borders.

See Also:
JPanel.updateUI()

add

public java.awt.Component add(java.awt.Component comp)

add

public java.awt.Component add(java.awt.Component comp,
                              int index)

remove

public void remove(java.awt.Component comp)

remove

public void remove(int index)

getApplicationFrame

public ApplicationFrame getApplicationFrame()
Description copied from interface: Container
Returns the enclosing ApplicationFrame of this Container.

Specified by:
getApplicationFrame in interface Container
Returns:
the instance of the enclosing ApplicationFrame.

init

protected abstract void init()
Subclasses implement this method to start their initialization code. This method is called from within the constructor of this class.


getUiManager

protected UIManager getUiManager()
Returns the UiManager.

Returns:
the UIManager associated with this container.

setUiManager

protected void setUiManager(UIManager uiManager)
Allows subclasses to manually set the UIManager.

Parameters:
uiManager - the UIManager to set.

setSelected

public void setSelected(boolean b)
Description copied from interface: Container
Sets the selected flag of this container.

Specified by:
setSelected in interface Container
Parameters:
b - true to indicate that this container is selected.

getContainerAction

public ContainerAction getContainerAction()
This factory method returns a new ContainerAction associated with this Container. Note that it extends the ContainerAction.actionPerformed(ActionEvent) method by doing a postValidate() on the ApplicationFrame MDIComponent as well as calling updateTools() on the ApplicationFrame's MenuTool.

Returns:
new ContainerAction associated with this Container.

getSlideByTitle

public Slide getSlideByTitle(java.lang.String title)
Returns the slide with the given title or null, if there is no corresponding slide

Parameters:
title - the title to look for
Returns:
the slide with the given title or null, if there is no corresponding slide

getSlides

public java.util.Iterator getSlides()
Returns all contained slides or null, if there is no slide

Returns:
an iterator over all stides

manageVerticalScrollbarPolicy

protected void manageVerticalScrollbarPolicy(java.awt.Component[] comps)

This recursive method looks up the passed array of Component and if one of them is a JScrollPane, it hides the vertical scroll bar then sets the scroll bar policy as expected.

Parameters:
comps - array of components

setScrollbarIncrement

protected void setScrollbarIncrement(java.awt.Component[] comps,
                                     int unitinc_horizontal,
                                     int unitinc_vertical)

setBorder

public void setBorder(javax.swing.border.Border border)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.