JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing
Class JCTreeTable.SwitchIcon

java.lang.Object
  |
  +--com.klg.jclass.swing.JCTreeTable.SwitchIcon
All Implemented Interfaces:
Icon, Serializable
Enclosing class:
JCTreeTable

protected static class JCTreeTable.SwitchIcon
extends Object
implements Icon, Serializable

The icon that renderers itself differently whether the view is TREE or TABLE.

See Also:
Serialized Form

Field Summary
protected  Color background
           
protected  Color foreground
           
protected  boolean orientationLeft
           
protected  int view
           
 
Constructor Summary
JCTreeTable.SwitchIcon()
          Constructor.
JCTreeTable.SwitchIcon(boolean orientationLeft, int view)
          Constructor that specifies the orientation.
 
Method Summary
 Color getBackground()
          Gets the current background color of the icon.
 Color getForeground()
          Gets the current foreground color of the icon.
 int getIconHeight()
          Gets the height of the icon.
 int getIconWidth()
          Gets the width of the icon.
 int getView()
          Gets the current icon view.
 boolean isOrientationLeft()
          Return whether the orientation is left to right or not.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draws the icon.
 void setBackground(Color background)
          Sets the new background color of the icon.
 void setForeground(Color foreground)
          Sets the new foreground color of the icon.
 void setOrientationLeft(boolean orientationLeft)
           
 void setView(int view)
          Sets the icon view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orientationLeft

protected boolean orientationLeft

view

protected int view

background

protected Color background

foreground

protected Color foreground
Constructor Detail

JCTreeTable.SwitchIcon

public JCTreeTable.SwitchIcon()
Constructor.


JCTreeTable.SwitchIcon

public JCTreeTable.SwitchIcon(boolean orientationLeft,
                              int view)
Constructor that specifies the orientation.

Parameters:
orientationLeft - If true, the orientation is left to right.
view - The view of the icon, either TREE or TABLE.
Method Detail

isOrientationLeft

public boolean isOrientationLeft()
Return whether the orientation is left to right or not.

Returns:
true, if the orientation is left to right, false if the orientation is right to left.

setOrientationLeft

public void setOrientationLeft(boolean orientationLeft)
Parameters:
orientationLeft -

setView

public void setView(int view)
Sets the icon view. Valid values are TREE or TABLE.

Parameters:
view - The new icon view; must be one of TREE or TABLE

getView

public int getView()
Gets the current icon view.

Returns:
The current icon view; will be one of TREE or TABLE

getIconWidth

public int getIconWidth()
Gets the width of the icon.

Specified by:
getIconWidth in interface Icon
Returns:
the current width of the icon

getIconHeight

public int getIconHeight()
Gets the height of the icon.

Specified by:
getIconHeight in interface Icon
Returns:
the current height of the icon

getBackground

public Color getBackground()
Gets the current background color of the icon.

Returns:
the current background color of the icon

setBackground

public void setBackground(Color background)
Sets the new background color of the icon.

Parameters:
background - the new background color of the icon

getForeground

public Color getForeground()
Gets the current foreground color of the icon.

Returns:
the current foreground color of the icon

setForeground

public void setForeground(Color foreground)
Sets the new foreground color of the icon.

Parameters:
foreground - the new foreground color of the icon

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Draws the icon.

Specified by:
paintIcon in interface Icon
Parameters:
c - a component used to aid in drawing icon; currently unused
g - the graphics object used to draw the icon
x - the X position at which to draw the icon
y - the Y position at which to draw the icon

Copyright © 2004 Quest Software Inc..
All rights reserved.