SORTIE Java Interface  1
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
sortie.gui.components.ModelIcon Class Reference

Creates different icons needed by the model. More...

Inheritance diagram for sortie.gui.components.ModelIcon:

Public Member Functions

 ModelIcon (int iWidth, int iHeight, int iShape)
 Creates an icon. More...
 
 ModelIcon (int iWidth, int iHeight, int iShape, Color oColor)
 Creates an icon. More...
 
int getIconHeight ()
 Gets the height of the icon, in pixels. More...
 
int getIconWidth ()
 Gets the width of the icon, in pixels. More...
 
void paintIcon (Component c, Graphics g, int x, int y)
 Create the icon. More...
 

Static Public Attributes

static final int RECTANGLE = 1
 Icon is a rectangle. More...
 
static final int UP_TRIANGLE = 2
 Icon is a triangle pointing up. More...
 
static final int DOWN_TRIANGLE = 3
 Icon is a triangle pointing down. More...
 
static final int LEFT_TRIANGLE = 4
 Icon is a triangle pointing left. More...
 
static final int RIGHT_TRIANGLE = 5
 Icon is a triangle pointing right. More...
 
static final int PAUSE = 6
 Icon is a pause symbol - two rectangles next to each other. More...
 
static final int STEP_FORWARD = 7
 Icon is a step forward symbol - two triangles next to each other pointing forward. More...
 
static final int STEP_BACKWARD = 8
 Icon is a step back symbol - two triangles next to each other pointing backwards. More...
 

Private Member Functions

void paintRectangle (Graphics g, int x, int y)
 Paints a rectangle. More...
 
void paintUpTriangle (Graphics g, int x, int y)
 Creates a triangle with the point up. More...
 
void paintDownTriangle (Graphics g, int x, int y)
 Creates a triangle with the point down. More...
 
void paintLeftTriangle (Graphics g, int x, int y)
 Creates a triangle with the point to the left. More...
 
void paintRightTriangle (Graphics g, int x, int y)
 Creates a triangle with the point to the right. More...
 
void paintPause (Graphics g, int x, int y)
 Create a "pause" icon with two rectangles. More...
 
void paintStepForward (Graphics g, int x, int y)
 Creates a "step forward" icon with two triangles pointing right. More...
 
void paintStepBackward (Graphics g, int x, int y)
 Creates a "step backward" icon with two triangles pointing left. More...
 

Private Attributes

Color m_oColor
 Icon's color. More...
 
int m_iWidth
 Icon's width, in pixels. More...
 
int m_iHeight
 Icon's height, in pixels. More...
 
int m_iShape
 Icon's shape. More...
 

Detailed Description

Creates different icons needed by the model.

Feel free to throw some more in here as needed. I originally created this class because Java doesn't seem to let me set button colors anymore, so now I slap on a colored icon instead.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0

Constructor & Destructor Documentation

◆ ModelIcon() [1/2]

sortie.gui.components.ModelIcon.ModelIcon ( int  iWidth,
int  iHeight,
int  iShape 
)

Creates an icon.

Parameters
iWidthint Width of the icon, in pixels.
iHeightint Height of the icon, in pixels.
iShapeint Desired icon shape - RECTANGLE, TRIANGLE, etc. If the value is not recognized a rectangle is drawn.

◆ ModelIcon() [2/2]

sortie.gui.components.ModelIcon.ModelIcon ( int  iWidth,
int  iHeight,
int  iShape,
Color  oColor 
)

Creates an icon.

Parameters
iWidthint Width of the icon, in pixels.
iHeightint Height of the icon, in pixels.
iShapeint Desired icon shape - RECTANGLE, TRIANGLE, etc. If the value is not recognized a rectangle is drawn.
oColorColor of icon.

Member Function Documentation

◆ getIconHeight()

int sortie.gui.components.ModelIcon.getIconHeight ( )

Gets the height of the icon, in pixels.

Returns
int Height of the icon in pixels.

◆ getIconWidth()

int sortie.gui.components.ModelIcon.getIconWidth ( )

Gets the width of the icon, in pixels.

Returns
int Width of the icon in pixels.

◆ paintDownTriangle()

void sortie.gui.components.ModelIcon.paintDownTriangle ( Graphics  g,
int  x,
int  y 
)
private

Creates a triangle with the point down.

Parameters
gGraphics Graphics object.
xint X coordinate of the upper left corner of the triangle.
yint Y coordinate of the upper left corner of the triangle.

◆ paintIcon()

void sortie.gui.components.ModelIcon.paintIcon ( Component  c,
Graphics  g,
int  x,
int  y 
)

Create the icon.

Parameters
cComponent Component.
gGraphics Graphics.
xint X coordinte to paint at.
yint Y coordinate to paint at.

◆ paintLeftTriangle()

void sortie.gui.components.ModelIcon.paintLeftTriangle ( Graphics  g,
int  x,
int  y 
)
private

Creates a triangle with the point to the left.

Parameters
gGraphics Graphics object.
xint X coordinate of the triangle.
yint Y coordinate of the triangle.

◆ paintPause()

void sortie.gui.components.ModelIcon.paintPause ( Graphics  g,
int  x,
int  y 
)
private

Create a "pause" icon with two rectangles.

Parameters
gGraphics Graphics object.
xint X coordinate of pause icon.
yint Y coordinate of pause icon.

◆ paintRectangle()

void sortie.gui.components.ModelIcon.paintRectangle ( Graphics  g,
int  x,
int  y 
)
private

Paints a rectangle.

Parameters
gGraphics Graphics object for painting.
xint X coordinate to start painting at.
yint Y coordinate to start painting at.

◆ paintRightTriangle()

void sortie.gui.components.ModelIcon.paintRightTriangle ( Graphics  g,
int  x,
int  y 
)
private

Creates a triangle with the point to the right.

Parameters
gGraphics Graphics object.
xint X coordinate of the triangle.
yint Y coordinate of the triangle.

◆ paintStepBackward()

void sortie.gui.components.ModelIcon.paintStepBackward ( Graphics  g,
int  x,
int  y 
)
private

Creates a "step backward" icon with two triangles pointing left.

Parameters
gGraphics Graphics object.
xint X coordinate of icon.
yint Y coordinate of icon.

◆ paintStepForward()

void sortie.gui.components.ModelIcon.paintStepForward ( Graphics  g,
int  x,
int  y 
)
private

Creates a "step forward" icon with two triangles pointing right.

Parameters
gGraphics Graphics object.
xint X coordinate of the icon.
yint Y coordinate of the icon.

◆ paintUpTriangle()

void sortie.gui.components.ModelIcon.paintUpTriangle ( Graphics  g,
int  x,
int  y 
)
private

Creates a triangle with the point up.

Parameters
gGraphics Graphics object.
xint X coordinate of the left corner of the triangle.
yint Y coordinate of the top corner of the triangle.

Member Data Documentation

◆ DOWN_TRIANGLE

final int sortie.gui.components.ModelIcon.DOWN_TRIANGLE = 3
static

Icon is a triangle pointing down.

◆ LEFT_TRIANGLE

final int sortie.gui.components.ModelIcon.LEFT_TRIANGLE = 4
static

Icon is a triangle pointing left.

◆ m_iHeight

int sortie.gui.components.ModelIcon.m_iHeight
private

Icon's height, in pixels.

◆ m_iShape

int sortie.gui.components.ModelIcon.m_iShape
private

Icon's shape.

◆ m_iWidth

int sortie.gui.components.ModelIcon.m_iWidth
private

Icon's width, in pixels.

◆ m_oColor

Color sortie.gui.components.ModelIcon.m_oColor
private

Icon's color.

Defaults to black.

◆ PAUSE

final int sortie.gui.components.ModelIcon.PAUSE = 6
static

Icon is a pause symbol - two rectangles next to each other.

◆ RECTANGLE

final int sortie.gui.components.ModelIcon.RECTANGLE = 1
static

Icon is a rectangle.

◆ RIGHT_TRIANGLE

final int sortie.gui.components.ModelIcon.RIGHT_TRIANGLE = 5
static

Icon is a triangle pointing right.

◆ STEP_BACKWARD

final int sortie.gui.components.ModelIcon.STEP_BACKWARD = 8
static

Icon is a step back symbol - two triangles next to each other pointing backwards.

◆ STEP_FORWARD

final int sortie.gui.components.ModelIcon.STEP_FORWARD = 7
static

Icon is a step forward symbol - two triangles next to each other pointing forward.

◆ UP_TRIANGLE

final int sortie.gui.components.ModelIcon.UP_TRIANGLE = 2
static

Icon is a triangle pointing up.


The documentation for this class was generated from the following file: