|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.miginfocom.swt.SwtComponentWrapper
public class SwtComponentWrapper
| Field Summary |
|---|
| Fields inherited from interface net.miginfocom.layout.ComponentWrapper |
|---|
TYPE_BUTTON, TYPE_CHECK_BOX, TYPE_COMBO_BOX, TYPE_CONTAINER, TYPE_IMAGE, TYPE_LABEL, TYPE_LIST, TYPE_PANEL, TYPE_PROGRESS_BAR, TYPE_SCROLL_BAR, TYPE_SCROLL_PANE, TYPE_SEPARATOR, TYPE_SLIDER, TYPE_SPINNER, TYPE_TABLE, TYPE_TEXT_AREA, TYPE_TEXT_FIELD, TYPE_TREE, TYPE_UNKNOWN, TYPE_UNSET |
| Constructor Summary | |
|---|---|
SwtComponentWrapper(Control c)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
int |
getBaseline(int width,
int height)
Returns the baseline for the component given the suggested height. |
java.lang.Object |
getComponent()
Returns the actual object that this wrapper is aggregating. |
int |
getComponetType(boolean disregardScrollPane)
Returns the type of component that this wrapper is wrapping. |
int |
getHeight()
Returns the current height for this component. |
int |
getHorizontalScreenDPI()
Returns the DPI (Dots Per Inch) of the screen the component is currently in or for the default screen if the component is not visible. |
int |
getLayoutHashCode()
Returns a hash code that should be resonably different for anything that might change the layout. |
java.lang.String |
getLinkId()
Returns a String id that can be used to reference the component in link constraints. |
int |
getMaximumHeight()
Returns the maximum height of the component. |
int |
getMaximumWidth()
Returns the maximum width of the component. |
int |
getMinimumHeight()
Returns the minimum height of the component. |
int |
getMinimumWidth()
Returns the minimum width of the component. |
ContainerWrapper |
getParent()
Returns the container for this component. |
float |
getPixelUnitFactor(boolean isHor)
Returns the pixel unit factor for the horizontal or vertical dimension. |
int |
getPreferredHeight()
Returns the preferred height of the component. |
int |
getPreferredWidth()
Returns the preferred width of the component. |
int |
getScreenHeight()
Returns the pixel size of the screen that the component is currently in or for the default screen if the component is not visible or null. |
int |
getScreenLocationX()
Returns the screen x-coordinate for the upper left coordinate of the component layoutable bounds. |
int |
getScreenLocationY()
Returns the screen y-coordinate for the upper left coordinate of the component layoutable bounds. |
int |
getScreenWidth()
Returns the pixel size of the screen that the component is currently in or for the default screen if the component is not visible or null. |
int |
getVerticalScreenDPI()
Returns the DPI (Dots Per Inch) of the screen the component is currently in or for the default screen if the component is not visible. |
int |
getWidth()
Returns the current width for this component. |
int[] |
getVisualPadding()
Returns the padding on a component by component basis. |
int |
getX()
Returns the current x coordinate for this component. |
int |
getY()
Returns the current y coordinate for this component. |
boolean |
hasBaseline()
Returns if the component has a baseline and if it can be retrieved. |
int |
hashCode()
|
static boolean |
isMinimumSizeZero()
Sets if minimum size for SWT components should be preferred size (default, false) or 0. |
static boolean |
isUseVisualPadding()
|
boolean |
isVisible()
Returns if the component's visibility is set to true. |
void |
paintDebugOutline()
Paints component outline to indicate where it is. |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the component's bounds. |
static void |
setMinimumSizeZero(boolean b)
Sets if minimum size for SWT components should be preferred size (default, false) or 0. |
static void |
setUseVisualPadding(boolean b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwtComponentWrapper(Control c)
| Method Detail |
|---|
public final int getBaseline(int width,
int height)
ComponentWrapper
getBaseline in interface ComponentWrapperwidth - The width to calculate for if other than the current. If -1 the current size should be used.height - The height to calculate for if other than the current. If -1 the current size should be used.
public final java.lang.Object getComponent()
ComponentWrapperIf this is a container the container should be returned instead.
getComponent in interface ComponentWrappernull.public final float getPixelUnitFactor(boolean isHor)
ComponentWrapperThe factor is 1 for both dimensions on the normal font in a JPanel on Windows. The factor should increase with a bigger "X".
This is the Swing version:
Rectangle2D r = fm.getStringBounds("X", parent.getGraphics());
wFactor = r.getWidth() / 6;
hFactor = r.getHeight() / 13.27734375f;
getPixelUnitFactor in interface ComponentWrapperisHor - If it is the horizontal factor that should be returned.
public final int getX()
ComponentWrapper
getX in interface ComponentWrapperpublic final int getY()
ComponentWrapper
getY in interface ComponentWrapperpublic final int getWidth()
ComponentWrapper
getWidth in interface ComponentWrapperpublic final int getHeight()
ComponentWrapper
getHeight in interface ComponentWrapperpublic final int getScreenLocationX()
ComponentWrapper
getScreenLocationX in interface ComponentWrapperpublic final int getScreenLocationY()
ComponentWrapper
getScreenLocationY in interface ComponentWrapperpublic final int getMinimumHeight()
ComponentWrapper
getMinimumHeight in interface ComponentWrapperpublic final int getMinimumWidth()
ComponentWrapper
getMinimumWidth in interface ComponentWrapperpublic final int getPreferredHeight()
ComponentWrapper
getPreferredHeight in interface ComponentWrapperpublic final int getPreferredWidth()
ComponentWrapper
getPreferredWidth in interface ComponentWrapperpublic final int getMaximumHeight()
ComponentWrapper
getMaximumHeight in interface ComponentWrapperpublic final int getMaximumWidth()
ComponentWrapper
getMaximumWidth in interface ComponentWrapperpublic final ContainerWrapper getParent()
ComponentWrapper
getParent in interface ComponentWrappernull.public int getHorizontalScreenDPI()
ComponentWrapper
getHorizontalScreenDPI in interface ComponentWrapperpublic int getVerticalScreenDPI()
ComponentWrapper
getVerticalScreenDPI in interface ComponentWrapperpublic final int getScreenWidth()
ComponentWrappernull.
getScreenWidth in interface ComponentWrapper1280.public final int getScreenHeight()
ComponentWrappernull.
getScreenHeight in interface ComponentWrapper1024.public final boolean hasBaseline()
ComponentWrapperfalse for Swing before mustang.
hasBaseline in interface ComponentWrapperpublic final java.lang.String getLinkId()
ComponentWrappernull should be returned.
For instance the Swing implementation returns the string returned from Component.getName().
getLinkId in interface ComponentWrappernull.
public final void setBounds(int x,
int y,
int width,
int height)
ComponentWrapper
setBounds in interface ComponentWrapperx - The x coordinate.y - The y coordinate.width - The width.height - The height.public boolean isVisible()
ComponentWrappertrue. This should not return if the component is
actually visibile, but if the visibility is set to true or not.
isVisible in interface ComponentWrappertrue means visible.public final int[] getVisualPadding()
ComponentWrapper
Default implementation returnes null for all components except for Windows XP's JTabbedPane which will return new Insets(0, 0, 2, 2).
NOTE! To reduce cenerated garbage the returned padding should never be changed so that the same insets can be returned many times.
getVisualPadding in interface ComponentWrappernull if no padding. NOTE! To reduce cenerated garbage the returned padding should never be changed so that
the same insets can be returned many times. [top, left, bottom, right]public static final boolean isUseVisualPadding()
public static final void setUseVisualPadding(boolean b)
public static boolean isMinimumSizeZero()
true means minimum size is 0.public static void setMinimumSizeZero(boolean b)
b - true means minimum size is 0.public int getLayoutHashCode()
ComponentWrapper
getLayoutHashCode in interface ComponentWrapperpublic final void paintDebugOutline()
ComponentWrapper
paintDebugOutline in interface ComponentWrapperpublic int getComponetType(boolean disregardScrollPane)
ComponentWrapperThis method can be invoked often so the result should be cached.
getComponetType in interface ComponentWrapperdisregardScrollPane - Is true any wrapping scroll pane should be disregarded and the type
of the scrolled component should be returned.
ComponentWrapper.TYPE_LABEL.public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||