Package docking.widgets.fieldpanel.field
Interface Field
-
- All Known Subinterfaces:
ListingField
,TextField
- All Known Implementing Classes:
ClangTextField
,ClippingTextField
,EmptyTextField
,ErrorListingField
,FlowLayoutTextField
,ImageFactoryField
,IndentField
,ListingTextField
,OpenCloseField
,ReverseClippingTextField
,SimpleImageField
,SimpleTextField
,VerticalLayoutTextField
,WrappingVerticalLayoutTextField
public interface Field
Interface for display fields used by the FieldPanel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(int x, int y)
Returns true if the given point is in this field.int
getCol(int row, int x)
Returns the cursor column position for the given x coordinate on the given row.java.awt.Rectangle
getCursorBounds(int row, int col)
Returns a bounding rectangle for the cursor at the given position.int
getHeight()
Returns the height of this field when populated with the given data.int
getHeightAbove()
Returns the height above the baseLine.int
getHeightBelow()
Returns the height below the baseLine.int
getNumCols(int row)
Returns the number of columns in the given row.int
getNumRows()
Returns the number of rows in this fieldint
getPreferredWidth()
The minimum required width to paint the contents of this fieldint
getRow(int y)
Returns the row containing the given y coordinate.int
getScrollableUnitIncrement(int topOfScreen, int direction, int max)
Returns the amount to scroll to the next or previous lineint
getStartX()
Returns the horizontal position of this field.java.lang.String
getText()
Returns a string containing all the text in the field.java.lang.String
getTextWithLineSeparators()
Returns a string containing all the text in the field with extra linefeedsint
getWidth()
Returns the current width of this field.int
getX(int row, int col)
Returns the x coordinate for the given cursor position.int
getY(int row)
Returns the y coordinate for the given row.boolean
isPrimary()
Returns true if this field is "primary" (the most important) field; used to determine the "primary" line in the layout.boolean
isValid(int row, int col)
Returns true if the given row and column represent a valid location for this field with the given data;void
paint(javax.swing.JComponent c, java.awt.Graphics g, PaintContext context, FieldBackgroundColorManager colorManager, RowColLocation cursorLoc, int rowHeight)
Paints this field.void
rowHeightChanged(int heightAbove, int heightBelow)
notifies field that the rowHeight changedint
screenLocationToTextOffset(int row, int col)
Returns the text offset in the overall field text string for the given row and column.RowColLocation
textOffsetToScreenLocation(int textOffset)
Returns the row, column position for an offset into the string returned by getText().
-
-
-
Method Detail
-
getWidth
int getWidth()
Returns the current width of this field.
-
getPreferredWidth
int getPreferredWidth()
The minimum required width to paint the contents of this field- Returns:
- the minimum required width to paint the contents of this field
-
getHeight
int getHeight()
Returns the height of this field when populated with the given data.
-
getHeightAbove
int getHeightAbove()
Returns the height above the baseLine.
-
getHeightBelow
int getHeightBelow()
Returns the height below the baseLine.
-
getStartX
int getStartX()
Returns the horizontal position of this field.
-
paint
void paint(javax.swing.JComponent c, java.awt.Graphics g, PaintContext context, FieldBackgroundColorManager colorManager, RowColLocation cursorLoc, int rowHeight)
Paints this field.- Parameters:
g
- the graphics context.context
- common paint parameterscolorManager
- contains background color information for the field.cursorLoc
- the row,column cursor location within the field or null if the field does not contain the cursor
-
contains
boolean contains(int x, int y)
Returns true if the given point is in this field.- Parameters:
x
- the horizontal coordinate of the point.y
- the relatve y position in this layout
-
getNumRows
int getNumRows()
Returns the number of rows in this field
-
getNumCols
int getNumCols(int row)
Returns the number of columns in the given row.- Parameters:
row
- the row from which to get the number of columns.
-
getX
int getX(int row, int col)
Returns the x coordinate for the given cursor position.- Parameters:
row
- the text row of interest.col
- the character column.
-
getY
int getY(int row)
Returns the y coordinate for the given row.- Parameters:
row
- the text row of interest.
-
getRow
int getRow(int y)
Returns the row containing the given y coordinate.- Parameters:
y
- vertical pixel coordinate relative to the top of the screen.
-
getCol
int getCol(int row, int x)
Returns the cursor column position for the given x coordinate on the given row.- Parameters:
row
- the text row to find the column on.x
- the horizontal pixel coordinate for which to find the character position.
-
isValid
boolean isValid(int row, int col)
Returns true if the given row and column represent a valid location for this field with the given data;- Parameters:
row
- the text row.col
- the character position.
-
getCursorBounds
java.awt.Rectangle getCursorBounds(int row, int col)
Returns a bounding rectangle for the cursor at the given position.- Parameters:
row
- the text row.col
- the character postion.
-
getScrollableUnitIncrement
int getScrollableUnitIncrement(int topOfScreen, int direction, int max)
Returns the amount to scroll to the next or previous line- Parameters:
topOfScreen
- - the current y pos of the top of the screen.direction
- - the direction of the scroll (1 down, -1 up)max
- - the maximum amount to scroll for the entire row - will be positive for down, and negative for up)
-
isPrimary
boolean isPrimary()
Returns true if this field is "primary" (the most important) field; used to determine the "primary" line in the layout.
-
rowHeightChanged
void rowHeightChanged(int heightAbove, int heightBelow)
notifies field that the rowHeight changed- Parameters:
heightAbove
- the height above the baselineheightBelow
- the height below the baseline.
-
getText
java.lang.String getText()
Returns a string containing all the text in the field.
-
getTextWithLineSeparators
java.lang.String getTextWithLineSeparators()
Returns a string containing all the text in the field with extra linefeeds- Returns:
-
textOffsetToScreenLocation
RowColLocation textOffsetToScreenLocation(int textOffset)
Returns the row, column position for an offset into the string returned by getText().- Parameters:
textOffset
- the offset into the entire text string for this field.- Returns:
- a RowColLocation that contains the row,column location in the field for a position in the overall field text.
-
screenLocationToTextOffset
int screenLocationToTextOffset(int row, int col)
Returns the text offset in the overall field text string for the given row and column.- Parameters:
row
- the row.col
- the column.
-
-