public class BrowseGuiImpl extends Browse<GuiOutputManager> implements Hoverable, HasOptimalSize
Modifier and Type | Class and Description |
---|---|
private class |
BrowseGuiImpl.ColumnSetContainer
Set of arranged columns.
|
private class |
BrowseGuiImpl.ColumnsScrollPane
Scroll pane for the
scrollableColumnSet . |
private class |
BrowseGuiImpl.HorizontalColumnScroller
Class for handling horizontal scrolling.
|
private class |
BrowseGuiImpl.VerticalRowScroller
Class for handling vertical scrolling.
|
Browse.SelectedRow
Modifier and Type | Field and Description |
---|---|
private static int |
ALLOWED_HIDDEN_CELL_BOTTOM_PART
Part of the cell the can be hidden at bottom.
|
private ColorRgb |
backgroundColor
Background color.
|
static int |
BORDER_THICKNESS
Width of browse/column border.
|
private GuiFontResolver |
browseFontResolver
Font resolver.
|
private boolean |
browseLayoutMode
true if the browse is in layout mode. |
private CoordinatesConversion |
cc
Coordinates conversion.
|
(package private) static int |
CELL_OFFSET_BOTTOM
Bottom offset for text area in a cell.
|
(package private) static int |
CELL_OFFSET_TOP
Top offset for text area in a cell.
|
private GuiColorResolver |
colorResolver
Browse color resolver.
|
(package private) static int |
COLUMN_RESIZE_AREA_WIDTH
Width of a resize area.
|
(package private) static int |
DATA_OFFSET_RIGHT
Right offset for text area in a cell.
|
private static int |
DEFAULT_DYNAMIC_DOWN_SIZE
Default DOWN value for a dynamic browse.
|
private static int |
DEFAULT_DYNAMIC_WIDTH_CHARS
Default width for a dynamic browse.
|
private BrowseColumnGuiImpl |
draggedColumn
Reference to the column which is being dragged.
|
private static EnhancedBrowseSaveTarget[] |
enhancedSaveTargets
Cache of save targets for enhanced browse.
|
private GuiDriver |
gd
Screen driver
|
(package private) static int |
H_BAR_THUMB_WIDTH
Width of the thumb of the horizontal scroll bar.
|
private int |
horizontalColumnScrollMax
Maximum for horizontal scrolling in column scrolling mode.
|
private ScrollBarGuiImpl |
horizontalScrollbar
Horizontal scrollbar.
|
private ScrollBarControllerGuiImpl |
horizontalScroller
Horizontal scroller.
|
private int |
hScrollingStep
Horizontal scrolling step for non-COLUMN-SCROLLING mode.
|
private java.util.Map<BrowseColumnGuiImpl,java.util.Map<java.lang.Integer,Hyperlink>> |
hyperlinkWidgets
All hyperlink widgets for the current view.
|
private boolean |
initialRepositionDone
true if initial reposition was done (i.e. |
private int |
leftDragColumnMouseOffset
Offset from the left edge of the column which is being dragged to the position of the
pointer inside the column.
|
private int |
leftDragColumnOffset
Offset from the left edge of the browse (or the edge of the markers column) to the left
edge of the column which is being dragged.
|
private int |
leftResizeColumnOffset
Offset from the left edge of the browse to the left edge of the contour of the column which
is being resized.
|
private BrowseGuiImpl.ColumnSetContainer |
lockedColumnSet
Content pane for browse columns and data (locked part).
|
private int |
lockedColumnsWidth
Total width of the locked columns.
|
private static java.util.logging.Logger |
LOG
Logger.
|
private BrowseColumnGuiImpl |
markersColumn
Markers column (leftmost).
|
private static int |
MAX_SCROLL_ROWS_PER_WHEEL_ROTATION
How many rows is scrolled per one mouse wheel rotation (at maximum).
|
private BrowseColumnGuiImpl |
meColumn
The column that generates the focus events.
|
static int |
MIN_BROWSE_ROWS
Minimum number of rows in a browse.
|
private static int |
MIN_COL_WIDTH_PIXELS
Minimal width of a column, in pixels.
|
static int |
MIN_RESIZE_ROW_HEIGHT
Minimum allowed height of a row during resize.
|
private boolean |
mouseFocusGained
If browse gained focus by mouse click rather than other ways.
|
private int |
paddedRowHeight
Row height (in pixels) excluding borders and separators.
|
(package private) static int |
RESIZE_LINE_VERTICAL_OFFSET
Top or bottom offset for a column resize contour.
|
private BrowseColumnGuiImpl |
resizedColumn
Reference to the column which is being resized.
|
private int |
rightResizeColumnOffset
Offset from the left edge of the browse to the right edge of the contour of the column which
is being resized.
|
private static int |
ROW_RESIZE_AREA_HEIGHT
Height of a row resize area (of the part with overlaps with a cell).
|
static int |
ROW_RESIZE_BOTTOM_OFFSET
Offset from the bottom of the browse which limits the row height during resizing.
|
private BrowseGuiImpl.ColumnSetContainer |
scrollableColumnSet
Content pane for browse columns and data (scrollable part).
|
private ScrollPaneGuiImpl |
scrollPane
Scrollable wrapper for
scrollableColumnSet , used for handling empty (it may be
colored) area between the rightmost column and the vertical scroller. |
private static ColorRgb |
SEPARATOR_DEFAULT_COLOR
Default separator color.
|
private static ColorRgb |
SEPARATOR_DEFAULT_COLOR2
Default separator color if background browse color matches
SEPARATOR_DEFAULT_COLOR . |
private ColorRgb |
separatorColor
Separator color.
|
private static java.lang.String |
SORT_ARROW_DOWN_IMAGE_NAME
Name of the sorting arrow down image.
|
static int |
SORT_ARROW_HEIGHT
Height of a sort arrow displayed on column labels, in pixels.
|
private static java.lang.String |
SORT_ARROW_UP_IMAGE_NAME
Name of the sorting arrow up image.
|
static int |
SORT_ARROW_WIDTH
Width of a sort arrow displayed on column labels, in pixels.
|
static int |
SORT_NUMBER_HEIGHT
Height of a sort number displayed on column labels, in pixels.
|
private static java.lang.String |
SORT_NUMBER_IMAGE_NAME_TEMPLATE
Template of a sorting number image name.
|
static int |
SORT_NUMBER_WIDTH
Width of a sort number displayed on column labels, in pixels.
|
private ImageWrapper |
sortArrowDownImage
Cached sort arrow down image.
|
private ImageWrapper |
sortArrowUpImage
Cached sort arrow up image.
|
private ImageWrapper[] |
sortNumberImages
Cached images of sort numbers.
|
private GuiFontResolver |
titleFontResolver
Font resolver for the browse title font.
|
private int |
titleHeight
Browse title height (without title borders).
|
private BorderedPanelGuiImpl |
titlePanel
Title panel.
|
private int |
totalColumnsWidth
Total columns width.
|
private EnhancedBrowseConfig |
undoConfig
Undo configuration for enhanced browse.
|
private static int |
UP_KEY_BOTTOM_OFFSET_ROWS
When the current row is out of the view below, then if we press UP key, the new current row
becomes
max(1, DOWN - UP_KEY_BOTTOM_OFFSET_ROWS) th row in the viewport
(1-based). |
private ScrollBarGuiImpl |
verticalScrollbar
Vertical scrollbar.
|
private ScrollBarControllerGuiImpl |
verticalScroller
Vertical scroller.
|
activeEditor, browseModel, CACHE_SIZE, colorCommon, colorCurrent, colorHSep, config, currColumn, currentRowDisplayStrategy, currRowSelected, currRowUpdates, dcData, drawLabels, editedRow, editedRowIndex, editingExistingRowBefore, hadDraw, ilFirstScrollCol, ilLabelsHeight, initialRow, intermediateDcData, navigable, NEW_ROWS_NUMERATION_START, originalHeight, originalWidth, pseudoFocus, rcLabels, rowCountAssessment, savingRow, scrollColumn, selectedRowIndices, separatorQuirk
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
BrowseGuiImpl(WidgetId id,
BrowseConfig cfg)
Constructs the Browse widget.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateDirectManipulation()
Activates direct manipulation engine for this widget.
|
protected void |
addEditor(Widget editor)
Add editor widget to the browse.
|
private void |
adjustLockedColumnsPanel()
Set the width of the
lockedColumnSet panel according to
lockedColumnsWidth . |
void |
afterConfigUpdate(BrowseConfig beforeUpdate)
The method is called after the configuration associated with the
owner changes.
|
boolean |
applyDefault4glConfig()
Apply default 4GL configuration (non-enhanced) for this browse.
|
void |
applyEnhancedConfigClient(EnhancedBrowseConfig config)
Client-side part of the code which applies the given enhanced configuration to the browse.
|
(package private) boolean |
beforeColumnHeaderPressed()
Perform actions which should happen when a header of a column is pressed.
|
private void |
buildPanels()
Create column panels and widgets.
|
private void |
cacheTextMetrics(FontDetails font,
java.lang.String text,
java.lang.Integer windowId)
Cache metric of the given text.
|
private int |
calcDown()
Calculate DOWN value.
|
int |
calcDown(int rowHeightPixels)
Calculate DOWN value for the browse basing on the given row height.
|
private int |
calcImplicitBrowseHeightNoScrollbar()
Get browse native height if it is not specified explicitly (based on explicit or implicit
DOWN value).
|
private int |
calcImplicitRowHeight()
Calculate implicit row height basing on the font height.
|
private int |
calcRowHeight()
Calculate row height basing on the ROW-HEIGHT-CHARS or font height.
|
private int |
calcTitleHeight()
Calculate title height.
|
(package private) void |
changeColumnVisibility(int columnOrdinal,
boolean visible)
Change visibility of the column.
|
protected void |
cleanupEditor(Widget editor)
Clean up editor widget.
|
protected java.util.Map<FontDetails,java.util.Set<java.lang.String>> |
collectColumnTexts(BrowseColumnGuiImpl column,
java.util.Map<FontDetails,java.util.Set<java.lang.String>> texts)
Collect texts of all cells in the given column in the current view and add them to the
specified map.
|
protected void |
columnToView(int visibleColumnIndex)
Setups scrolling to fully (as possible) show the given column.
|
protected ToggleBox |
createEditingToggleBox(boolean useValue,
BaseDataType value)
Create toggle-box editor widget for the current column.
|
protected Widget |
createEditor(boolean useValue,
BaseDataType value)
Create editor widget for the current column.
|
private void |
createLockedColumnsSet()
Create and initialize locked columns set (if it wasn't created before).
|
private void |
createMarkersColumn()
Create markers (leftmost) column if it doesn't exist yet.
|
private void |
createTitlePanel()
Create title panel.
|
Widget<GuiOutputManager> |
currentFocus()
Returns the same as
getDefaultFocus() because focus placement
inside BROWSE can't be switched from initial component until subcomponent
creation or deletion. |
protected void |
deactivateDirectManipulation()
Deactivates direct manipulation engine for this widget.
|
void |
destroy()
Destroy this widget.
|
void |
doLayout()
Lay out the browse.
|
void |
draw()
Draws the widget: border, header, selection marks and line, internal FillIn etc.
|
void |
drawCaret()
Sets position of terminal's cursor.
|
boolean |
drawRowAsSelected(int viewportRowIndex)
Returns
true if the specified row is drawn as selected. |
private boolean |
fitLastColumn()
Fit the last column if FIT-LAST-COLUMN attribute is set.
|
int |
fixupNoLabelsY(int y)
Get Y coordinate minus possible labels height.
|
GuiColorResolver |
getBrowseColorResolver()
Get browse color resolver.
|
(package private) FontDetails |
getBrowseFont()
Get browse font.
|
(package private) FontDetails |
getBrowseLabelFont()
Get browse labels font.
|
GuiCellAttributes |
getCellAttr(BrowseRow[] rowCache,
int viewportIndex,
int columnOrdinal)
Get attribute container for the given cell from the specified row cache.
|
GuiCellAttributes |
getCellAttr(int viewportIndex,
int columnOrdinal)
Get attribute container for the given cell.
|
GuiCellAttributes |
getCellAttrWithIntermediate(int viewportIndex,
int columnOrdinal)
Get attribute container for the given cell from the cache containing intermediate rows
(
Browse.intermediateDcData ), if it is available, or normat cache (Browse.dcData )
otherwise. |
java.lang.String |
getCellText(int viewportIndex,
int columnOrdinal)
Get text of the cell.
|
java.lang.String |
getCellTextWithIntermediate(BrowseColumnGuiImpl column,
int viewportIndex)
Get text of the cell from the cache containing intermediate rows
(
Browse.intermediateDcData ), if it is available, or normal cache (Browse.dcData ) |
BaseDataType |
getCellValue(int viewportIndex,
int columnOrdinal)
Get value of the cell.
|
BaseDataType |
getCellValueWithIntermediate(BrowseColumnGuiImpl column,
int viewportIndex)
Get value of the cell from the cache containing intermediate rows
(
Browse.intermediateDcData ), if it is available, or normal cache (Browse.dcData ) |
private BrowseColumnGuiImpl |
getColumn(BrowseColumnConfig[] columns,
int index)
Get the browse column with the specific index in the given array.
|
BrowseColumnGuiImpl |
getColumn(int columnOrdinal)
Get the browse column with the specific index.
|
private int |
getColumnOffset(int visibleColumnIndex)
Get offset of the column from the left edge of the viewport or from the right edge of
the last locked column if there are locked columns (if the is scroll pane is on its initial
position).
|
BaseDataType |
getColumnValue(int visibleIndex)
Get value of the given column in current row.
|
protected int |
getCurrentEditorX()
Get X coordinate for the current editor (relatively to the containing column set).
|
protected int |
getCurrentEditorY()
Get Y coordinate for the current editor (relatively to the containing column set).
|
BrowseColumnGuiImpl |
getCurrentMarkersColumn()
Obtain the current marker column.
|
private int |
getEffectiveMinColumnWidth()
Get minimum visual width of a column (data width + offsets).
|
EnhancedBrowseSaveTarget[] |
getEnhancedBrowseSaveTargets()
Get save targets for an enhanced browse configuration, which are available for the current
user.
|
int |
getHorizontalScrollingPosition()
Get position of the horizontal scroll bar.
|
int |
getLabelLinesNum()
Number of lines in the labels area (matches the number of lines in the tallest multi-line
label).
|
int |
getLabelsAreaHeight()
Get height of the labels area (in pixels), including borders.
|
int |
getLabelsHeight()
Get height of the labels area (in pixels), excluding borders.
|
protected int |
getLeftColumnContourLimit()
Returns the left limit for the resize column contour (relative to browse).
|
(package private) int |
getLockedColumnsWidth()
Get total width of the locked columns,
|
private Point |
getLockedPaneLocation()
Get locked panel location.
|
java.lang.String |
getMousePointerImpl()
Get the MOUSE-POINTER attribute
|
double |
getOptimalWidth()
Returns optimal size.
|
protected int |
getPageSize()
Get page size used for Page Up / Page Down.
|
protected int |
getRightColumnContourLimit()
Returns the right limit for the resize column contour (relative to browse).
|
int |
getRowByCoordinates(int y)
Get viewport index of the row which corresponds given vertical position.
|
int |
getRowHeight()
Get row height (in pixels), excluding borders and separators.
|
BrowseColumnGuiImpl.ResizeArea |
getRowResizeArea(NativePoint browseColumnPoint)
If the pointer is currently positioned over a row resize area, return that area.
|
Widget |
getScrollableColumnSet()
Get the scrollable column widget.
|
private int |
getScrollbarThickness(ScrollBar.Orientation orientation)
Get thickness (width or height) of the corresponding scroll bar.
|
ScrollPaneGuiImpl |
getScrollPane()
Gets scrollpane container to draw something in coordinates related to it.
|
private NativeDimension |
getScrollPaneDimension()
Get scroll pane dimension.
|
private Point |
getScrollPaneLocation()
Get scroll panel location.
|
private int |
getSearchColumn()
Get the search column, i.e.
|
ColorRgb |
getSeparatorColor()
Get separator color.
|
private ScrollPaneGuiImpl.ShowBars |
getShowBars(boolean horizontal,
boolean vertical)
Get
ScrollPaneGuiImpl.ShowBars option which corresponds given visibility of the
scroll bars. |
ImageWrapper |
getSortArrowImage(boolean ascending)
Get cached sorting arrow image.
|
ImageWrapper |
getSortNumImage(int num)
Get image of the given sort number.
|
int |
getTitleHeight()
Get the height of the title, if any.
|
int |
getTopRowOffset(int viewportIndex)
Get top offset of the row (relatively to the place where label drawing starts).
|
int |
getTopYforRow(int rowNdx)
Gets vertical position of the given row related to the browse column vertical start.
|
int |
getTotalColumnsWidth()
Get the total width of the columns of this browse widget.
|
NativeRectangle |
getViewportBoundedRectangle()
Get viewport bounded rectangle.
|
NativeDimension |
getViewportDimension()
Get viewport dimension.
|
private BrowseColumnGuiImpl |
getVisibleColumn(int visibleColumnIndex)
Get the visible browse column with the specific index.
|
protected void |
handleTabKey()
Handle TAB key press.
|
boolean |
hasFocus()
Check if widget has focus.
|
private boolean |
hasHyperlinkedColumns()
Returns
true if there is at least one visible column with hyperlinks. |
boolean |
hasTitle()
Determines if this browse has title.
|
protected void |
initEditorConfig(BaseConfig cfg)
Initialize editor widget config.
|
void |
initialize(WidgetId id,
BrowseConfig wcfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
protected boolean |
isAggressiveCurrentRowSelection()
Returns
true if the current row of the single-selection browse is selected on
FOCUS-GAINED and some other events. |
(package private) boolean |
isColumnDrag()
Returns
true if a column is being dragged. |
boolean |
isColumnMovable()
Returns
true if columns are movable. |
boolean |
isColumnResizable()
Returns
true if columns are resizable. |
(package private) boolean |
isColumnResize()
Returns
true if a column is being resized. |
(package private) boolean |
isCtrlModifier(java.awt.event.MouseEvent e)
Returns
true if CTRL key was held down when a mouse button was pressed. |
boolean |
isCurrentEditingColumn(BrowseColumnGuiImpl column)
Returns
true if the given column is the current column and editing is in
progress. |
protected boolean |
isDirectManipulationRequired()
Checks if direct manipulation feature must be installed or removed in GUI mode.
|
boolean |
isDrawnAsFocused()
Check if the browse should be drawn as a focused widget.
|
boolean |
isDroppable()
Checks if the given widget is able to be the target of the drop operation.
|
(package private) boolean |
isLabelsVisible()
Determine if the labels area is visible.
|
(package private) boolean |
isLastLockedColumnResizeArea(java.awt.event.MouseEvent e)
Returns
true if the mouse pointer is positioned over the resize area after the
right edge of the last locked column. |
boolean |
isLayoutMode()
Returns
true if browse layout mode is active. |
(package private) boolean |
isPerformLayout()
Return
true if browse layout needs to be performed. |
protected boolean |
isRefreshedOnEnable()
Determines if browse refreshed on browse widget enabling.
|
boolean |
isRowResizable()
Returns
true if rows are resizable. |
private boolean |
isShiftModifier(java.awt.event.MouseEvent e)
Returns
true if SHIFT key was held down when a mouse button was pressed. |
protected void |
layoutHyperlinks()
Perform layout for all hyperlinks (determine their size, position etc.).
|
protected int[] |
mouseActions()
Sub-classes will override this to return a list of mouse actions on which the widget
responds.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Notification of a mouse dragged event occurred for this widget.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel moved event occurred for this widget.
|
void |
moveColumn(int srcIndex,
int destIndex)
Implements the client side of the MOVE-COLUMN() widget method.
|
private void |
moveColumnInArray(java.lang.Object[] array,
int srcIndex,
int destIndex)
Repositions the element in the array.
|
private boolean |
needsColumnFit()
Returns
true if last column should be fit according to FIT-LAST-COLUMN or
NO-EMPTY-SPACE option. |
protected void |
notifyBrowseScrolled()
Notify that the browse has been scrolled (i.e.
|
void |
notifyColumnsUpdated()
Notify the browse that some columns have been added to it or visibility of columns has been
changed.
|
void |
onFocusGained(FocusEvent event)
Handle situation when
Browse widget receives the focus. |
void |
onFocusLost(FocusEvent event)
Handle situation when
Browse widget loses the focus. |
void |
onKeyPressed(KeyInput event)
Process key event.
|
protected java.util.Map<FontDetails,java.util.Set<java.lang.String>> |
prepareHyperlinks()
Create hyperlink widgets without performing layout: destroy all old hyperlink widgets from
the old browse view and create new widgets for the current view.
|
void |
processDirectManipulationEvent(DirectManipulationEvent event)
Process direct manipulation event.
|
void |
processEvent(Event evt)
Intercept special events.
|
void |
queryRepositioned(boolean repositionError,
int targetRepositionRow)
Notify the browse that the underlying query has been repositioned..
|
private void |
rebuildColumns()
Re-initiate column widgets.
|
void |
refresh(boolean deleteCurrentRowMode)
Refresh the browse cache and redisplay the browse.
|
(package private) void |
resetPressedColumns(boolean trigger)
Set all column in non-pressed state.
|
ColorRgb |
resolveColor(int columnValue,
ColorRgb columnEhValue,
int browseValue,
ColorRgb browseEhValue,
boolean fg,
boolean label)
Resolve color basing on input parameters.
|
private void |
resolveColors()
Resolve colors.
|
void |
resolveFonts()
Resolve fonts for browse and its columns.
|
(package private) void |
rowClicked(int viewportRowIndex,
int visibleColumnIndex,
java.awt.event.MouseEvent e)
Handle row clicks.
|
protected void |
scrollToColumn(int visibleColumnIndex)
Setups scrolling to fully (as possible) show the given column.
|
protected void |
scrollToEditableRow()
Scroll to the editable row if it is out of the view.
|
private void |
searchByKey(char searchChar)
Perform search by key: find the row which starts with the given character.
|
private void |
setColumnScrolling(boolean columnScrolling)
Set COLUMN-SCROLLING or non-COLUMN-SCROLLING modes.
|
private void |
setCurrentSingleRowSelected()
Select current row for single-selection case.
|
void |
setEnabled(boolean enabled)
Enable/disable widget.
|
void |
setIntermediateRows(BrowseRow[] rows)
Set "intermediate" rows (i.e.
|
(package private) void |
setMouseActionColumn(BrowseColumnGuiImpl col)
Register column that will generate next focus events.
|
void |
setMousePointerName(java.lang.String name)
Set the MOUSE-POINTER attribute
|
void |
setSize(double width,
double height)
Set container size.
|
private void |
showHorizontalScrollbar(boolean show)
Show or hide horizontal scrollbar.
|
protected Menu |
showPopupMenu(BrowseColumnGuiImpl column,
java.awt.event.MouseEvent e,
java.lang.Runnable dismissHandler)
Show browse popop menu on mouse right-click.
|
protected Menu |
showPopupMenu(java.awt.event.MouseEvent e,
java.lang.Runnable dismissHandler)
The method shows the popup menu for this widget.
|
(package private) void |
startColumnDrag(BrowseColumnGuiImpl column,
int leftDragColumnMouseOffset)
Start column dragging.
|
(package private) void |
startColumnResize(int visibleColumnIndex)
Start column resizing.
|
protected boolean |
startEdit(WidgetId prevFocus,
boolean updateSelection,
boolean useValue,
BaseDataType value)
Creates an editor for the current cell and adds it to the browse.
|
void |
startLayoutMode()
Start browse layout mode.
|
(package private) void |
stopColumnDrag(java.awt.event.MouseEvent e)
Stop column dragging.
|
(package private) void |
stopColumnResize()
Stop column resizing.
|
void |
stopLayoutMode(boolean undo,
EnhancedBrowseSaveTarget set)
Stop browse layout mode.
|
(package private) void |
stretchColumns()
Resizes visible columns to utilize all the available width of the columns container.
|
boolean |
supportsCustomMousePointer()
Check if the widget supports LOAD-MOUSE-POINTER() method
|
private void |
updateBrowseDimensions()
Update browse width and height without actual layout.
|
protected boolean |
updateColumn(int columnOrdinal,
BaseDataType var)
Update specified cell in current row.
|
private void |
updateColumnSetsHeight()
Update height of scrollable and locked column sets in order to to match the viewport height.
|
private void |
updateEditorAfterColumnModification()
Update editor after column moving or resizing.
|
(package private) void |
updateEnhancedFont(EnhancedBrowseParameter param,
FontDetails font)
Set the new enhanced font for this browse, which includes recalculation of row and label
heights and recalculation of column widths for the columns with implicit width.
|
private void |
updateHorizontalColumnScrollMax()
Update maximum for horizontal scrolling in column scrolling mode.
|
protected void |
updateLabelsHeight()
Update height of the labels area.
|
private void |
updateLabelsVisible()
Update value of the
Browse.drawLabels attribute which defines if the labels area is
visible. |
private void |
updateRowHeight()
Update row height.
|
private void |
updateVerticalScrollbarVisibility()
Show or hide vertical scrollbar depending on (NO-)SCROLLBAR-VERTICAL flag state.
|
Window |
window()
Get ancestor Window for this widget.
|
addNewRow, advanceCurrRowOrSelection, advanceRowSelection, cellStartsWith, clearWidget, config, createEditingFillIn, dcGetRow, dcGetRowData, dcGetRowIndex, defaultFocus, deselectAll, deselectFocusedRow, deselectSelectedRow, displayErrorMessage, executePendingRefresh, finishStopEdit, fireDefaultAction, fireValueChanged, focusTraversable, generateQuestionMarks, getActiveEditor, getActiveFillIn, getActiveToggleBox, getCachedRowNumber, getCachedRowNumber, getCachedRowNumberWithIntermediate, getCacheSize, getCacheSizeWithIntermediate, getCellText, getCellTextNoError, getColumnCfg, getColumnCount, getColumns, getColumnText, getCurrentColumn, getCurrentRow, getCurrentRowAsSelected, getDisplayFormat, getDown, getEdgeExistingRow, getEditorValue, getFirstExistingRow, getFocusedRow, getFocusedWidget, getIdsOfColumnWidgets, getInvisibleColumns, getLabelVar, getLastAvailableSelectedRow, getLastExistingRow, getLegacyWidget, getMaximalSelectedRowIndex, getModel, getNewRowsBefore, getNextColumn, getPrevColumn, getRepositionedRow, getRowDisplayTriggerId, getRows, getRows, getScreenBufferForTrigger, getScrollRow, getSelectedRowIndex, getSelectedRowIndex, getSelectedRowIndexes, getSelectedRowsCount, getValue, getValue, getViewportRow, getViewportRow, getVisibleColumnCfg, getVisibleColumnCount, getVisibleColumns, goDown, goDown, goDownWithSelection, goUp, goUp, goUpWithSelection, hasFocusable, hasFocusable, hasRowMarkers, incrementalScroll, incrementalScroll, initQueryAssigned, insertEditingRow, insertRow, invokeLeaveCellTrigger, invokeRowEntryTrigger, invokeRowLeaveTrigger, isConditionalReposition, isCurrentRowInView, isCurrentRowModified, isEditing, isEditorFillIn, isEditorModified, isEditorToggleBox, isEditPossible, isFirstBrowseRow, isFirstLastRowCopyQuirk, isFocusedRowSelected, isModified, isNewEditingRowOutOfTheView, isNewRow, isNewRow, isOnePageScrollingMode, isRightAligned, isRightAligned, isRowInView, isRowSelected, isSavingRow, isSelectedRowAvailable, isSelectionMultiple, isViewportEdge, leaveRow, nextFocus, nextNewRowNumber, notifyKeyPressedInEditor, onKeyTyped, ordinalToVisible, parentFrameViewed, populateColumnsCache, prevFocus, queryClosed, refreshAfterDeletion, refreshCurrentRow, refreshScrollRow, refreshScrollRow, refreshScrollRow, refreshScrollRow, refreshScrollRow, releaseCurrentRow, removeFromSelection, renderCell, requestFocus, resetColumnsCache, scrollToCurrentRow, scrollToRow, scrollToRow, scrollToRow, scrollToRow, scrollToRow, scrollToRow, scrollToRow, scrollToSelectedRow, selectAll, selectFocusedRow, selectNextRow, selectPreviousRow, selectRow, setColumnValue, setCurrentColumn, setCurrentRow, setCurrentRow, setEditorReadOnly, setEditorValue, setHighlighted, setReadOnly, setSelectionMultiple, show, startEdit, startEdit, startEdit, stopEdit, stopEdit, stopEdit, switchCurrentRowSelection, switchToNextCell, undoValue, undoValue, updateMaxDataGuess, valid, validateEditorValue, visibleToOrdinal
minimumSize
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, cycleFocus, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, onWidgetAdded, onWidgetRemoved, prepareWidgets, processKeyEvent, reflectAncestorChange, reflectLocationChange, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setTabItemList, setWidth, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, width
_setHidden, _setVisible, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, debug, disable, displayPhysicalLocation, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hidden, hide, highlighted, ignoreAction, isCurrent, isDirectManipulationCapable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setHidden, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, sync, topLevelWindow, toString, translate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, defaultMousePtr, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hidden, hide, highlighted, isCurrent, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setHidden, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, topLevelWindow
static final int CELL_OFFSET_TOP
static final int CELL_OFFSET_BOTTOM
public static final int BORDER_THICKNESS
static final int H_BAR_THUMB_WIDTH
static final int DATA_OFFSET_RIGHT
public static final int SORT_ARROW_WIDTH
public static final int SORT_ARROW_HEIGHT
public static final int SORT_NUMBER_WIDTH
public static final int SORT_NUMBER_HEIGHT
public static final int MIN_BROWSE_ROWS
public static final int MIN_RESIZE_ROW_HEIGHT
public static final int ROW_RESIZE_BOTTOM_OFFSET
static final int COLUMN_RESIZE_AREA_WIDTH
BrowseColumnGuiImpl
enum ResizeArea for more
information.static final int RESIZE_LINE_VERTICAL_OFFSET
private static final int ALLOWED_HIDDEN_CELL_BOTTOM_PART
private static final ColorRgb SEPARATOR_DEFAULT_COLOR
private static final ColorRgb SEPARATOR_DEFAULT_COLOR2
SEPARATOR_DEFAULT_COLOR
.private static final int DEFAULT_DYNAMIC_DOWN_SIZE
private static final int DEFAULT_DYNAMIC_WIDTH_CHARS
private static final java.lang.String SORT_ARROW_UP_IMAGE_NAME
private static final java.lang.String SORT_ARROW_DOWN_IMAGE_NAME
private static final java.lang.String SORT_NUMBER_IMAGE_NAME_TEMPLATE
private static final java.util.logging.Logger LOG
private static final int UP_KEY_BOTTOM_OFFSET_ROWS
max(1, DOWN - UP_KEY_BOTTOM_OFFSET_ROWS)
th row in the viewport
(1-based).private static final int MAX_SCROLL_ROWS_PER_WHEEL_ROTATION
private static final int ROW_RESIZE_AREA_HEIGHT
private static final int MIN_COL_WIDTH_PIXELS
private static EnhancedBrowseSaveTarget[] enhancedSaveTargets
private GuiDriver gd
private GuiFontResolver titleFontResolver
private GuiFontResolver browseFontResolver
private BrowseGuiImpl.ColumnSetContainer scrollableColumnSet
lockedColumnSet
to scrollableColumnSet
or vice
versa.private BrowseGuiImpl.ColumnSetContainer lockedColumnSet
lockedColumnSet
to scrollableColumnSet
or vice
versa. This field can be null
.private ScrollPaneGuiImpl scrollPane
scrollableColumnSet
, used for handling empty (it may be
colored) area between the rightmost column and the vertical scroller.
See BrowseGuiImpl.ColumnsScrollPane
for more information.private GuiColorResolver colorResolver
private int titleHeight
private CoordinatesConversion cc
private ColorRgb separatorColor
private ColorRgb backgroundColor
private int paddedRowHeight
paddedRowHeight =
config.rowHeightPixels + CELL_OFFSET_TOP + CELL_OFFSET_BOTTOM
.private BorderedPanelGuiImpl titlePanel
private int totalColumnsWidth
private int lockedColumnsWidth
private int hScrollingStep
private BrowseColumnGuiImpl markersColumn
private ScrollBarGuiImpl horizontalScrollbar
private ScrollBarGuiImpl verticalScrollbar
private int horizontalColumnScrollMax
private boolean mouseFocusGained
private ScrollBarControllerGuiImpl verticalScroller
private ScrollBarControllerGuiImpl horizontalScroller
private BrowseColumnGuiImpl draggedColumn
private BrowseColumnGuiImpl resizedColumn
private int leftDragColumnMouseOffset
private int leftDragColumnOffset
private int leftResizeColumnOffset
private int rightResizeColumnOffset
private ImageWrapper sortArrowUpImage
private ImageWrapper sortArrowDownImage
private ImageWrapper[] sortNumberImages
private boolean initialRepositionDone
true
if initial reposition was done (i.e. reposition on opening of the first
assigned query). Used in handling of the selection state of the first row on initial display
of a single-selection browse.private boolean browseLayoutMode
true
if the browse is in layout mode.private EnhancedBrowseConfig undoConfig
private java.util.Map<BrowseColumnGuiImpl,java.util.Map<java.lang.Integer,Hyperlink>> hyperlinkWidgets
private BrowseColumnGuiImpl meColumn
public BrowseGuiImpl(WidgetId id, BrowseConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.BrowseConfig)
to finish the widget initialization.
id
- The widget's ID.cfg
- Browse config,public void initialize(WidgetId id, BrowseConfig wcfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<BrowseConfig>
initialize
in class Browse<GuiOutputManager>
id
- The widget's ID.wcfg
- The config used to initialize this widget.public void setSize(double width, double height)
setSize
in interface Container<GuiOutputManager>
setSize
in class AbstractContainer<GuiOutputManager>
width
- New width.height
- New height.public void afterConfigUpdate(BrowseConfig beforeUpdate)
The implemented logic must be idempotent - the method must produce the same results if executed once or multiple times not relying on any particular call sequence or related state. This is necessary so that the method can be repeated or retried as often as necessary without causing unintended effects
afterConfigUpdate
in interface ConfigOwner<BrowseConfig>
afterConfigUpdate
in class Browse<GuiOutputManager>
beforeUpdate
- Config reference capturing the config state before
the owner's config was modified.public GuiCellAttributes getCellAttr(int viewportIndex, int columnOrdinal)
viewportIndex
- 0-based row index in the viewport.columnOrdinal
- 0-based column index.public GuiCellAttributes getCellAttrWithIntermediate(int viewportIndex, int columnOrdinal)
Browse.intermediateDcData
), if it is available, or normat cache (Browse.dcData
)
otherwise.viewportIndex
- 0-based row index in the viewport.columnOrdinal
- 0-based column index.public GuiCellAttributes getCellAttr(BrowseRow[] rowCache, int viewportIndex, int columnOrdinal)
rowCache
- Cache of rows: Browse.dcData
or Browse.intermediateDcData
.viewportIndex
- 0-based row index in the viewport.columnOrdinal
- 0-based column index.public void notifyColumnsUpdated()
notifyColumnsUpdated
in class Browse<GuiOutputManager>
public void setIntermediateRows(BrowseRow[] rows)
BrowseWidget.getRows(int, int, boolean, int, ScreenBuffer[], RowDisplayStrategy)
),
so these rows can be drawn if a pause occurs in ROW-DISPLAY trigger.setIntermediateRows
in class Browse<GuiOutputManager>
rows
- Rows to set.public void mouseClicked(java.awt.event.MouseEvent e)
If the widget is not already focused, it forces the focus to it. After the focus was received, it computes the caret location, based on the mouse position over the widget's content.
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public int getTitleHeight()
public void doLayout()
doLayout
in interface Container<GuiOutputManager>
doLayout
in class Browse<GuiOutputManager>
public int getRowHeight()
public int getLabelsHeight()
public int getLabelsAreaHeight()
public int getLabelLinesNum()
public void drawCaret()
drawCaret
in interface Widget<GuiOutputManager>
drawCaret
in class Browse<GuiOutputManager>
public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class Browse<GuiOutputManager>
public void destroy()
destroy
in interface Widget<GuiOutputManager>
destroy
in class Browse<GuiOutputManager>
public void onFocusGained(FocusEvent event)
Browse
widget receives the focus.
When a help string is defined for the browse it will be displayed on the status line. This method also sets the selected attribute on.
onFocusGained
in interface FocusListener
onFocusGained
in class Browse<GuiOutputManager>
event
- Reference to the event.public void onFocusLost(FocusEvent event)
Browse
widget loses the focus.
This method clears the focused flag.
onFocusLost
in interface FocusListener
onFocusLost
in class Browse<GuiOutputManager>
event
- Reference to the event.public void processDirectManipulationEvent(DirectManipulationEvent event)
processDirectManipulationEvent
in interface Widget<GuiOutputManager>
processDirectManipulationEvent
in class AbstractWidget<GuiOutputManager>
event
- Event to process.public void setEnabled(boolean enabled)
setEnabled
in interface Widget<GuiOutputManager>
setEnabled
in class Browse<GuiOutputManager>
enabled
- Widget.setEnabled(boolean)
void stretchColumns()
protected void activateDirectManipulation()
activateDirectManipulation
in class AbstractWidget<GuiOutputManager>
protected void deactivateDirectManipulation()
deactivateDirectManipulation
in class AbstractWidget<GuiOutputManager>
protected boolean isDirectManipulationRequired()
isDirectManipulationRequired
in class AbstractWidget<GuiOutputManager>
TRUE
if direct manipulation is need to be installed,
FALSE
if direct manipulation is need to be removed.public int getRowByCoordinates(int y)
y
- Vertical position (in native units in browse coordinates) that is supposed to be
within one of the viewport rows.-1
if position is higher than the first row or can be more
than the index of the last row if position is lower than the last row.public int fixupNoLabelsY(int y)
y
- Vertical position (in native units in browse coordinates) that is supposed to be
within one of the viewport rows.public BrowseColumnGuiImpl.ResizeArea getRowResizeArea(NativePoint browseColumnPoint)
browseColumnPoint
- Coordinates of the mouse pointer relatively the column being hovered.BrowseColumnGuiImpl.ResizeArea.UPPER
if the pointer is positioned over the
upper row resize area of a cell. BrowseColumnGuiImpl.ResizeArea.LOWER
if the
pointer is positioned over the lower row resize area of a cell. null
otherwise.public ScrollPaneGuiImpl getScrollPane()
public int getTopYforRow(int rowNdx)
rowNdx
- 0-base row index to compute the Y coordinate.public ImageWrapper getSortArrowImage(boolean ascending)
ascending
- true
to return soring arrow for ascending sorting (arrow up).
false
to return soring arrow for descending sorting (arrow down).public ImageWrapper getSortNumImage(int num)
num
- Sort number, from 1
to 9
.public boolean supportsCustomMousePointer()
supportsCustomMousePointer
in interface Widget<GuiOutputManager>
supportsCustomMousePointer
in class AbstractWidget<GuiOutputManager>
true
if the widget supports
LOAD-MOUSE-POINTER() methodvoid updateEnhancedFont(EnhancedBrowseParameter param, FontDetails font)
param
- Type of the font to set. Can be EnhancedBrowseParameter.CELLS_FONT
or
EnhancedBrowseParameter.LABEL_FONT
.font
- Font to set.protected int getLeftColumnContourLimit()
protected int getRightColumnContourLimit()
protected int[] mouseActions()
MouseEvent
codes and P2J specific
MouseEvt
actions.mouseActions
in class AbstractWidget<GuiOutputManager>
protected void handleTabKey()
handleTabKey
in class Browse<GuiOutputManager>
protected void scrollToEditableRow()
scrollToEditableRow
in class Browse<GuiOutputManager>
public GuiColorResolver getBrowseColorResolver()
public ColorRgb getSeparatorColor()
public int getTopRowOffset(int viewportIndex)
viewportIndex
- 0-based index of the row in the viewport.public boolean isDrawnAsFocused()
true
is if the browse should be drawn as a focused widget.boolean isLabelsVisible()
true
if the labels area is visible.boolean isPerformLayout()
true
if browse layout needs to be performed.public NativeDimension getViewportDimension()
public NativeRectangle getViewportBoundedRectangle()
public ColorRgb resolveColor(int columnValue, ColorRgb columnEhValue, int browseValue, ColorRgb browseEhValue, boolean fg, boolean label)
columnValue
- Column-specific color number.columnEhValue
- Column-specific enhanced color.browseValue
- Browse-specific color number.browseEhValue
- Browse-specific enhanced color.fg
- true
if it is a foreground color. false
if it is a
background color.label
- true
if it is a label color. false
if it is a cell color.void startColumnDrag(BrowseColumnGuiImpl column, int leftDragColumnMouseOffset)
column
- Column which is being dragged.leftDragColumnMouseOffset
- Offset from the left edge of the column which is being dragged to the position of the
pointer inside the column.void stopColumnDrag(java.awt.event.MouseEvent e)
void startColumnResize(int visibleColumnIndex)
visibleColumnIndex
- Index of the column which is being resized (among the visible columns).void stopColumnResize()
boolean isColumnDrag()
true
if a column is being dragged.true
if a column is being dragged.boolean isColumnResize()
true
if a column is being resized.true
if a column is being resized.boolean isLastLockedColumnResizeArea(java.awt.event.MouseEvent e)
true
if the mouse pointer is positioned over the resize area after the
right edge of the last locked column.e
- Mouse event.true
if the mouse pointer is positioned over the resize area after the
right edge of the last locked column.int getLockedColumnsWidth()
boolean beforeColumnHeaderPressed()
true
if the header can be pressed, false
otherwise.void changeColumnVisibility(int columnOrdinal, boolean visible)
columnOrdinal
- 0-based column ordinal (among all columns).visible
- true
if the column should be visible. false
if the column
should be hidden.FontDetails getBrowseFont()
FontDetails getBrowseLabelFont()
protected void columnToView(int visibleColumnIndex)
columnToView
in class Browse<GuiOutputManager>
visibleColumnIndex
- 0-based index of the column among the visible columns.protected void scrollToColumn(int visibleColumnIndex)
visibleColumnIndex
- 0-based index of the column among the visible columns.protected boolean startEdit(WidgetId prevFocus, boolean updateSelection, boolean useValue, BaseDataType value)
startEdit
in class Browse<GuiOutputManager>
prevFocus
- The previous focused widget, which will lose focus.updateSelection
- For multi-selection browse: if true
, current row becomes the only
selected row.useValue
- Use the specified value for the editor instead of getting it from the browse cache.value
- Value to use in the editor. Can be null
(valid value). Set
useValue
to true
if you want to use this parameter.true
if editing was on and ENTRY triggered allowed it to stop.protected Widget createEditor(boolean useValue, BaseDataType value)
createEditor
in class Browse<GuiOutputManager>
useValue
- Use the specified value for the editor instead of getting it from the browse cache.value
- Value to use in the editor. Can be null
(valid value). Set
useValue
to true
if you want to use this parameter.protected ToggleBox createEditingToggleBox(boolean useValue, BaseDataType value)
useValue
- Use the specified value for the editor instead of getting it from the browse cache.value
- Value to use in the editor. Can be null
(valid value). Set
useValue
to true
if you want to use this parameter.protected void initEditorConfig(BaseConfig cfg)
initEditorConfig
in class Browse<GuiOutputManager>
cfg
- Editor widget config.protected void addEditor(Widget editor)
addEditor
in class Browse<GuiOutputManager>
editor
- Editor widget.protected void cleanupEditor(Widget editor)
cleanupEditor
in class Browse<GuiOutputManager>
editor
- Editor widget.protected boolean isAggressiveCurrentRowSelection()
true
if the current row of the single-selection browse is selected on
FOCUS-GAINED and some other events.isAggressiveCurrentRowSelection
in class Browse<GuiOutputManager>
protected int getPageSize()
getPageSize
in class Browse<GuiOutputManager>
protected void updateLabelsHeight()
updateLabelsHeight
in class Browse<GuiOutputManager>
protected void notifyBrowseScrolled()
notifyBrowseScrolled
in class Browse<GuiOutputManager>
protected java.util.Map<FontDetails,java.util.Set<java.lang.String>> prepareHyperlinks()
layoutHyperlinks()
. Layout should be performed after we
got text metrics for the hyperlinks.protected java.util.Map<FontDetails,java.util.Set<java.lang.String>> collectColumnTexts(BrowseColumnGuiImpl column, java.util.Map<FontDetails,java.util.Set<java.lang.String>> texts)
column
- Column containing texts to be collected.texts
- Map into which collected texts are added, keyed by fonts which are used for drawing
specific texts. If null
, a new map is created for the collected texts
(if there are any texts to collect).protected void layoutHyperlinks()
prepareHyperlinks()
. Layout should be performed after we
got text metrics for the hyperlinks.protected int getCurrentEditorY()
protected int getCurrentEditorX()
protected boolean isRefreshedOnEnable()
isRefreshedOnEnable
in class Browse<GuiOutputManager>
false
protected Menu showPopupMenu(java.awt.event.MouseEvent e, java.lang.Runnable dismissHandler)
AbstractWidget.resolvePopupMenuId()
.showPopupMenu
in class AbstractWidget<GuiOutputManager>
e
- The related mouse event that caused a popup to be shown.dismissHandler
- When not null, the runnable instance is executed when the popup menu is dismissed, regardless
whether an item is chosen or not.null
if no popup is resolved for this widget.protected Menu showPopupMenu(BrowseColumnGuiImpl column, java.awt.event.MouseEvent e, java.lang.Runnable dismissHandler)
column
- Column which was right-clicked or null
if the browse was clicked outside
of the columns area.e
- Mouse event.dismissHandler
- When not null, the runnable instance is executed when the popup menu is dismissed,
regardless whether an item is chosen or not.protected boolean updateColumn(int columnOrdinal, BaseDataType var)
updateColumn
in class Browse<GuiOutputManager>
columnOrdinal
- 0-based index of the cell to update.var
- New value of the cell.true
if column value was changed.private void cacheTextMetrics(FontDetails font, java.lang.String text, java.lang.Integer windowId)
font
- The font used to draw the given text.text
- Text which metrics should be cached.windowId
- ID of the parent window. Can be null
if there is no need to select a
window.private void updateRowHeight()
private void updateLabelsVisible()
Browse.drawLabels
attribute which defines if the labels area is
visible.private int calcTitleHeight()
private void createTitlePanel()
private void buildPanels()
private void createLockedColumnsSet()
private void rebuildColumns()
public int getTotalColumnsWidth()
public Widget getScrollableColumnSet()
public Widget<GuiOutputManager> currentFocus()
getDefaultFocus()
because focus placement
inside BROWSE can't be switched from initial component until subcomponent
creation or deletion.currentFocus
in interface Container<GuiOutputManager>
currentFocus
in class Browse<GuiOutputManager>
Container.currentFocus()
public boolean hasFocus()
true
.hasFocus
in interface Widget<GuiOutputManager>
hasFocus
in class AbstractWidget<GuiOutputManager>
true
if widget has focus.private void adjustLockedColumnsPanel()
lockedColumnSet
panel according to
lockedColumnsWidth
.private boolean fitLastColumn()
true
if width of the last column was updated in order to fit it in the
view.private boolean needsColumnFit()
true
if last column should be fit according to FIT-LAST-COLUMN or
NO-EMPTY-SPACE option.private void updateBrowseDimensions()
private int calcImplicitBrowseHeightNoScrollbar()
public BrowseColumnGuiImpl getCurrentMarkersColumn()
null
.null
if not yet created.private void createMarkersColumn()
private int calcDown()
public int calcDown(int rowHeightPixels)
calcDown
in class Browse<GuiOutputManager>
rowHeightPixels
- Row height in pixels.private Point getScrollPaneLocation()
private Point getLockedPaneLocation()
private NativeDimension getScrollPaneDimension()
private int calcRowHeight()
private int calcImplicitRowHeight()
public boolean hasTitle()
true
if this browse has title.private void resolveColors()
public void resolveFonts()
private BrowseColumnGuiImpl getVisibleColumn(int visibleColumnIndex)
visibleColumnIndex
- 0-based index of the column among the visible columns.public BrowseColumnGuiImpl getColumn(int columnOrdinal)
columnOrdinal
- 0-based index of the column among all columns (i.e. column ordinal).private BrowseColumnGuiImpl getColumn(BrowseColumnConfig[] columns, int index)
columns
- Array of column configurations.index
- 0-based index of the column in the given array.private int getScrollbarThickness(ScrollBar.Orientation orientation)
orientation
- Target scroll bar.public java.lang.String getCellTextWithIntermediate(BrowseColumnGuiImpl column, int viewportIndex)
Browse.intermediateDcData
), if it is available, or normal cache (Browse.dcData
)column
- The column the target cell belongs to.viewportIndex
- 0-based index of the target row in the viewport the target cell belongs to.public BaseDataType getCellValueWithIntermediate(BrowseColumnGuiImpl column, int viewportIndex)
Browse.intermediateDcData
), if it is available, or normal cache (Browse.dcData
)column
- The column the target cell belongs to.viewportIndex
- 0-based index of the target row in the viewport the target cell belongs to.public boolean drawRowAsSelected(int viewportRowIndex)
true
if the specified row is drawn as selected.viewportRowIndex
- 0-based index of the target row in the viewport.true
if the specified row is drawn as selected.public BaseDataType getCellValue(int viewportIndex, int columnOrdinal)
viewportIndex
- 0-based index of the target row in the viewport the target cell belongs to.columnOrdinal
- 0-based index of the column the target cell belongs to.public boolean isCurrentEditingColumn(BrowseColumnGuiImpl column)
true
if the given column is the current column and editing is in
progress.column
- Column to check.public java.lang.String getCellText(int viewportIndex, int columnOrdinal)
viewportIndex
- 0-based index of the target row in the viewport the target cell belongs to.columnOrdinal
- 0-based index of the column the target cell belongs to.boolean isCtrlModifier(java.awt.event.MouseEvent e)
true
if CTRL key was held down when a mouse button was pressed.e
- Mouse event.true
if CTRL key was held down when a mouse button was pressed.void setMouseActionColumn(BrowseColumnGuiImpl col)
BrowseColumnGuiImpl
is reponsible for resetting meColumn
back to
null
.col
- The new column to be registered or null
for unregister process.void rowClicked(int viewportRowIndex, int visibleColumnIndex, java.awt.event.MouseEvent e)
viewportRowIndex
- 0-based viewport index of the clicked row.visibleColumnIndex
- 0-based index of the clicked column among the visible columns. If -1 then the
whole row is selected as in read-only mode.e
- Original mouse event.void resetPressedColumns(boolean trigger)
trigger
- If true
and a column was in pressed state, raise END-SEARCH event.private boolean isShiftModifier(java.awt.event.MouseEvent e)
true
if SHIFT key was held down when a mouse button was pressed.e
- Mouse event.true
if SHIFT key was held down when a mouse button was pressed.private void setColumnScrolling(boolean columnScrolling)
columnScrolling
- true
for COLUMN-SCROLLING mode, false
for
non-COLUMN-SCROLLING mode,private void showHorizontalScrollbar(boolean show)
show
- true
to show, false
to hide.private void updateVerticalScrollbarVisibility()
private ScrollPaneGuiImpl.ShowBars getShowBars(boolean horizontal, boolean vertical)
ScrollPaneGuiImpl.ShowBars
option which corresponds given visibility of the
scroll bars.horizontal
- true
if horizontal scroll bar is visible.vertical
- true
if vertical scroll bar is visible.ScrollPaneGuiImpl.ShowBars
option which corresponds given visibility of
the scroll bars.private void setCurrentSingleRowSelected()
private void searchByKey(char searchChar)
BrowseWidget.getRows(char, int, int, int, int, ScreenBuffer[])
for more
information.searchChar
- Character to be searched for.private int getSearchColumn()
false
, then it is the first column. If
ALLOW-COLUMN-SEARCHING is true
then it is the pressed column.-1
if there is no column to
search.public Window window()
window
in interface Widget<GuiOutputManager>
window
in class AbstractWidget<GuiOutputManager>
null
if the widget is not yet attached to a Window.public BaseDataType getColumnValue(int visibleIndex)
getColumnValue
in class Browse<GuiOutputManager>
visibleIndex
- 0-based index of the column among visible columns.public void onKeyPressed(KeyInput event)
onKeyPressed
in interface KeyListener
onKeyPressed
in class Browse<GuiOutputManager>
event
- Reference to keyboard event.public void processEvent(Event evt)
processEvent
in interface Widget<GuiOutputManager>
processEvent
in class Browse<GuiOutputManager>
evt
- Event to process.Widget.processEvent(Event)
public void queryRepositioned(boolean repositionError, int targetRepositionRow)
queryRepositioned
in class Browse<GuiOutputManager>
repositionError
- For reposition mode - if an error has happened during reposition.targetRepositionRow
- For reposition mode - row used as the target for reposition. If it was deleted,
reposition with fetching may end up on a different row.public void refresh(boolean deleteCurrentRowMode)
refresh
in class Browse<GuiOutputManager>
deleteCurrentRowMode
- true
if this function is used for update on DELETE-CURRENT-ROW.
false
if this function is used for update on REFRESH.public void setMousePointerName(java.lang.String name)
setMousePointerName
in interface Hoverable
name
- the attribute valuepublic java.lang.String getMousePointerImpl()
getMousePointerImpl
in interface Hoverable
public void moveColumn(int srcIndex, int destIndex)
Repositions a column in a browse widget.
moveColumn
in class Browse<GuiOutputManager>
srcIndex
- 0-based position of the column to be moved (column ordinal).destIndex
- 0-based position to which the column is moved (column ordinal).public void applyEnhancedConfigClient(EnhancedBrowseConfig config)
applyEnhancedConfigClient
in class Browse<GuiOutputManager>
config
- Enhanced browse config.public boolean isDroppable()
isDroppable
in interface Widget<GuiOutputManager>
TRUE
if this widget can be droppable at this time,
FALSE
otherwise.public int getHorizontalScrollingPosition()
public void startLayoutMode()
public void stopLayoutMode(boolean undo, EnhancedBrowseSaveTarget set)
public boolean applyDefault4glConfig()
true
on success.public EnhancedBrowseSaveTarget[] getEnhancedBrowseSaveTargets()
public boolean isLayoutMode()
true
if browse layout mode is active.true
if browse layout mode is active.public boolean isColumnMovable()
true
if columns are movable.true
if columns are movable.public boolean isRowResizable()
true
if rows are resizable.true
if rows are resizable.public boolean isColumnResizable()
true
if columns are resizable.true
if columns are resizable.public double getOptimalWidth()
getOptimalWidth
in interface HasOptimalSize
private void moveColumnInArray(java.lang.Object[] array, int srcIndex, int destIndex)
array
- Target array.srcIndex
- 0-based position of the element to be moved.destIndex
- 0-based position to which the element is moved.private int getColumnOffset(int visibleColumnIndex)
visibleColumnIndex
- 0-based index of the column among the visible columns.private void updateColumnSetsHeight()
private void updateEditorAfterColumnModification()
private void updateHorizontalColumnScrollMax()
horizontalColumnScrollMax
.private int getEffectiveMinColumnWidth()
private boolean hasHyperlinkedColumns()
true
if there is at least one visible column with hyperlinks.