ilog.cpl.table
Class IlpArrowIcon

java.lang.Object
  extended by ilog.cpl.table.IlpArrowIcon
All Implemented Interfaces:
Icon

public class IlpArrowIcon
extends Object
implements Icon

This icon can be used to indicate the sorting direction (ascending or descending) and sorting order.

Since:
JTGO 3.0

Field Summary
static int DEFAULT_SIZE
          The default size of the icon is 15.
static int DOWN
          Creates an icon representing a descending sort.
static int UP
          Creates an icon representing an ascending sort.
 
Constructor Summary
IlpArrowIcon()
          Constructs an IlpArrowIcon with a default aspect: sorting direction: UP sorting order: 1 raised aspect: false pressed aspect: false
IlpArrowIcon(Color edge1, Color edge2, Color fill, int size, int direction, int number)
          Creates an IlpArrowIcon with special parameters.
IlpArrowIcon(int direction, int number, boolean isRaisedView, boolean isPressedView)
          Creates an IlpArrowIcon with regular parameters.
 
Method Summary
protected  void drawDownArrow(Graphics g, int xo, int yo)
          Draws a descending order icon at the specified location.
protected  void drawUpArrow(Graphics g, int xo, int yo)
          Draws an ascending order icon at the specified location.
 Color getBorderColor()
          Returns the up border color.
 Color getBorderColor2()
          Returns the bottom border color.
 int getDirection()
           
 Color getFillColor()
           
 int getIconHeight()
          Returns the height of the icon.
 int getIconWidth()
          Returns the width of the icon.
 String getNumber()
          Returns the sorting order number.
protected  void init(Color edge1, Color edge2, Color fill, int size, int direction)
          Initializes the icon.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draws the icon at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP

public static final int UP
Creates an icon representing an ascending sort.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Creates an icon representing a descending sort.

See Also:
Constant Field Values

DEFAULT_SIZE

public static final int DEFAULT_SIZE
The default size of the icon is 15.

See Also:
Constant Field Values
Constructor Detail

IlpArrowIcon

public IlpArrowIcon()
Constructs an IlpArrowIcon with a default aspect:


IlpArrowIcon

public IlpArrowIcon(int direction,
                    int number,
                    boolean isRaisedView,
                    boolean isPressedView)
Creates an IlpArrowIcon with regular parameters.

Parameters:
direction - Sorting direction, UP or DOWN.
number - Sorting order.
isRaisedView - Displays the icon with a raised aspect.
isPressedView - Displays the icon with a pressed aspect.

IlpArrowIcon

public IlpArrowIcon(Color edge1,
                    Color edge2,
                    Color fill,
                    int size,
                    int direction,
                    int number)
Creates an IlpArrowIcon with special parameters.

Parameters:
edge1 - Top border color.
edge2 - Bottom border color.
fill - Fill color.
size - Size of the icon.
direction - Sorting direction, UP or DOWN.
number - Sorting order.
Method Detail

paintIcon

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

Specified by:
paintIcon in interface Icon
Parameters:
c - Not used.
g - The Graphics the icon is drawn inside.
x - The x location at which to draw the icon.
y - The y location at which to draw the icon.

getIconWidth

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

Specified by:
getIconWidth in interface Icon
Returns:
An integer specifying the fixed width of the icon.

getIconHeight

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

Specified by:
getIconHeight in interface Icon
Returns:
An integer specifying the fixed height of the icon.

getDirection

public int getDirection()
Returns:
Sorting direction, either UP or DOWN
Since:
JViews 7.5

getFillColor

public Color getFillColor()
Returns:
Fill color
Since:
JViews 7.5

getBorderColor

public Color getBorderColor()
Returns the up border color.

Since:
JViews 7.5

getBorderColor2

public Color getBorderColor2()
Returns the bottom border color.

Since:
JViews 7.5

getNumber

public String getNumber()
Returns the sorting order number.

Since:
JViews 7.5

init

protected void init(Color edge1,
                    Color edge2,
                    Color fill,
                    int size,
                    int direction)
Initializes the icon.

Parameters:
edge1 - Top border color.
edge2 - Bottom border color.
fill - Fill color.
size - Size of the icon.
direction - Sorting direction, UP or DOWN.
Internal method or field: do not use!

drawDownArrow

protected void drawDownArrow(Graphics g,
                             int xo,
                             int yo)
Draws a descending order icon at the specified location.

Parameters:
g - The Graphics the icon is drawn inside.
xo - The x location at which to draw the icon.
yo - The y location at which to draw the icon.
Internal method or field: do not use!

drawUpArrow

protected void drawUpArrow(Graphics g,
                           int xo,
                           int yo)
Draws an ascending order icon at the specified location.

Parameters:
g - The Graphics the icon is drawn inside.
xo - The x location at which to draw the icon.
yo - The y location at which to draw the icon.
Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.