org.tentackle.plaf
Class TFieldView

java.lang.Object
  extended by javax.swing.text.View
      extended by javax.swing.text.PlainView
          extended by javax.swing.text.FieldView
              extended by org.tentackle.plaf.TFieldView
All Implemented Interfaces:
SwingConstants, TabExpander

public class TFieldView
extends FieldView

Extended FieldView.

Author:
harald

Field Summary
 
Fields inherited from class javax.swing.text.PlainView
metrics
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
TFieldView(Element elem)
          Constructs a new FieldView wrapped on an element.
 
Method Summary
protected  Shape adjustAllocation(Shape a)
          Adjusts the allocation given to the view to be a suitable allocation for a text field.
 
Methods inherited from class javax.swing.text.FieldView
getFontMetrics, getPreferredSpan, getResizeWeight, insertUpdate, modelToView, paint, removeUpdate, viewToModel
 
Methods inherited from class javax.swing.text.PlainView
changedUpdate, damageLineRange, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, setSize, updateDamage, updateMetrics
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, updateChildren, updateLayout, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TFieldView

public TFieldView(Element elem)
Constructs a new FieldView wrapped on an element.

Parameters:
elem - the element
Method Detail

adjustAllocation

protected Shape adjustAllocation(Shape a)
Adjusts the allocation given to the view to be a suitable allocation for a text field. If the view has been allocated more than the preferred span vertically, the allocation is changed to be centered vertically. Horizontally the view is adjusted according to the horizontal alignment property set on the associated JTextField (if that is the type of the hosting component).

Overridden to allow alignment TOP and BOTTOM. This is used in FormTables if the rowsize is larger than one Font-Height.

Overrides:
adjustAllocation in class FieldView
Parameters:
a - the allocation given to the view, which may need to be adjusted.
Returns:
the allocation that the superclass should use.


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de