public class XWFitLayout extends XLayoutContainer
XWidgetCreator.LimpidButton
限定符和类型 | 字段和说明 |
---|---|
protected double |
containerPercent |
protected boolean |
hasCalGap |
default_Length, editable, isMouseEnter, isRefreshing, LARGEPREFERREDSIZE, MIN_HEIGHT, MIN_WIDTH
BORDER_PREFERRED_SIZE
FULL_OPACITY, HALF_OPACITY
backupParent, backupSize, BIG_PREFERRED_SIZE, coverPanel, data, DEFALUTBORDER, editor, MIDDLE_PREFERRED_SIZE, SMALL_PREFERRED_SIZE
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
构造器和说明 |
---|
XWFitLayout() |
XWFitLayout(WFitLayout widget,
java.awt.Dimension initSize) |
限定符和类型 | 方法和说明 |
---|---|
void |
add(java.awt.Component comp,
java.lang.Object constraints)
在添加的时候需要把可拉伸的方向确定,所以重写了add方法
|
void |
addCompInterval(int gap)
间隔大于0时,界面处加上间隔
界面的间隔是针对显示,实际保存的大小不受间隔影响
ps:改变布局大小或者拖入、删除、拉伸都要重新考虑间隔
|
void |
adjustCreatorsHeight(double percent)
布局容器高度手动修改时,
同时调整容器内的组件们,缩小时需要考虑有的组件高度不满足缩小高度
|
void |
adjustCreatorsWhileSlide(double percent)
直接拖动滑条改变整体像素大小时,不用考虑控件的最小高度宽度,内部组件全部一起缩小放大
只是界面显示大小改变,不改变对应的BoundsWidget大小
|
void |
adjustCreatorsWidth(double percent)
按照百分比缩放内部组件宽度
|
boolean |
canAddInterval(int interval)
是否可以加入当前间隔
|
boolean |
canReduce(double percent)
是否能缩小
|
void |
componentAdded(java.awt.event.ContainerEvent e)
组件增加
|
void |
componentRemoved(java.awt.event.ContainerEvent e)
组件删除
|
void |
convert()
将WLayout转换为XLayoutContainer
|
java.lang.String |
createDefaultName()
f返回默认组件name
|
void |
dealDirections(XCreator xcreator,
boolean isInit)
处理自适应布局的directions
|
XLayoutContainer |
findNearestFit()
寻找最近的为自适应布局的父容器
|
int |
getActualMinHeight()
返回界面处根据百分比调整后的最小高度
|
int |
getActualMinWidth()
返回界面处根据百分比调整后的最小宽度
|
int |
getAcualInterval()
返回界面处根据百分比调整后的间隔大小(且为偶数)
|
java.awt.Component |
getBottomComp(int x,
int y,
int h)
返回指定point的下方组件
|
java.awt.Component |
getBottomLeftComp(int x,
int y,
int h)
返回指定point的左方且是下侧的组件
|
java.awt.Component |
getBottomRightComp(int x,
int y,
int h,
int w)
返回指定point的右方且是下侧的组件
|
double |
getContainerPercent()
返回容器大小的百分比
|
XCreator |
getCreatorAt(int x,
int y)
返回 x、y 所在区域的组件
|
int[] |
getHors()
获取内部组件横坐标的值
|
int[] |
getHors(boolean isActualSize)
获取内部组件横坐标的值
|
protected java.lang.String |
getIconName() |
LayoutAdapter |
getLayoutAdapter() |
java.awt.Component |
getLeftComp(int x,
int y)
主要为自适应用
返回指定point的左方组件
|
int |
getMinHeight(java.util.List<java.awt.Component> comps)
返回内部组件的最小高度
|
java.awt.Dimension |
getMinimumSize() |
int |
getNeedAddHeight()
返回最右侧控件的微调高度
|
int |
getNeedAddWidth()
返回最右侧控件的微调宽度
|
java.awt.Component |
getRightBottomComp(int x,
int y,
int h,
int w)
返回指定point的下方且是右侧的组件
|
java.awt.Component |
getRightComp(int x,
int y,
int w)
返回指定point的右方组件
|
java.awt.Component |
getRightTopComp(int x,
int y,
int w)
返回指定point的上方且是右侧的组件
|
java.awt.Component |
getTopComp(int x,
int y)
主要为自适应用
返回指定point的上方组件
|
int[] |
getVeris()
获取内部组件纵坐标值
|
int[] |
getVeris(boolean isActualSize)
获取内部组件纵坐标值
|
WidgetPropertyUIProvider[] |
getWidgetPropertyUIProviders()
获取当前组件自定义的属性表tab
|
java.awt.Dimension |
initEditorSize()
初始化组件大小
|
protected void |
initLayoutManager() |
boolean |
isHasCalGap()
返回是否已经加上间隔
|
boolean |
isMovable()
是否支持上移一层、下移一层等操作
|
boolean |
isSupportDrag()
该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽)
|
protected void |
layoutHeightResize(double percent) |
protected void |
layoutWidthResize(double percent) |
protected void |
modifyEdgemostCreator(boolean isHor)
布局最右侧或下侧有控件在缩小时达到最小宽高,则微调下
|
void |
moveCompInterval(int gap)
去除原有的间隔
|
void |
moveContainerMargin()
去除内边距
重设间隔时,保存实际大小时都要先去掉内边距
|
XCreator |
replace(Widget widget,
XCreator oldcreator)
当前组件zorder位置替换新的控件
|
void |
setBackupGap(double backupPercent)
设置上次的间隔
|
void |
setContainerPercent(double containerPercent)
设置容器大小的百分比
|
void |
setHasCalGap(boolean hasCalGap)
设置当前的间隔
|
void |
setNeedAddHeight(int needAddHeight) |
void |
setNeedAddWidth(int needAddWidth) |
boolean |
switch2FitBodyLayout(XCreator creator) |
WFitLayout |
toData()
返回容器对应的wlayout
|
void |
updateBoundsWidget()
新增删除拉伸后更新每个组件的BoundsWidget
|
protected void |
updateWidgetBackupBounds()
更新boundsWidget的backupBound
|
addWidgetToSwingComponent, calculatePreferredSize, canEnterIntoParaPane, createMarginDescriptor, createWidgetNameDescriptor, firePropertyChange, getAllXCreatorNameList, getDataBackground, getDesignWidth, getFRLayout, getIndexOfChild, getPosition, getShowXCreatorCount, getXCreator, getXCreatorCount, initEditor, initXCreatorProperties, isComponentTreeLeaf, isDelayDisplayContent, isDisplay, isEditable, isUseParamsTemplate, recalculateChildrenPreferredSize, SearchQueryCreators, setBackground, setComponentZOrder, setDelayDisplayContent, setDisplay, setEditable, setMouseEnter, setPosition, setUseParamsTemplate, stopAddingState, supportedDescriptor, supportInnerOrderChangeActions, supportSetEnable, supportSetVisible
getInsets, initBorderStyle, initStyle, initTitleStyle
ChangeCreatorName, makeVisible, paint, recalculateChildrenSize
acceptType, addToWrapper, adjustCompHeight, adjustCompSize, adjustCompWidth, backupCurrentSize, backupParent, canEnterIntoAbsolutePane, canEnterIntoAdaptPane, createPopupMenu, createToolPane, deleteRelatedComponent, destroyHelpDialog, displayCoverPane, getBackupBound, getBackupParent, getCoverPane, getCreatorWrapper, getDesignerEditor, getDirections, getEditingChildCreator, getIconPath, getOuterLayout, getParentShow, getPropertyDescriptorCreator, getShareId, getTargetChildrenList, getTopLayout, getXCreator, hasTitleStyle, initCreatorWrapper, isDedicateContainer, isHelpBtnOnFocus, isReport, isShared, isSupportShared, notShowInComponentTree, paintBorder, rebuid, recalculateChildHeight, recalculateChildWidth, resetCreatorName, resetData, resetVisible, respondClick, seleteRelatedComponent, setBackupBound, setBackupParent, setBounds, setDirections, setHelpBtnOnFocus, setInitSize, setShareId, setWrapperName, setXDescrption, setXDescrption, shouldScaleCreator, stopEditing, supportRenameInWidgetTree, updateChildBound, useBackupSize
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBounds
public XWFitLayout()
public XWFitLayout(WFitLayout widget, java.awt.Dimension initSize)
public LayoutAdapter getLayoutAdapter()
getLayoutAdapter
在类中 XLayoutContainer
protected void initLayoutManager()
initLayoutManager
在类中 XLayoutContainer
protected java.lang.String getIconName()
getIconName
在类中 XBorderStyleWidgetCreator
public int getNeedAddWidth()
public void setNeedAddWidth(int needAddWidth)
public int getNeedAddHeight()
public void setNeedAddHeight(int needAddHeight)
public void adjustCreatorsWhileSlide(double percent)
percent
- 缩放的百分值public int[] getHors()
getHors
在类中 XLayoutContainer
public int[] getVeris()
getVeris
在类中 XLayoutContainer
public int[] getHors(boolean isActualSize)
isActualSize
- 实际大小public int[] getVeris(boolean isActualSize)
isActualSize
- 实际大小public boolean canReduce(double percent)
percent
- 百分比public void adjustCreatorsWidth(double percent)
percent
- 宽度变化的百分比protected void layoutWidthResize(double percent)
protected void modifyEdgemostCreator(boolean isHor)
public void adjustCreatorsHeight(double percent)
percent
- 高度变化的百分比protected void layoutHeightResize(double percent)
public XCreator getCreatorAt(int x, int y)
x
- 坐标xy
- 坐标yprotected void updateWidgetBackupBounds()
public int getMinHeight(java.util.List<java.awt.Component> comps)
comps
- 组件集合public java.awt.Dimension initEditorSize()
initEditorSize
在类中 XLayoutContainer
public java.lang.String createDefaultName()
createDefaultName
在类中 XCreator
public WFitLayout toData()
toData
在类中 XLayoutContainer
public XCreator replace(Widget widget, XCreator oldcreator)
replace
在类中 XLayoutContainer
widget
- 控件oldcreator
- 旧组件public java.awt.Dimension getMinimumSize()
getMinimumSize
在类中 XCreator
public void convert()
convert
在类中 XLayoutContainer
public void componentAdded(java.awt.event.ContainerEvent e)
componentAdded
在接口中 java.awt.event.ContainerListener
componentAdded
在类中 XLayoutContainer
e
- 容器事件public void updateBoundsWidget()
public void componentRemoved(java.awt.event.ContainerEvent e)
componentRemoved
在接口中 java.awt.event.ContainerListener
componentRemoved
在类中 XLayoutContainer
e
- 容器事件public void add(java.awt.Component comp, java.lang.Object constraints)
add
在类中 java.awt.Container
comp
- 组件constraints
- 属性public void dealDirections(XCreator xcreator, boolean isInit)
xcreator
- 组件public void addCompInterval(int gap)
gap
- 间隔public void moveCompInterval(int gap)
gap
- 间隔public boolean canAddInterval(int interval)
interval
- 间隔public void moveContainerMargin()
public java.awt.Component getTopComp(int x, int y)
XLayoutContainer
getTopComp
在类中 XLayoutContainer
x
- x位置y
- y位置public java.awt.Component getLeftComp(int x, int y)
XLayoutContainer
getLeftComp
在类中 XLayoutContainer
x
- x位置y
- y位置public java.awt.Component getRightComp(int x, int y, int w)
XLayoutContainer
getRightComp
在类中 XLayoutContainer
x
- x位置y
- y位置w
- 宽度public java.awt.Component getBottomComp(int x, int y, int h)
XLayoutContainer
getBottomComp
在类中 XLayoutContainer
x
- x位置y
- y位置h
- 高度public java.awt.Component getRightTopComp(int x, int y, int w)
XLayoutContainer
getRightTopComp
在类中 XLayoutContainer
x
- x位置y
- y位置w
- 宽度public java.awt.Component getBottomLeftComp(int x, int y, int h)
XLayoutContainer
getBottomLeftComp
在类中 XLayoutContainer
x
- x位置y
- y位置h
- 高度public java.awt.Component getBottomRightComp(int x, int y, int h, int w)
XLayoutContainer
getBottomRightComp
在类中 XLayoutContainer
x
- x位置y
- y位置h
- 高度w
- 宽度public java.awt.Component getRightBottomComp(int x, int y, int h, int w)
XLayoutContainer
getRightBottomComp
在类中 XLayoutContainer
x
- x位置y
- y位置h
- 高度w
- 宽度public double getContainerPercent()
public void setContainerPercent(double containerPercent)
containerPercent
- the containerPercent to setpublic boolean isSupportDrag()
isSupportDrag
在类中 XCreator
public int getActualMinWidth()
public int getActualMinHeight()
public int getAcualInterval()
public boolean isHasCalGap()
public void setHasCalGap(boolean hasCalGap)
hasCalGap
- the hasCalGap to set 间隔public void setBackupGap(double backupPercent)
backupPercent
- 上次的百分比public XLayoutContainer findNearestFit()
findNearestFit
在类中 XLayoutContainer
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders()
XCreator
getWidgetPropertyUIProviders
在类中 XCreator
public boolean switch2FitBodyLayout(XCreator creator)