public final class GUICoreUtils
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static DataFunction[] |
FunctionArray |
限定符和类型 | 方法和说明 |
---|---|
static void |
addActionListener(javax.swing.JComponent parentComponent,
java.awt.event.ActionListener actionListener)
增加监听
|
static void |
addChangeListener(javax.swing.JComponent parentComponent,
javax.swing.event.ChangeListener changeListener)
增加监听
|
static void |
adjustStyle(Style style,
EditTextField textField,
int resolution,
java.lang.Object value)
调整样式
|
static void |
centerWindow(java.awt.Window win)
设置一个窗口
|
static javax.swing.JPanel |
createBorderLayoutPane(java.awt.Component[] components)
生成一个边界布局的面板
|
static javax.swing.JPanel |
createBorderLayoutPane(java.lang.Object... args)
生成一个边界布局
|
static javax.swing.JPanel |
createBorderPane(javax.swing.JComponent comp,
java.lang.String boderPosition)
产生一个BorderPane, boderPosition=BoderLayout.CENTER, NORTH, SOUNTH, RIGHT.
|
static javax.swing.JPanel |
createBoxFlowInnerContainerPane(int hgap,
int vgap)
创建一个靠左流式布局,流式内嵌
|
static javax.swing.JPanel |
createCheckboxAndDynamicPane(UICheckBox checkBox,
javax.swing.JPanel dynamicPane,
boolean hideOnSelected)
创建包含选择框和一个动态面板的联动面板。
|
static java.awt.Cursor |
createCustomCursor(java.awt.Image cursor,
java.awt.Point hotSpot,
java.lang.String name,
java.awt.image.ImageObserver ob)
August:一般的cursor的 png图片都是32*32的,下面的方法是用来生成16*16的图片所对应的cursor图标
|
static javax.swing.JPanel |
createFlowPane(java.awt.Component[] comps,
int flowAlignment)
产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT.
|
static javax.swing.JPanel |
createFlowPane(java.awt.Component[] comps,
int flowAlignment,
int hSpace)
产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT.
|
static javax.swing.JPanel |
createFlowPane(java.awt.Component[] comps,
int flowAlignment,
int hSpace,
int vSpace)
产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT,
|
static javax.swing.JPanel |
createFlowPane(java.awt.Component comp,
int flowAlignment)
产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT.
|
static javax.swing.JPanel |
createFlowPane(java.lang.Object... comps)
生成一个以流式布局为布局的面板
|
static javax.swing.JPanel |
createHeaderLayoutPane(java.awt.Component... comps)
创建一个单列垂直布局的 TableLayout 面板
|
static javax.swing.JPanel |
createNamedPane(javax.swing.JComponent comp,
java.lang.String name)
生成一个左边是名字,右边是comp的一个JPanel
|
static UICheckBox |
createNoBorderCheckBox(java.lang.String text)
生成没有边框的 UICheckBox
|
static UILabel |
createTipLabel(java.lang.String tipText)
生成提示标签
|
static javax.swing.border.TitledBorder |
createTitledBorder(java.lang.String s)
设置带颜色的边框
set color title border
|
static javax.swing.border.TitledBorder |
createTitledBorder(java.lang.String s,
java.awt.Color c)
set color title border
设置带颜色的边框
|
static UIToggleButton |
createToolBarComponent(UpdateAction updateAction)
创建工具栏组件
|
static UIToggleButton |
createToolBarComponentWhiteIcon(UpdateAction updateAction)
创建工具栏组件-反白icon
|
static UIButton |
createTransparentButton(javax.swing.Icon icon,
javax.swing.Icon roverIcon,
javax.swing.Icon pressedIcon)
harry:创建自定义按钮(指不受皮肤控制的按钮)
|
static javax.swing.JPanel |
createVerticalNamedPane(javax.swing.JComponent comp,
java.lang.String name)
生成一个上边是名字,下边是comp的一个JPanel
|
static DataFunction[] |
getFunctionArray()
获取函数
|
static javax.swing.JFormattedTextField |
getSpinnerTextField(javax.swing.JSpinner spinner)
得到Spinner的编辑器
|
static java.awt.Color |
getTitleLineBorderColor()
获得UI的TitledBorder,默认的LineBorder的颜色.
|
static javax.swing.tree.TreePath |
getTopTreePath(javax.swing.JTree tree,
javax.swing.tree.TreePath[] treePaths)
peter:获得最上面的那个选中的TreePath
|
static javax.swing.tree.TreePath |
getTreePath(javax.swing.tree.TreeNode treeNode)
it's a very good method, user can get treePath from treeNode.
|
static void |
initCenterPaneChildren(javax.swing.JPanel centerPane,
ColorSelectable colorSelectable)
初始化中央面板
|
static boolean |
isTheSameRect(java.awt.Rectangle oneRect,
java.awt.Rectangle otherRect)
是否在同一区域
|
static boolean |
removeJListSelectedNodes(java.awt.Window ancestorWindow,
javax.swing.JList nodeList)
peter: 删除选中的所有节点
|
static void |
repaint(java.awt.Component component)
************************************************************************
peter:重绘.
|
static void |
setColumnForSpinner(javax.swing.JSpinner spinner,
int columns)
为到Spinner的编辑器设置宽度
|
static void |
setEnabled(javax.swing.JComponent parentComponent,
boolean enabled)
Set enabled.
|
static void |
setSelectedItemQuietly(UIComboBox jcb,
int index)
让UIComboBox在不触发ItemListener的情况下选中某项
|
static void |
setSelectedItemQuietly(UIComboBox jcb,
java.lang.Object item)
让UIComboBox在不触发ItemListener的情况下选中某项
|
static void |
setWindowCenter(java.awt.Window owerWin,
java.awt.Window win)
Gets window/frame to screen center.
|
static void |
setWindowFullScreen(java.awt.Window win)
Gets window/frame to screen center.
|
static void |
showPopMenuWithParentWidth(javax.swing.JPopupMenu popup,
java.awt.Component parentComponent,
int x,
int y)
显示弹出菜单
|
static void |
showPopupCloseMenu(javax.swing.JPopupMenu popup,
java.awt.Component parentComponent)
Shows down component.
|
static void |
showPopupMenu(javax.swing.JPopupMenu popup,
java.awt.Component parentComponent,
int x,
int y)
显示弹出菜单
|
public static DataFunction[] FunctionArray
public static java.awt.Cursor createCustomCursor(java.awt.Image cursor, java.awt.Point hotSpot, java.lang.String name, java.awt.image.ImageObserver ob)
cursor
- 光标hotSpot
- 热点name
- 名称ob
- 观察者public static void initCenterPaneChildren(javax.swing.JPanel centerPane, ColorSelectable colorSelectable)
centerPane
- 中央面板colorSelectable
- 颜色选择public static void adjustStyle(Style style, EditTextField textField, int resolution, java.lang.Object value)
style
- 样式textField
- 文本框resolution
- 调整量value
- 对齐方式public static javax.swing.JPanel createBorderLayoutPane(java.lang.Object... args)
args
- 布局内部的元素,位置等public static javax.swing.border.TitledBorder createTitledBorder(java.lang.String s, java.awt.Color c)
s
- 标题c
- 颜色public static javax.swing.border.TitledBorder createTitledBorder(java.lang.String s)
s
- 标题public static UIToggleButton createToolBarComponent(UpdateAction updateAction)
updateAction
- 更新动作public static UIToggleButton createToolBarComponentWhiteIcon(UpdateAction updateAction)
updateAction
- 更新动作public static void centerWindow(java.awt.Window win)
win
- the current window august:现在要考虑左边日志模板的影响public static void setWindowCenter(java.awt.Window owerWin, java.awt.Window win)
owerWin
- 父窗口win
- 窗口public static void setWindowFullScreen(java.awt.Window win)
窗口
- public static void showPopupCloseMenu(javax.swing.JPopupMenu popup, java.awt.Component parentComponent)
popup
- 弹出菜单父组件
- public static void showPopMenuWithParentWidth(javax.swing.JPopupMenu popup, java.awt.Component parentComponent, int x, int y)
popup
- 弹出菜单parentComponent
- 父组件x
- x坐标y
- y坐标public static void showPopupMenu(javax.swing.JPopupMenu popup, java.awt.Component parentComponent, int x, int y)
popup
- 弹出菜单parentComponent
- 父组件x
- x坐标y
- y坐标public static void setEnabled(javax.swing.JComponent parentComponent, boolean enabled)
parentComponent
- 父组件enabled
- 是否可用public static void addChangeListener(javax.swing.JComponent parentComponent, javax.swing.event.ChangeListener changeListener)
parentComponent
- 父组件changeListener
- 监听public static void addActionListener(javax.swing.JComponent parentComponent, java.awt.event.ActionListener actionListener)
parentComponent
- 父组件actionListener
- 监听public static javax.swing.JPanel createNamedPane(javax.swing.JComponent comp, java.lang.String name)
comp
- 组件name
- 名称public static javax.swing.JPanel createVerticalNamedPane(javax.swing.JComponent comp, java.lang.String name)
comp
- 组件name
- 名称public static javax.swing.JPanel createFlowPane(java.awt.Component comp, int flowAlignment)
comp
- 组件flowAlignment
- 对齐方式public static javax.swing.JPanel createFlowPane(java.awt.Component[] comps, int flowAlignment)
comps
- 组件flowAlignment
- 对齐方式public static javax.swing.JPanel createFlowPane(java.awt.Component[] comps, int flowAlignment, int hSpace)
comps
- 组件flowAlignement
- 对齐方式hSpace
- 水平间隔public static javax.swing.JPanel createFlowPane(java.awt.Component[] comps, int flowAlignment, int hSpace, int vSpace)
comps
- 组件flowAlignment
- 对齐方式hSpace
- 垂直间隔vSpace
- 水平间隔public static javax.swing.JPanel createBoxFlowInnerContainerPane(int hgap, int vgap)
public static javax.swing.JPanel createFlowPane(java.lang.Object... comps)
comps
- 面板中的组件以及布局的参数,后3位参数(可选)分别表示对齐方式,水平间隙,垂直间隙public static javax.swing.JPanel createBorderPane(javax.swing.JComponent comp, java.lang.String boderPosition)
comp
- 组件boderPosition
- 位置public static javax.swing.JPanel createBorderLayoutPane(java.awt.Component[] components)
components
- 面板中的组件,第一个组件位置在中间,第二个组件位置再东边,
第三个组件位置在南边,第四个组件位置在西边,第五个组件位置在北边public static javax.swing.tree.TreePath getTreePath(javax.swing.tree.TreeNode treeNode)
节点
- public static javax.swing.tree.TreePath getTopTreePath(javax.swing.JTree tree, javax.swing.tree.TreePath[] treePaths)
tree
- 树treePaths
- 路径public static java.awt.Color getTitleLineBorderColor()
public static boolean removeJListSelectedNodes(java.awt.Window ancestorWindow, javax.swing.JList nodeList)
ancestorWindow
- 父窗口nodeList
- 节点列表public static javax.swing.JFormattedTextField getSpinnerTextField(javax.swing.JSpinner spinner)
spinner
- spinnerpublic static void setColumnForSpinner(javax.swing.JSpinner spinner, int columns)
spinner
- spinnerpublic static void repaint(java.awt.Component component)
component
- 组件public static UIButton createTransparentButton(javax.swing.Icon icon, javax.swing.Icon roverIcon, javax.swing.Icon pressedIcon)
icon
- 图标roverIcon
- 悬浮图标pressedIcon
- 点击图标public static DataFunction[] getFunctionArray()
public static void setSelectedItemQuietly(UIComboBox jcb, java.lang.Object item)
jcb
- 复选框item
- 选项public static void setSelectedItemQuietly(UIComboBox jcb, int index)
jcb
- 复选框index
- 选项序号public static boolean isTheSameRect(java.awt.Rectangle oneRect, java.awt.Rectangle otherRect)
oneRect
- 矩形框otherRect
- 其他矩形框public static UILabel createTipLabel(java.lang.String tipText)
tipText
- 提示文字public static UICheckBox createNoBorderCheckBox(java.lang.String text)
text
- 说明文字public static javax.swing.JPanel createCheckboxAndDynamicPane(UICheckBox checkBox, javax.swing.JPanel dynamicPane, boolean hideOnSelected)
checkBox
- 选择框dynamicPane
- 包含任意内容的动态面板hideOnSelected
- 选中时隐藏动态面板(若为false,则在"去掉勾选"时隐藏动态面板)public static javax.swing.JPanel createHeaderLayoutPane(java.awt.Component... comps)
comps
- 组件数组