326 |
* |
* |
327 |
* @return the indent value for the right child. |
* @return the indent value for the right child. |
328 |
*/ |
*/ |
329 |
public int getRightChildIndent(int newAmount) |
public int getRightChildIndent() |
330 |
{ |
{ |
331 |
return rightChildIndent; |
return rightChildIndent; |
332 |
} |
} |
2884 |
/** |
/** |
2885 |
* Draws a vertical line using the given graphic context |
* Draws a vertical line using the given graphic context |
2886 |
* |
* |
2887 |
* @param g The graphic context |
* @param g is the graphic context |
2888 |
* @param c The component the new line will belong to |
* @param c is the component the new line will belong to |
2889 |
* @param x Horizonal position |
* @param x is the horizonal position |
2890 |
* @param top Top of the line |
* @param top specifies the top of the line |
2891 |
* @param bottom Bottom of the line |
* @param bottom specifies the bottom of the line |
2892 |
*/ |
*/ |
2893 |
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom) { |
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom) { |
2894 |
g.drawLine(x, top, x, bottom); |
g.drawLine(x, top, x, bottom); |
2897 |
/** |
/** |
2898 |
* Draws a horizontal line using the given graphic context |
* Draws a horizontal line using the given graphic context |
2899 |
* |
* |
2900 |
* @param g The graphic context |
* @param g is the graphic context |
2901 |
* @param c The component the new line will belong to |
* @param c is the component the new line will belong to |
2902 |
* @param y Vertical position |
* @param y is the vertical position |
2903 |
* @param left Left point of the line |
* @param left specifies the left point of the line |
2904 |
* @param right Right point of the line |
* @param right specifies the right point of the line |
2905 |
*/ |
*/ |
2906 |
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right) { |
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right) { |
2907 |
g.drawLine(left, y, right, y); |
g.drawLine(left, y, right, y); |
2908 |
} |
} |
2909 |
|
|
2910 |
|
/** |
2911 |
|
* Draws an icon at around a specific position |
2912 |
|
* |
2913 |
|
* @param c is the component the new line will belong to |
2914 |
|
* @param g is the graphic context |
2915 |
|
* @param icon is the icon which will be drawn |
2916 |
|
* @param x is the center position in x-direction |
2917 |
|
* @param y is the center position in y-direction |
2918 |
|
* |
2919 |
|
* FIXME what to do if x < (icon.width / 2). Same with y |
2920 |
|
*/ |
2921 |
|
protected void drawCentered(JComponent c, Graphics g, Icon icon, int x, int y) { |
2922 |
|
int beginPositionX = x - icon.getIconWidth() / 2; |
2923 |
|
int beginPositionY = y - icon.getIconHeight() / 2; |
2924 |
|
icon.paintIcon(c, g, beginPositionX, beginPositionY); |
2925 |
|
} |
2926 |
} // BasicTreeUI |
} // BasicTreeUI |