lsm tree java_BasicTreeUI
方法詳細(xì)信息
createUI public static?ComponentUI?createUI?(JComponent?x)
構(gòu)造一個
BasicTreeUI的新實(shí)例。
參數(shù)
x - 一個組件
結(jié)果
BasicTreeUI的新實(shí)例
getHashColor protected?Color?getHashColor()
返回散列顏色。
結(jié)果
哈希顏色
setHashColor protected?void?setHashColor?(Color?color)
設(shè)置哈希顏色。
參數(shù)
color - 哈希顏色
setLeftChildIndent public?void?setLeftChildIndent?(int?newAmount)
設(shè)置左子縮進(jìn)。
參數(shù)
newAmount - 左側(cè)兒童縮進(jìn)
getLeftChildIndent public?int?getLeftChildIndent()
返回左子縮進(jìn)。
結(jié)果
左邊的孩子縮進(jìn)
setRightChildIndent public?void?setRightChildIndent?(int?newAmount)
設(shè)置正確的子縮進(jìn)。
參數(shù)
newAmount - 正確的兒童縮進(jìn)
getRightChildIndent public?int?getRightChildIndent()
返回正確的子縮進(jìn)。
結(jié)果
合適的孩子縮進(jìn)
setExpandedIcon public?void?setExpandedIcon?(Icon?newG)
設(shè)置展開的圖標(biāo)。
參數(shù)
newG - 展開的圖標(biāo)
getExpandedIcon public?Icon?getExpandedIcon()
返回展開的圖標(biāo)。
結(jié)果
展開的圖標(biāo)
setCollapsedIcon public?void?setCollapsedIcon?(Icon?newG)
設(shè)置折疊圖標(biāo)。
參數(shù)
newG - 折疊圖標(biāo)
getCollapsedIcon public?Icon?getCollapsedIcon()
返回折疊的圖標(biāo)。
結(jié)果
折疊的圖標(biāo)
setLargeModel protected?void?setLargeModel?(boolean?largeModel)
如有必要,更新componentListener。
參數(shù)
largeModel - 新值
isLargeModel protected?boolean?isLargeModel()
如果設(shè)置了大型模型,則返回
true 。
結(jié)果
true如果設(shè)置了大型模型
setRowHeight protected?void?setRowHeight?(int?rowHeight)
設(shè)置行高,將其轉(zhuǎn)發(fā)到treeState。
參數(shù)
rowHeight - 行高
getRowHeight protected?int?getRowHeight()
返回行高。
結(jié)果
行高
setCellRenderer protected?void?setCellRenderer?(TreeCellRenderer?tcr)
將TreeCellRenderer設(shè)置為tcr 。
這會調(diào)用updateRenderer 。
參數(shù)
tcr - 新值
getCellRenderer protected?TreeCellRenderer?getCellRenderer()
返回
currentCellRenderer ,它將是樹渲染器,或
defaultCellRenderer ,它們不是null。
結(jié)果
TreeCellRenderer一個實(shí)例
setModel protected?void?setModel?(TreeModel?model)
設(shè)置
TreeModel 。
參數(shù)
model - 新值
getModel protected?TreeModel?getModel()
返回樹模型。
結(jié)果
樹模型
setRootVisible protected?void?setRootVisible?(boolean?newValue)
將根設(shè)置為可見。
參數(shù)
newValue - 新值
isRootVisible protected?boolean?isRootVisible()
如果樹根可見,則返回
true 。
結(jié)果
true如果樹根可見
setShowsRootHandles protected?void?setShowsRootHandles?(boolean?newValue)
確定是否顯示節(jié)點(diǎn)句柄。
參數(shù)
newValue - 新值
getShowsRootHandles protected?boolean?getShowsRootHandles()
如果要顯示根句柄,則返回
true 。
結(jié)果
true如果要顯示根句柄
setCellEditor protected?void?setCellEditor?(TreeCellEditor?editor)
設(shè)置單元格編輯器。
參數(shù)
editor - 新的單元格編輯器
getCellEditor protected?TreeCellEditor?getCellEditor()
返回
TreeCellEditor的實(shí)例。
結(jié)果
TreeCellEditor一個實(shí)例
setEditable protected?void?setEditable?(boolean?newValue)
配置接收器允許或不允許編輯。
參數(shù)
newValue - 新值
isEditable protected?boolean?isEditable()
如果樹可編輯,則返回
true 。
結(jié)果
true樹是否可編輯
setSelectionModel protected?void?setSelectionModel?(TreeSelectionModel?newLSM)
重置選擇模型。
適當(dāng)?shù)膫陕犉靼惭b在模型上。
參數(shù)
newLSM - 新的選擇模型
getSelectionModel protected?TreeSelectionModel?getSelectionModel()
返回樹選擇模型。
結(jié)果
樹選擇模型
getPathBounds public?Rectangle?getPathBounds?(JTree?tree,
TreePath?path)
返回包含將繪制路徑中最后一項(xiàng)的標(biāo)簽部分的Rectangle。
如果路徑中的任何組件當(dāng)前有效,則返回null。
Specified by:
參數(shù)
tree -
JTree的
path
path - 標(biāo)識節(jié)點(diǎn)的
TreePath
結(jié)果
Rectangle包含將繪制路徑中最后一項(xiàng)的標(biāo)簽部分,如果路徑中的任何組件當(dāng)前有效,
null 。
getPathForRow public?TreePath?getPathForRow?(JTree?tree,
int?row)
返回傳入行的路徑。
如果row不可見,則返回null。
Specified by:
參數(shù)
tree -
JTree對象
row - 指定行的整數(shù)
結(jié)果
path為
row或
null如果
row不可見
getRowForPath public?int?getRowForPath?(JTree?tree,
TreePath?path)
返回路徑中標(biāo)識的最后一項(xiàng)可見的行。
如果路徑中的任何元素當(dāng)前不可見,則返回-1。
Specified by:
參數(shù)
tree -
JTree for
path
path - 要查看的
TreePath對象
結(jié)果
指定標(biāo)識最后一項(xiàng)的行的整數(shù),如果
path中的任何元素當(dāng)前不可見,則返回-1
getRowCount public?int?getRowCount?(JTree?tree)
返回正在顯示的行數(shù)。
Specified by:
參數(shù)
tree - 要為其計(jì)數(shù)行的
JTree
結(jié)果
一個整數(shù),指定要顯示的行數(shù)
getClosestPathForLocation public?TreePath?getClosestPathForLocation?(JTree?tree,
int?x,
int?y)
返回最接近x,y的節(jié)點(diǎn)的路徑。
如果當(dāng)前沒有任何內(nèi)容可見,則返回null,否則它將始終返回有效路徑。
如果你需要測試返回的對象是否正好在x,y,你應(yīng)該獲得返回路徑的邊界并測試x,y。
Specified by:
參數(shù)
tree -
JTree對象
x - 一個整數(shù),給出顯示區(qū)域左邊緣水平的像素?cái)?shù)
y - 一個整數(shù),給出顯示區(qū)域頂部垂直的像素?cái)?shù),減去任何上邊距
結(jié)果
TreePath節(jié)點(diǎn)最接近
x,y或
null如果當(dāng)前沒有任何可見
isEditing public?boolean?isEditing?(JTree?tree)
如果正在編輯樹,則返回true。
getEditingPath()可以返回正在編輯的項(xiàng)目。
Specified by:
參數(shù)
tree -
JTree對象
結(jié)果
如果正在編輯
tree則為true
stopEditing public?boolean?stopEditing?(JTree?tree)
停止當(dāng)前的編輯會話。
如果未編輯樹,則無效。
如果編輯器允許編輯會話停止,則返回true。
Specified by:
參數(shù)
tree -
JTree對象
結(jié)果
如果編輯器允許編輯會話停止,則為true
cancelEditing public?void?cancelEditing?(JTree?tree)
取消當(dāng)前編輯會話。
Specified by:
參數(shù)
tree -
JTree對象
startEditingAtPath public?void?startEditingAtPath?(JTree?tree,
TreePath?path)
選擇路徑中的最后一項(xiàng)并嘗試編輯它。
如果CellEditor不允許編輯所選項(xiàng)目,編輯將失敗。
Specified by:
參數(shù)
tree - 正在編輯的
JTree
path - 要編輯的
TreePath
getEditingPath public?TreePath?getEditingPath?(JTree?tree)
返回正在編輯的元素的路徑。
Specified by:
參數(shù)
tree - 要返回路徑的
JTree
結(jié)果
一個
TreePath包含路徑
tree
prepareForUIInstall protected?void?prepareForUIInstall()
在設(shè)置
tree實(shí)例變量之后但在安裝任何默認(rèn)值/偵聽器之前調(diào)用。
completeUIInstall protected?void?completeUIInstall()
安裝完所有默認(rèn)值/偵聽器后從installUI調(diào)用。
installDefaults protected?void?installDefaults()
安裝默認(rèn)屬性。
installListeners protected?void?installListeners()
注冊聽眾。
installKeyboardActions protected?void?installKeyboardActions()
注冊鍵盤操作。
installComponents protected?void?installComponents()
Intall樹的子組件,即渲染器窗格。
createNodeDimensions
創(chuàng)建
NodeDimensions的實(shí)例,該實(shí)例能夠確定樹中給定節(jié)點(diǎn)的大小。
結(jié)果
NodeDimensions一個實(shí)例
createPropertyChangeListener protected?PropertyChangeListener?createPropertyChangeListener()
創(chuàng)建一個負(fù)責(zé)的監(jiān)聽器,根據(jù)樹的更改方式更新UI。
結(jié)果
PropertyChangeListener一個實(shí)例
createMouseListener protected?MouseListener?createMouseListener()
創(chuàng)建負(fù)責(zé)根據(jù)鼠標(biāo)事件更新選擇的偵聽器。
結(jié)果
MouseListener一個實(shí)例
createFocusListener protected?FocusListener?createFocusListener()
創(chuàng)建一個監(jiān)聽器,負(fù)責(zé)在丟失/獲得焦點(diǎn)時更新顯示。
結(jié)果
FocusListener一個實(shí)例
createKeyListener protected?KeyListener?createKeyListener()
創(chuàng)建負(fù)責(zé)從樹中獲取關(guān)鍵事件的偵聽器。
結(jié)果
KeyListener一個實(shí)例
createSelectionModelPropertyChangeListener protected?PropertyChangeListener?createSelectionModelPropertyChangeListener()
創(chuàng)建負(fù)責(zé)從選擇模型獲取屬性更改事件的偵聽器。
結(jié)果
PropertyChangeListener一個實(shí)例
createTreeSelectionListener protected?TreeSelectionListener?createTreeSelectionListener()
創(chuàng)建基于選擇更改方法更新顯示的偵聽器。
結(jié)果
TreeSelectionListener一個實(shí)例
createCellEditorListener protected?CellEditorListener?createCellEditorListener()
創(chuàng)建一個偵聽器來處理當(dāng)前編輯器中的事件。
結(jié)果
CellEditorListener一個實(shí)例
createComponentListener protected?ComponentListener?createComponentListener()
創(chuàng)建并返回一個新的ComponentHandler。
這用于大型模型,以在組件移動時將validCachedPreferredSize標(biāo)記為無效。
結(jié)果
ComponentListener一個實(shí)例
createTreeExpansionListener protected?TreeExpansionListener?createTreeExpansionListener()
當(dāng)節(jié)點(diǎn)擴(kuò)展?fàn)顟B(tài)更改時,創(chuàng)建并返回負(fù)責(zé)更新treestate的對象。
結(jié)果
TreeExpansionListener一個實(shí)例
createLayoutCache protected?AbstractLayoutCache?createLayoutCache()
創(chuàng)建負(fù)責(zé)管理擴(kuò)展內(nèi)容的對象以及節(jié)點(diǎn)的大小。
結(jié)果
負(fù)責(zé)管理擴(kuò)展內(nèi)容的對象
createCellRendererPane protected?CellRendererPane?createCellRendererPane()
返回放置渲染器組件的渲染器窗格。
結(jié)果
CellRendererPane一個實(shí)例
createDefaultCellEditor protected?TreeCellEditor?createDefaultCellEditor()
創(chuàng)建默認(rèn)單元格編輯器。
結(jié)果
默認(rèn)的單元格編輯器
createDefaultCellRenderer protected?TreeCellRenderer?createDefaultCellRenderer()
返回用于對每個節(jié)點(diǎn)進(jìn)行標(biāo)記的默認(rèn)單元格渲染器。
結(jié)果
TreeCellRenderer一個實(shí)例
createTreeModelListener protected?TreeModelListener?createTreeModelListener()
返回一個偵聽器,可以在模型更改時更新樹。
結(jié)果
TreeModelListener一個實(shí)例。
prepareForUIUninstall protected?void?prepareForUIUninstall()
在安裝UI之前調(diào)用。
completeUIUninstall protected?void?completeUIUninstall()
卸載UI。
uninstallDefaults protected?void?uninstallDefaults()
卸載默認(rèn)屬性。
uninstallListeners protected?void?uninstallListeners()
取消注冊聽眾。
uninstallKeyboardActions protected?void?uninstallKeyboardActions()
取消注冊鍵盤操作。
uninstallComponents protected?void?uninstallComponents()
卸載渲染器窗格。
getBaseline public?int?getBaseline?(JComponent?c,
int?width,
int?height)
返回基線。
重寫:
參數(shù)
c -
JComponent正在申請基線
width - 獲取基線的寬度
height - 獲取基線的高度
結(jié)果
基線或值<0表示沒有合理的基線
異常
從以下版本開始:
1.6
另請參見:
getBaselineResizeBehavior
返回一個枚舉,指示組件的基線如何隨大小的變化而變化。
isDropLine protected?boolean?isDropLine?(JTree.DropLocation?loc)
告知DropLocation是否應(yīng)由節(jié)點(diǎn)之間的線指示。
這適用于javax.swing.DropMode.INSERT和javax.swing.DropMode.ON_OR_INSERT丟棄模式。
參數(shù)
loc - a
DropLocation
結(jié)果
true如果放置位置應(yīng)顯示為一條線
從以下版本開始:
1.7
paintDropLine protected?void?paintDropLine?(Graphics?g)
畫下線。
參數(shù)
g -
Graphics要繪制的對象
從以下版本開始:
1.7
getDropLineRect protected?Rectangle?getDropLineRect?(JTree.DropLocation?loc)
返回下拉線的無限制框。
參數(shù)
loc - a
DropLocation
結(jié)果
下拉線的邊界框
從以下版本開始:
1.7
paintHorizontalPartOfLeg protected?void?paintHorizontalPartOfLeg?(Graphics?g,
Rectangle?clipBounds,
Insets?insets,
Rectangle?bounds,
TreePath?path,
int?row,
boolean?isExpanded,
boolean?hasBeenExpanded,
boolean?isLeaf)
涂抹腿部的水平部分。
接收方不應(yīng)修改clipBounds或insets 。
注意:如果根不可見,則parentRow可以為-1。
參數(shù)
g - 圖形上下文
clipBounds - 剪裁的矩形
insets - 內(nèi)
insets
bounds - 一個邊界矩形
path - 樹路徑
row - 一排
isExpanded -
true如果路徑已展開
hasBeenExpanded -
true如果路徑已展開
isLeaf -
true如果路徑是葉子
paintVerticalPartOfLeg protected?void?paintVerticalPartOfLeg?(Graphics?g,
Rectangle?clipBounds,
Insets?insets,
TreePath?path)
涂抹腿部的垂直部分。
該接收器不應(yīng)修改clipBounds , insets 。
參數(shù)
g - 圖形上下文
clipBounds - 剪裁的矩形
insets - insets
path - 樹路徑
paintExpandControl protected?void?paintExpandControl?(Graphics?g,
Rectangle?clipBounds,
Insets?insets,
Rectangle?bounds,
TreePath?path,
int?row,
boolean?isExpanded,
boolean?hasBeenExpanded,
boolean?isLeaf)
繪制一行的展開(切換)部分。
接收方不應(yīng)修改clipBounds或insets 。
參數(shù)
g - 圖形上下文
clipBounds - 剪裁的矩形
insets - 內(nèi)
insets
bounds - 一個邊界矩形
path - 樹路徑
row - 一排
isExpanded -
true如果路徑已展開
hasBeenExpanded -
true如果路徑已展開
isLeaf -
true如果行是葉子
paintRow protected?void?paintRow?(Graphics?g,
Rectangle?clipBounds,
Insets?insets,
Rectangle?bounds,
TreePath?path,
int?row,
boolean?isExpanded,
boolean?hasBeenExpanded,
boolean?isLeaf)
繪制一行的渲染器部分。
接收方不應(yīng)修改clipBounds或insets 。
參數(shù)
g - 圖形上下文
clipBounds - 剪裁的矩形
insets - 內(nèi)
insets
bounds - 一個邊界矩形
path - 樹路徑
row - 一排
isExpanded -
true如果路徑已展開
hasBeenExpanded -
true如果路徑已展開
isLeaf -
true如果路徑是葉子
shouldPaintExpandControl protected?boolean?shouldPaintExpandControl?(TreePath?path,
int?row,
boolean?isExpanded,
boolean?hasBeenExpanded,
boolean?isLeaf)
如果應(yīng)為指定行繪制展開(切換)控件,則返回
true 。
參數(shù)
path - 樹路徑
row - 一排
isExpanded -
true如果路徑已展開
hasBeenExpanded -
true如果路徑已展開
isLeaf -
true如果行是葉子
結(jié)果
true是否應(yīng)為指定行繪制展開(切換)控件
paintVerticalLine protected?void?paintVerticalLine?(Graphics?g,
JComponent?c,
int?x,
int?top,
int?bottom)
畫一條垂直線。
參數(shù)
g - 圖形上下文
c - 組件
x - X坐標(biāo)
top - Y1坐標(biāo)
bottom - Y2坐標(biāo)
paintHorizontalLine protected?void?paintHorizontalLine?(Graphics?g,
JComponent?c,
int?y,
int?left,
int?right)
畫一條水平線。
參數(shù)
g - 圖形上下文
c - 一個組件
y - Y坐標(biāo)
left - X1坐標(biāo)
right - X2坐標(biāo)
getVerticalLegBuffer protected?int?getVerticalLegBuffer()
節(jié)點(diǎn)之間的腿的垂直元素默認(rèn)從父節(jié)點(diǎn)的底部開始。
這種方法使腿部開始低于此值。
結(jié)果
垂直腿緩沖
getHorizontalLegBuffer protected?int?getHorizontalLegBuffer()
默認(rèn)情況下,節(jié)點(diǎn)之間的支路的水平元素從子節(jié)點(diǎn)的左側(cè)開始。
這種方法在此之前使腿部結(jié)束。
結(jié)果
水平腿緩沖
drawCentered protected?void?drawCentered?(Component?c,
Graphics?graphics,
Icon?icon,
int?x,
int?y)
繪制以(x,y)為中心的
icon 。
參數(shù)
c - 組件
graphics - 圖形上下文
icon - 一個圖標(biāo)
x - X坐標(biāo)
y - Y坐標(biāo)
drawDashedHorizontalLine protected?void?drawDashedHorizontalLine?(Graphics?g,
int?y,
int?x1,
int?x2)
畫一條水平虛線。
假設(shè)x1 <= x2 。
如果x1大于x2 ,則該方法不提取任何內(nèi)容。
參數(shù)
g -實(shí)例
Graphics
y - Y坐標(biāo)
x1 - X1坐標(biāo)
x2 - X2坐標(biāo)
drawDashedVerticalLine protected?void?drawDashedVerticalLine?(Graphics?g,
int?x,
int?y1,
int?y2)
畫一條垂直虛線。
假定為y1 <= y2 。
如果y1大于y2 ,則該方法不提取任何內(nèi)容。
參數(shù)
g -實(shí)例
Graphics
x - X坐標(biāo)
y1 - Y1坐標(biāo)
y2 - Y2坐標(biāo)
getRowX protected?int?getRowX?(int?row,
int?depth)
返回沿x軸的位置,以呈現(xiàn)特定的行。
返回值不包括JTree上指定的任何Insets。
這不會檢查行或深度的有效性,假設(shè)它是正確的,并且如果行或深度與樹的行或深度不匹配,則不會拋出異常。
參數(shù)
row - 要返回x位置的行
depth - 行的深度
結(jié)果
相當(dāng)于縮進(jìn)給定行的數(shù)量。
從以下版本開始:
1.5
updateLayoutCacheExpandedNodes protected?void?updateLayoutCacheExpandedNodes()
使所有在JTree中擴(kuò)展的節(jié)點(diǎn)在LayoutCache中擴(kuò)展。
這將使用根路徑調(diào)用updateExpandedDescendants。
updateExpandedDescendants protected?void?updateExpandedDescendants?(TreePath?path)
通過從樹中獲取展開的后代并轉(zhuǎn)發(fā)到樹狀態(tài)來更新
path的所有后代的展開狀態(tài)。
參數(shù)
path - 樹路徑
getLastChildPath protected?TreePath?getLastChildPath?(TreePath?parent)
返回最后一個子項(xiàng)
parent的路徑。
參數(shù)
parent - 樹路徑
結(jié)果
最后一個孩子的路徑
parent
updateDepthOffset protected?void?updateDepthOffset()
更新每個深度應(yīng)該偏移的程度。
updateCellEditor protected?void?updateCellEditor()
根據(jù)我們所包含的JTree的可編輯性更新cellEditor。如果樹是可編輯的但沒有cellEditor,則將使用基本樹。
updateRenderer protected?void?updateRenderer()
當(dāng)渲染器發(fā)生變化時,我們從樹中傳來消息。
configureLayoutCache protected?void?configureLayoutCache()
根據(jù)我們提供外觀的樹重置TreeState實(shí)例。
updateSize protected?void?updateSize()
將緩存的大小標(biāo)記為無效,并使用
treeDidChange向樹發(fā)送消息。
updateCachedPreferredSize protected?void?updateCachedPreferredSize()
更新preferredSize實(shí)例變量,該變量從getPreferredSize()返回。
對于從左到右的方向,大小由當(dāng)前的AbstractLayoutCache確定。 對于RTL方向,首選大小變?yōu)閷挾葴p去最小x位置。
pathWasExpanded protected?void?pathWasExpanded?(TreePath?path)
在
VisibleTreeNode后從
VisibleTreeNode消息。
參數(shù)
path - 樹路徑
pathWasCollapsed protected?void?pathWasCollapsed?(TreePath?path)
它崩潰后從
VisibleTreeNode消息。
參數(shù)
path - 樹路徑
ensureRowsAreVisible protected?void?ensureRowsAreVisible?(int?beginRow,
int?endRow)
確保
beginRow至
endRow標(biāo)識的行可見。
參數(shù)
beginRow - 開始行
endRow - 結(jié)束行
setPreferredMinSize public?void?setPreferredMinSize?(Dimension?newSize)
設(shè)置首選最小大小。
參數(shù)
newSize - 新的首選大小
getPreferredMinSize public?Dimension?getPreferredMinSize()
返回最小首選大小。
結(jié)果
最小首選尺寸
getPreferredSize public?Dimension?getPreferredSize?(JComponent?c,
boolean?checkConsistency)
返回表示c中樹的首選大小。
如果checkConsistency為true則首先true checkConsistency消息。
參數(shù)
c - 一個組件
checkConsistency - 如果檢查
true一致性
結(jié)果
表示組件中樹的首選大小
getMaximumSize public?Dimension?getMaximumSize?(JComponent?c)
返回此組件的最大大小,如果實(shí)例當(dāng)前位于JTree中,則該大小將是首選大小,或0,0。
completeEditing protected?void?completeEditing()
用于停止編輯會話的消息。
如果接收器提供的外觀和感覺從getInvokesStopCellEditing返回true,則將在當(dāng)前編輯器上調(diào)用stopCellEditing。
然后,completeEditing將顯示false,true,false消息,以取消任何延遲編輯。
completeEditing protected?void?completeEditing?(boolean?messageStop,
boolean?messageCancel,
boolean?messageTree)
停止編輯會話。
如果messageStop為true編輯器中傳遞消息與stopEditing ,如果messageCancel為true編輯器中傳遞消息與cancelEditing 。
如果messageTree是true向treeModel消息valueForPathChanged 。
參數(shù)
messageStop - 要停止編輯的消息
messageCancel - 取消編輯的消息
messageTree - 樹的消息
startEditing protected?boolean?startEditing?(TreePath?path,
MouseEvent?event)
如果有cellEditor和shouldSelectCell返回true將開始編輯節(jié)點(diǎn)。
這假定路徑有效且可見。
參數(shù)
path - 樹路徑
event - 鼠標(biāo)事件
結(jié)果
true如果編輯成功
checkForClickInExpandControl protected?void?checkForClickInExpandControl?(TreePath?path,
int?mouseX,
int?mouseY)
如果
mouseX和
mouseY都在的展開/折疊區(qū)域
row ,這將切換行。
參數(shù)
path - 樹路徑
mouseX - X坐標(biāo)
mouseY - Y坐標(biāo)
isLocationInExpandControl protected?boolean?isLocationInExpandControl?(TreePath?path,
int?mouseX,
int?mouseY)
返回
true如果
mouseX和
mouseY下降,用于展開/折疊節(jié)點(diǎn)和節(jié)點(diǎn)的行的區(qū)域
row不代表葉子。
參數(shù)
path - 樹路徑
mouseX - X坐標(biāo)
mouseY - Y坐標(biāo)
結(jié)果
true如果鼠標(biāo)光標(biāo)落在用于展開/折疊節(jié)點(diǎn)且該節(jié)點(diǎn)不是葉子的行區(qū)域中。
handleExpandControlClick protected?void?handleExpandControlClick?(TreePath?path,
int?mouseX,
int?mouseY)
當(dāng)用戶單擊特定行時發(fā)送消息,這將調(diào)用
toggleExpandState 。
參數(shù)
path - 樹路徑
mouseX - X坐標(biāo)
mouseY - Y坐標(biāo)
toggleExpandState protected?void?toggleExpandState?(TreePath?path)
如果未展開,則展開路徑;如果展開,則展開行。
如果擴(kuò)張的路徑和JTree上擴(kuò)大卷軸, ensureRowsAreVisible被調(diào)用,以盡可能多的孩子滾動到盡可能可見(試圖滾動到路徑的最后一個可見的后代)。
參數(shù)
path - 樹路徑
isToggleSelectionEvent protected?boolean?isToggleSelectionEvent?(MouseEvent?event)
返回
true表示節(jié)點(diǎn)上的鼠標(biāo)事件應(yīng)該僅切換鼠標(biāo)
true的選擇。
參數(shù)
event - 鼠標(biāo)事件
結(jié)果
true如果節(jié)點(diǎn)上的鼠標(biāo)事件應(yīng)切換選擇
isMultiSelectEvent protected?boolean?isMultiSelectEvent?(MouseEvent?event)
返回
true表示節(jié)點(diǎn)上的鼠標(biāo)事件應(yīng)從錨點(diǎn)中選擇。
參數(shù)
event - 鼠標(biāo)事件
結(jié)果
true如果節(jié)點(diǎn)上的鼠標(biāo)事件應(yīng)從錨點(diǎn)中選擇
isToggleEvent protected?boolean?isToggleEvent?(MouseEvent?event)
返回true表示應(yīng)根據(jù)事件切換鼠標(biāo)下的行。
這是在checkForClickInExpandControl之后調(diào)用的,這意味著該位置不在擴(kuò)展(切換)控件中。
參數(shù)
event - 鼠標(biāo)事件
結(jié)果
true如果應(yīng)該切換鼠標(biāo)下的行
selectPathForEvent protected?void?selectPathForEvent?(TreePath?path,
MouseEvent?event)
消息傳遞基于特定行的MouseEvent更新選擇。
如果事件是切換選擇事件,則選擇或取消選擇該行。
如果事件標(biāo)識多選事件,則從錨點(diǎn)更新選擇。
否則,將選擇該行,如果事件指定了切換事件,則行將展開/折疊。
參數(shù)
path - 所選路徑
event - 鼠標(biāo)事件
isLeaf protected?boolean?isLeaf?(int?row)
返回
true如果在節(jié)點(diǎn)
row是葉。
參數(shù)
row - 一排
結(jié)果
true如果在節(jié)點(diǎn)
row是葉
updateLeadSelectionRow protected?void?updateLeadSelectionRow()
更新選擇的前導(dǎo)行。
從以下版本開始:
1.7
getLeadSelectionRow protected?int?getLeadSelectionRow()
返回選擇的前導(dǎo)行。
結(jié)果
選擇引導(dǎo)行
從以下版本開始:
1.7
總結(jié)
以上是生活随笔為你收集整理的lsm tree java_BasicTreeUI的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iptable 详解_最全的iptabl
- 下一篇: ionic 支持float吗_机器人协会