Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UITreeLayout extends UILayoutManager { // Constructors public UITreeLayout(); public UITreeLayout(int indent); public UITreeLayout(int indent, int vgap); // Methods public Dimension minimumLayoutSize(Container target); public Dimension preferredLayoutSize(Container target); public void drawLine(Graphics g, int x1, int y1, int x2, int y2); public Component navigate(Container cont, Component comp, int dir, boolean keyable); public void layoutContainer(Container target); public void paintContainer(Container target, Graphics g1); }
A class that implements a tree layout manager. UITreeLayout is used to lay out UITree nodes, and handles the drawing of the lines that connect a node to its children.
By default, UISystem defines UITreeLayout at the TREE_LAYOUT index.
public UITreeLayout();Creates a tree layout manager with an indent of 16 pixels and a vertical gap of 2 pixels.
public UITreeLayout(int indent);Creates a tree layout manager with the specified indent and a vertical gap of 2 pixels.
Parameter Description indent The indent (in pixels) used for child components.
public UITreeLayout(int indent, int vgap);Creates a new tree layout manager with the specified indent and vertical gap.
Parameter Description indent The indent (in pixels) used for child components. vgap The vertical spacing between components.
public void drawLine(Graphics g, int x1, int y1, int x2, int y2);Draws a line from one point to another.
Return Value:
No return value.
Parameter Description g The graphics context. x1 The x coordinate of the line's starting point. y1 The y coordinate of the lines's starting point. x2 The x coordinate of the line's ending point. y2 The y coordinate of the line's ending point. Remarks:
This method is called by paintContainer to draw the lines that connect a tree node to its children.
public void layoutContainer(Container target);Lays out the components in the specified container.
Return Value:
No return value.
Parameter Description target The container of the components being laid out.
public Dimension minimumLayoutSize(Container target);Determines the minimum dimensions (in pixels) needed to lay out the components in the specified container.
Return Value:
Returns a Dimension object containing the minimum size.
Parameter Description target The container of the components to be laid out. Remarks:
The minimum layout size is determined from the minimum size of each component in the container.
public Component navigate(Container cont, Component comp, int dir, boolean keyable);Navigates to another component from the specified component in the given direction.
Return Value:
Returns the component navigated to, or null if no component in the specified direction exists.
Parameter Description cont The container where the navigation is occurring. comp The component from which to navigate. dir The direction to navigate. Specify one of the field values in IUIAccessible. keyable If true, non-keyable components will be ignored during the navigation; otherwise, all components can be navigated to. Remarks:
If an undefined direction is specified, an IllegalArgumentException is thrown.
public void paintContainer(Container target, Graphics g1);Paints the container and its contents.
Return Value:
No return value.
Parameter Description target The container. g1 The graphics context of the container. Remarks:
This method calls drawLine to connect a tree node to its children, if the node is expanded.
public Dimension preferredLayoutSize(Container target);Determines the preferred dimensions (in pixels) needed to lay out the components in the specified container.
Return Value:
Returns a Dimension object containing the preferred size.
Parameter Description target The container of the components to be laid out. Remarks:
The preferred layout size is determined from the preferred size of each component in the container.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.