public class BrowseColumnGuiImpl extends BrowseColumn implements Hoverable
Modifier and Type | Class and Description |
---|---|
private static class |
BrowseColumnGuiImpl.ResizeArea
Enumeration for different resize areas.
|
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private int |
baseFontNum
Base font number.
|
private BrowseGuiImpl |
browse
Parent browse.
|
private CoordinatesConversion |
cc
Coordinates conversion.
|
private FontDetails |
columnFontDetails
Column font.
|
private int |
columnFontNum
Column font number.
|
private int |
columnIndex
0-based column index.
|
private BrowseColumnGuiImpl.ResizeArea |
currentResizeArea
Indicates the resize area over which the mouse pointer is hovering now.
|
static int |
GAP_BETWEEN_SORT_ARROW_AND_NUMBER
Gap between sort arrow and sort number.
|
private GuiDriver |
gd
GUI driver.
|
private boolean |
isDragged
true if the column is being dragged. |
private boolean |
isPressed
If column is pressed (column label is pressed if ALLOW-COLUMN-SEARCHING is
true ). |
private boolean |
isResized
true if the column is being resized. |
private static int |
LABEL_OFFSET_LEFT
Left offset for text area in a label.
|
private static int |
LABEL_OFFSET_RIGHT
Right offset for text area in a label.
|
static int |
LABEL_PRESSED_OFFSET
Offset of the label text if the column is in pressed state.
|
static int |
LABEL_SHADOW_THICKNESS
Thickness of the shadow inside the column header.
|
private FontDetails |
labelFontDetails
Label font.
|
private int |
labelFontNum
Label font number.
|
private java.lang.String[] |
labelLines
The lines of which the label consist.
|
private boolean |
markersColumn
If it is the markers (leftmost) column.
|
static int |
SORT_AREA_LEFT_CLIP
Left clipping for sort area (sort arrow and number).
|
static int |
SORT_AREA_RIGHT_CLIP
Right clipping for sort area (sort arrow and number).
|
static int |
SORT_ARROW_MAX_LEFT_OFFSET
Maximum offset between sort arrow and label text.
|
private FontDetails |
sortNumberFontDetails
Font for sort number.
|
private boolean |
startedPress
true if user pressed down mouse button on a column label if
ALLOW-COLUMN-SEARCHING is true . |
private double |
width
Column width.
|
config
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
BrowseColumnGuiImpl(boolean markersColumn)
Constructor.
|
BrowseColumnGuiImpl(WidgetId id,
BrowseColumnConfig cfg)
Constructor.
|
BrowseColumnGuiImpl(WidgetId id,
BrowseColumnConfig cfg,
boolean markersColumn)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConfigUpdate(BrowseColumnConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
int |
calcColumnWidth()
Calculate column width.
|
private int |
calcDataWidth()
Calculate width of the data part of the column.
|
Dimension |
dimension()
Get widget dimension.
|
void |
draw()
Draw the widget.
|
BrowseGuiImpl |
getBrowse()
Obtain the
BrowseGuiImpl this column is part of. |
NativePoint |
getCellTextClipPoint(int viewportIndex)
Get clipping point for a text inside a cell relatively to the column top.
|
NativeRectangle |
getCellTextClipRectangle(NativePoint point)
Get clipping rectangle for a text inside a cell.
|
int |
getCellTextTopOffset()
Get top offset for positioning text inside a cell.
|
FontDetails |
getColumnFontDetails()
Obtain the current
FontDetails for this column. |
int |
getColumnFontNum()
Obtain the current font for this column.
|
int |
getColumnIndex()
Index of the browse column in the set of columns.
|
int |
getColumnLabelTextWidth()
Get width of the label text, in pixels.
|
int |
getColumnPadding()
Get column padding, i.e.
|
int |
getLabelAreaWidth()
Get width of the column header, starting from the left column header border (inclusive) and
ending with the right column header border (exclusive).
|
FontDetails |
getLabelFontDetails()
Obtain the current
FontDetails of this label. |
int |
getLabelFontNum()
Obtain the current font of this label.
|
java.lang.String[] |
getLabelLines()
Get the array of labels for this column.
|
NativePoint |
getLabelTextClipPoint()
Get clipping point for a text inside a label.
|
NativeRectangle |
getLabelTextClipRectangle(NativePoint clipPoint)
Get clipping rectangle for a text inside a label.
|
int |
getLabelTextTopOffset()
Get top offset for positioning text inside a label.
|
java.lang.String |
getMousePointerImpl()
Get the MOUSE-POINTER attribute
|
int |
getSortAreaWidth()
Get width of the sort area (sort arrow and number), in pixels.
|
private boolean |
hasLeftResizeArea()
Determines if this column has left resize area (see
BrowseColumnGuiImpl.ResizeArea for more
information). |
private boolean |
hasRightResizeArea()
Determines if this column has right resize area (see
BrowseColumnGuiImpl.ResizeArea for more
information). |
void |
init(BrowseGuiImpl browse,
int leftOffset,
int columnIndex)
Initialize the widget.
|
(package private) void |
initEditorConfig(BaseConfig cfg)
Initialize editor widget config.
|
void |
initMarkersColumn(BrowseGuiImpl browse)
Initialize the markers (leftmost) column.
|
boolean |
isDrawnAsPressed()
Returns
true if the column is visually in pressed state. |
boolean |
isFirstColumn()
Returns
true if it is the first column (not including markers column). |
private boolean |
isHeaderArea(NativePoint point)
Returns
true if the given point is inside the column header. |
(package private) boolean |
isInToggleBoxArea(java.awt.event.MouseEvent e)
Determines if the mouse event happened over the toggle box image area in the current row in
this column.
|
boolean |
isLastColumn()
Returns
true if it is the last column (not including markers column). |
boolean |
isLastLockedColumn()
Returns
true if it is the last column if the set of locked columns (not
including markers column). |
boolean |
isMarkersColumn()
Test whether this is a marker column.
|
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 |
mouseMoved(java.awt.event.MouseEvent e)
Notification of a mouse moved event occurred for this widget.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event occurred for this widget.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Notification of a mouse released event occurred for this widget.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel moved event occurred for this widget.
|
void |
processDirectManipulationEvent(DirectManipulationEvent event)
Process direct manipulation event.
|
ColorRgb |
resolveColor(int columnValue,
int browseValue,
boolean fg,
boolean label)
Resolve color basing on input parameters.
|
private void |
resolveFonts()
Resolve browse column fonts.
|
void |
setMousePointerName(java.lang.String name)
Set the MOUSE-POINTER attribute
|
(package private) void |
setWidth(double width)
Set column width and update WIDTH attribute accordingly.
|
boolean |
supportsCustomMousePointer()
Check if the widget supports LOAD-MOUSE-POINTER() method
|
(package private) void |
updateLabel()
Update the label (it should be parsed to the consisting lines).
|
Window |
window()
Get ancestor Window for this widget.
|
config, getText, getValue, height, hidden, initialize, isFocusable, isModified, isRightPositioning, isVisible, minimumSize, setBrowse, setValue, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hide, highlighted, ignoreAction, insets, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, location, manageSystemActions, mouseEntered, mouseExited, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, sync, topLevelWindow, toString, translate, unrealize, updateSizeWorker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, isDirectManipulable
public static final int LABEL_PRESSED_OFFSET
public static final int LABEL_SHADOW_THICKNESS
public static final int SORT_ARROW_MAX_LEFT_OFFSET
public static final int SORT_AREA_LEFT_CLIP
public static final int SORT_AREA_RIGHT_CLIP
public static final int GAP_BETWEEN_SORT_ARROW_AND_NUMBER
private static final int LABEL_OFFSET_LEFT
private static final int LABEL_OFFSET_RIGHT
private GuiDriver gd
private BrowseGuiImpl browse
private FontDetails labelFontDetails
private FontDetails sortNumberFontDetails
private int labelFontNum
private FontDetails columnFontDetails
private int columnFontNum
private int baseFontNum
private CoordinatesConversion cc
private double width
private int columnIndex
private final boolean markersColumn
private java.lang.String[] labelLines
private boolean isDragged
true
if the column is being dragged.private boolean isResized
true
if the column is being resized.private boolean startedPress
true
if user pressed down mouse button on a column label if
ALLOW-COLUMN-SEARCHING is true
.private boolean isPressed
true
).private BrowseColumnGuiImpl.ResizeArea currentResizeArea
BrowseColumnGuiImpl.ResizeArea
for more information. null
if the
mouse pointer is not hovering over a resize area.public BrowseColumnGuiImpl(boolean markersColumn)
markersColumn
- true
if it is a markers (leftmost) column.public BrowseColumnGuiImpl(WidgetId id, BrowseColumnConfig cfg)
Call BrowseColumn.initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.BrowseColumnConfig)
to finish the widget initialization.
id
- The widget's ID.cfg
- Configuration data.public BrowseColumnGuiImpl(WidgetId id, BrowseColumnConfig cfg, boolean markersColumn)
Call BrowseColumn.initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.BrowseColumnConfig)
to finish the widget initialization.
id
- The widget's ID.cfg
- Configuration data.markersColumn
- true
if it is a markers (leftmost) column.void setWidth(double width)
width
- Column width in characters.public void initMarkersColumn(BrowseGuiImpl browse)
browse
- Parent browse.public boolean isMarkersColumn()
true
if this a marker column.public void init(BrowseGuiImpl browse, int leftOffset, int columnIndex)
browse
- Parent browse.leftOffset
- Column offset in pixels (i.e. width of preceding columns).columnIndex
- 0-based column index.public BrowseGuiImpl getBrowse()
BrowseGuiImpl
this column is part of.BrowseGuiImpl
widget.public int calcColumnWidth()
public int getColumnPadding()
public void afterConfigUpdate(BrowseColumnConfig beforeUpdate)
afterConfigUpdate
in class BrowseColumn
beforeUpdate
- Config reference capturing the config state before
the owner's config was modified.public Dimension dimension()
dimension
in interface Widget
dimension
in class BrowseColumn
public void draw()
draw
in interface Widget
draw
in class BrowseColumn
public FontDetails getLabelFontDetails()
FontDetails
of this label.FontDetails
of the label.public FontDetails getColumnFontDetails()
FontDetails
for this column.FontDetails
.public int getLabelFontNum()
public int getColumnFontNum()
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
e
- The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractWidget
e
- The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractWidget
e
- The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class AbstractWidget
e
- The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractWidget
e
- The mouse event.public void processDirectManipulationEvent(DirectManipulationEvent event)
processDirectManipulationEvent
in interface Widget
processDirectManipulationEvent
in class AbstractWidget
event
- Event to process.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class AbstractWidget
e
- The mouse event.public Window window()
window
in interface Widget
window
in class AbstractWidget
null
if the widget is not yet attached to a Window.void updateLabel()
public java.lang.String[] getLabelLines()
updateLabel()
first
to have then initialized.void initEditorConfig(BaseConfig cfg)
cfg
- Editor widget config.public boolean supportsCustomMousePointer()
supportsCustomMousePointer
in interface Widget
supportsCustomMousePointer
in class AbstractWidget
true
if the widget supports
LOAD-MOUSE-POINTER() methodpublic void setMousePointerName(java.lang.String name)
setMousePointerName
in interface Hoverable
name
- the attribute valuepublic java.lang.String getMousePointerImpl()
getMousePointerImpl
in interface Hoverable
public int getColumnIndex()
protected int[] mouseActions()
MouseEvent
codes and P2J specific
MouseEvt
actions.mouseActions
in class AbstractWidget
private boolean isHeaderArea(NativePoint point)
true
if the given point is inside the column header.point
- Point to check.public int getColumnLabelTextWidth()
public int getSortAreaWidth()
public boolean isDrawnAsPressed()
true
if the column is visually in pressed state.public NativePoint getLabelTextClipPoint()
public NativeRectangle getLabelTextClipRectangle(NativePoint clipPoint)
clipPoint
- Clipping point.public int getLabelAreaWidth()
public int getLabelTextTopOffset()
public int getCellTextTopOffset()
public NativePoint getCellTextClipPoint(int viewportIndex)
viewportIndex
- 0-based viewport index of the row the cell belongs to.public NativeRectangle getCellTextClipRectangle(NativePoint point)
point
- Clipping point.private int calcDataWidth()
private void resolveFonts()
public ColorRgb resolveColor(int columnValue, int browseValue, boolean fg, boolean label)
columnValue
- Column-specific font number.browseValue
- Browse-specific font number.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.public boolean isFirstColumn()
true
if it is the first column (not including markers column).public boolean isLastColumn()
true
if it is the last column (not including markers column).private boolean hasLeftResizeArea()
BrowseColumnGuiImpl.ResizeArea
for more
information).true
if this column has left resize area.private boolean hasRightResizeArea()
BrowseColumnGuiImpl.ResizeArea
for more
information).true
if this column has right resize area.public boolean isLastLockedColumn()
true
if it is the last column if the set of locked columns (not
including markers column).boolean isInToggleBoxArea(java.awt.event.MouseEvent e)
e
- Mouse event.true
if the mouse event happened over the toggle box image area in the
current row in this column.