javax.swing.text
Class ComponentView.Invalidator

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.text.ComponentView.Invalidator
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Enclosing class:
ComponentView

class ComponentView.Invalidator
extends Container

This class feeds the invalidate back to the hosting View. This is needed to get the View hierarchy to consider giving the component a different size (i.e. layout may have been cached between the associated view and the container hosting this component).


Nested Class Summary
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  Dimension max
           
(package private)  Dimension min
           
(package private)  Dimension pref
           
(package private)  float xalign
           
(package private)  float yalign
           
 
Fields inherited from class java.awt.Container
 
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
(package private) ComponentView.Invalidator(Component child)
           
 
Method Summary
private  void cacheChildSizes()
           
 void doLayout()
          Causes this container to lay out its components.
 float getAlignmentX()
          Returns the alignment along the x axis.
 float getAlignmentY()
          Returns the alignment along the y axis.
 Set getFocusTraversalKeys(int id)
          Returns the Set of focus traversal keys for a given traversal operation for this Container.
 Dimension getMaximumSize()
          Returns the maximum size of this container.
 Dimension getMinimumSize()
          Returns the minimum size of this container.
 Dimension getPreferredSize()
          Returns the preferred size of this container.
 void invalidate()
          The components invalid layout needs to be propagated through the view hierarchy so the views (which position the component) can have their layout recomputed.
 void setBounds(int x, int y, int w, int h)
          Moves and resizes this component.
 void setVisible(boolean b)
          Shows or hides this component depending on the value of parameter b.
 void validateIfNecessary()
           
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getListeners, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, 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

min

Dimension min

pref

Dimension pref

max

Dimension max

yalign

float yalign

xalign

float xalign
Constructor Detail

ComponentView.Invalidator

ComponentView.Invalidator(Component child)
Method Detail

invalidate

public void invalidate()
The components invalid layout needs to be propagated through the view hierarchy so the views (which position the component) can have their layout recomputed.

Overrides:
invalidate in class Container
See Also:
Container.validate(), Container.layout(), LayoutManager

doLayout

public void doLayout()
Description copied from class: Container
Causes this container to lay out its components. Most programs should not call this method directly, but should invoke the validate method instead.

Overrides:
doLayout in class Container
See Also:
LayoutManager.layoutContainer(java.awt.Container), Container.setLayout(java.awt.LayoutManager), Container.validate()

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
Description copied from class: Component
Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

Overrides:
setBounds in class Component
Parameters:
x - the new x-coordinate of this component
y - the new y-coordinate of this component
w - the new width of this component
h - the new height of this component
See Also:
Component.getBounds(), Component.setLocation(int, int), Component.setLocation(Point), Component.setSize(int, int), Component.setSize(Dimension)

validateIfNecessary

public void validateIfNecessary()

cacheChildSizes

private void cacheChildSizes()

setVisible

public void setVisible(boolean b)
Shows or hides this component depending on the value of parameter b.

Overrides:
setVisible in class Component
Parameters:
b - if true, shows this component; otherwise, hides this component
Since:
JDK1.1
See Also:
Component.isVisible()

getMinimumSize

public Dimension getMinimumSize()
Description copied from class: Container
Returns the minimum size of this container.

Overrides:
getMinimumSize in class Container
Returns:
an instance of Dimension that represents the minimum size of this container.
See Also:
Container.getPreferredSize(), Container.getLayout(), LayoutManager.minimumLayoutSize(Container), Component.getMinimumSize()

getPreferredSize

public Dimension getPreferredSize()
Description copied from class: Container
Returns the preferred size of this container.

Overrides:
getPreferredSize in class Container
Returns:
an instance of Dimension that represents the preferred size of this container.
See Also:
Container.getMinimumSize(), Container.getLayout(), LayoutManager.preferredLayoutSize(Container), Component.getPreferredSize()

getMaximumSize

public Dimension getMaximumSize()
Description copied from class: Container
Returns the maximum size of this container.

Overrides:
getMaximumSize in class Container
See Also:
Container.getPreferredSize()

getAlignmentX

public float getAlignmentX()
Description copied from class: Container
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Overrides:
getAlignmentX in class Container

getAlignmentY

public float getAlignmentY()
Description copied from class: Container
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Overrides:
getAlignmentY in class Container

getFocusTraversalKeys

public Set getFocusTraversalKeys(int id)
Description copied from class: Container
Returns the Set of focus traversal keys for a given traversal operation for this Container. (See setFocusTraversalKeys for a full description of each key.)

If a Set of traversal keys has not been explicitly defined for this Container, then this Container's parent's Set is returned. If no Set has been explicitly defined for any of this Container's ancestors, then the current KeyboardFocusManager's default Set is returned.

Overrides:
getFocusTraversalKeys in class Container
Parameters:
id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
Returns:
the Set of AWTKeyStrokes for the specified operation. The Set will be unmodifiable, and may be empty. null will never be returned.
See Also:
Container.setFocusTraversalKeys(int, java.util.Set), KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS