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