com.sun.electric.database.geometry
Class EGraphics

java.lang.Object
  extended by com.sun.electric.database.geometry.EGraphics
All Implemented Interfaces:
java.io.Serializable

public class EGraphics
extends java.lang.Object
implements java.io.Serializable

Class to define the appearance of a piece of geometry.

See Also:
Serialized Form

Nested Class Summary
static class EGraphics.J3DTransparencyOption
           
static class EGraphics.Outline
          Class to define the type of outline around a stipple pattern.
 
Field Summary
static int BLACK
          Describes the color black.
static int BLUE
          Describes the color blue.
static int BROWN
          Describes the color brown.
static int CELLOUT
          Describes the cell outline.
static int CELLTXT
          Describes the cell and port names.
static int CURSOR
          Describes the cursor color.
static int CYAN
          Describes the color cyan.
static int DBLUE
          Describes the color dark blue.
static double DEFAULT_FACTOR
           
static EGraphics.J3DTransparencyOption DEFAULT_MODE
           
static int DGRAY
          Describes the color dark gray.
static int DGREEN
          Describes the color dark green.
static int DRED
          Describes the color dark red.
static int FULLRGBBIT
          Describes the full RGB escape bit.
static int GRAY
          Describes the color gray.
static int GREEN
          Describes the color green.
static int HMENBOR
          Describes the highlighted menu border color.
static int HWINBOR
          Describes the highlighted window border color.
static int LAYERT1
          Describes transparent layer 1.
static int LAYERT10
          Describes transparent layer 10.
static int LAYERT11
          Describes transparent layer 11.
static int LAYERT12
          Describes transparent layer 12.
static int LAYERT2
          Describes transparent layer 2.
static int LAYERT3
          Describes transparent layer 3.
static int LAYERT4
          Describes transparent layer 4.
static int LAYERT5
          Describes transparent layer 5.
static int LAYERT6
          Describes transparent layer 6.
static int LAYERT7
          Describes transparent layer 7.
static int LAYERT8
          Describes transparent layer 8.
static int LAYERT9
          Describes transparent layer 9.
static int LBLUE
          Describes the color light blue.
static int LGRAY
          Describes the color light gray.
static int LGREEN
          Describes the color light green.
static int LRED
          Describes the color light red.
static int MAGENTA
          Describes the color magenta.
static int MENBOR
          Describes the menu border color.
static int MENGLY
          Describes the menu glyph color.
static int MENTXT
          Describes the menu text color.
static int OPAQUEBIT
          Describes opaque color escape bit.
static int ORANGE
          Describes the color orange.
static int PURPLE
          Describes the color purple.
static int RED
          Describes the color red.
static int TRANSPARENT_1
          defines the 1st transparent layer.
static int TRANSPARENT_10
          defines the 10th transparent layer.
static int TRANSPARENT_11
          defines the 11th transparent layer.
static int TRANSPARENT_12
          defines the 12th transparent layer.
static int TRANSPARENT_2
          defines the 2nd transparent layer.
static int TRANSPARENT_3
          defines the 3rd transparent layer.
static int TRANSPARENT_4
          defines the 4th transparent layer.
static int TRANSPARENT_5
          defines the 5th transparent layer.
static int TRANSPARENT_6
          defines the 6th transparent layer.
static int TRANSPARENT_7
          defines the 7th transparent layer.
static int TRANSPARENT_8
          defines the 8th transparent layer.
static int TRANSPARENT_9
          defines the 9th transparent layer.
static int WHITE
          Describes the color white.
static int WINBOR
          Describes the window border color.
static int YELLOW
          Describes the color yellow.
 
Constructor Summary
EGraphics(boolean displayPatterned, boolean printPatterned, EGraphics.Outline outlineWhenPatterned, int transparentLayer, int red, int green, int blue, double opacity, boolean foreground, int[] pattern)
          Method to create a graphics object.
EGraphics(boolean displayPatterned, boolean printPatterned, EGraphics.Outline outlineWhenPatterned, int transparentLayer, int red, int green, int blue, double opacity, boolean foreground, int[] pattern, EGraphics.J3DTransparencyOption transparencyMode, double transparencyFactor)
          Method to create a graphics object.
 
Method Summary
 boolean equals(java.lang.Object o)
           
static int findColorIndex(java.lang.String name)
          Method to find the index of a color, given its name.
 java.awt.Color getAlphaColor()
          Method to return the color associated with this EGraphics.
 java.awt.Color getColor()
          Method to return the color associated with this EGraphics.
 java.awt.Color getColor(java.awt.Color[] transparentColors)
          Method to return the color associated with this EGraphics considering Colors of transparentLayers.
static java.awt.Color getColorFromIndex(int colorIndex)
          Method to convert a color index into a Color.
static java.lang.String getColorIndexName(int colorIndex)
          Method to tell the name of the color with a given index.
static int[] getColorIndices()
          Method to return the array of color indices.
 boolean getForeground()
          Method to get whether this EGraphics should be drawn in the foreground.
 double getOpacity()
          Method to get the opacity of this EGraphics.
 EGraphics.Outline getOutlined()
          Method to tell the type of outline pattern.
 int[] getPattern()
          Method to get the stipple pattern of this EGraphics.
 java.lang.String getPatternString()
          Method to get the String representation of the stipple pattern of this EGraphics.
 int[] getReversedPattern()
          Method to get the reversed stipple pattern of this EGraphics.
 int getRGB()
          Returns the RGB value representing the color associated with this EGraphics.
 double getTransparencyFactor()
          Method to return the transparency factor of this EGraphics.
 EGraphics.J3DTransparencyOption getTransparencyMode()
          Method to return the transparency mode of this EGraphics for the 3D View.
static int[] getTransparentColorIndices()
          Method to return the array of transparent color indices.
 int getTransparentLayer()
          Method to return the transparent layer number associated with this EGraphics.
 int hashCode()
           
 boolean isPatternedOnDisplay()
          Method describes how this EGraphics appears on a display.
 boolean isPatternedOnPrinter()
          Method describes how this EGraphics appears on a printer.
static int makeIndex(java.awt.Color color)
          Method to convert a Color to a color index.
static int makeIndex(int transparentLayer)
          Method to convert a transparent layer to a color index.
 EGraphics withColor(java.awt.Color color)
          Method returns EGraphics which differs from this EGraphics by to the associated color.
 EGraphics withColorIndex(int colorIndex)
          Method returns EGraphics which differs from this EGraphics by a "color index".
 EGraphics withForeground(boolean f)
          Method returns EGraphics which differs from this EGraphics that it should be drawn in the foreground.
 EGraphics withOpacity(double opacity)
          Method returns EGraphics which differs from this EGraphics by opacity.
 EGraphics withOutlined(EGraphics.Outline o)
          Method returns EGraphics which differs from this EGraphics by Outline pattern When the EGraphics is drawn as a pattern, the outline can be defined more clearly by drawing a line around the edge.
 EGraphics withPattern(int[] pattern)
          Method returns EGraphics which differs from this EGraphics by stipple pattern.
 EGraphics withPattern(java.lang.String patternStr)
          Method returns EGraphics which differs from this EGraphics by stipple pattern.
 EGraphics withPatternedOnDisplay(boolean p)
          Method returns EGraphics which differs from this EGraphics by appearance on a display.
 EGraphics withPatternedOnPrinter(boolean p)
          Method returns EGraphics which differs from this EGraphics by appearance on a printer.
 EGraphics withTransparencyFactor(double factor)
          Method returns EGraphics which differs from this EGraphics by transparency factor.
 EGraphics withTransparencyMode(EGraphics.J3DTransparencyOption mode)
          Method returns EGraphics which differs form this EGraphics by transparency mode.
 EGraphics withTransparentLayer(int transparentLayer)
          Method returns EGraphics which differs from this EGraphics by transparent Layer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODE

public static final EGraphics.J3DTransparencyOption DEFAULT_MODE

DEFAULT_FACTOR

public static final double DEFAULT_FACTOR
See Also:
Constant Field Values

FULLRGBBIT

public static final int FULLRGBBIT
Describes the full RGB escape bit.

See Also:
Constant Field Values

OPAQUEBIT

public static final int OPAQUEBIT
Describes opaque color escape bit.

See Also:
Constant Field Values

WHITE

public static final int WHITE
Describes the color white.

See Also:
Constant Field Values

BLACK

public static final int BLACK
Describes the color black.

See Also:
Constant Field Values

RED

public static final int RED
Describes the color red.

See Also:
Constant Field Values

BLUE

public static final int BLUE
Describes the color blue.

See Also:
Constant Field Values

GREEN

public static final int GREEN
Describes the color green.

See Also:
Constant Field Values

CYAN

public static final int CYAN
Describes the color cyan.

See Also:
Constant Field Values

MAGENTA

public static final int MAGENTA
Describes the color magenta.

See Also:
Constant Field Values

YELLOW

public static final int YELLOW
Describes the color yellow.

See Also:
Constant Field Values

CELLTXT

public static final int CELLTXT
Describes the cell and port names.

See Also:
Constant Field Values

CELLOUT

public static final int CELLOUT
Describes the cell outline.

See Also:
Constant Field Values

WINBOR

public static final int WINBOR
Describes the window border color.

See Also:
Constant Field Values

HWINBOR

public static final int HWINBOR
Describes the highlighted window border color.

See Also:
Constant Field Values

MENBOR

public static final int MENBOR
Describes the menu border color.

See Also:
Constant Field Values

HMENBOR

public static final int HMENBOR
Describes the highlighted menu border color.

See Also:
Constant Field Values

MENTXT

public static final int MENTXT
Describes the menu text color.

See Also:
Constant Field Values

MENGLY

public static final int MENGLY
Describes the menu glyph color.

See Also:
Constant Field Values

CURSOR

public static final int CURSOR
Describes the cursor color.

See Also:
Constant Field Values

GRAY

public static final int GRAY
Describes the color gray.

See Also:
Constant Field Values

ORANGE

public static final int ORANGE
Describes the color orange.

See Also:
Constant Field Values

PURPLE

public static final int PURPLE
Describes the color purple.

See Also:
Constant Field Values

BROWN

public static final int BROWN
Describes the color brown.

See Also:
Constant Field Values

LGRAY

public static final int LGRAY
Describes the color light gray.

See Also:
Constant Field Values

DGRAY

public static final int DGRAY
Describes the color dark gray.

See Also:
Constant Field Values

LRED

public static final int LRED
Describes the color light red.

See Also:
Constant Field Values

DRED

public static final int DRED
Describes the color dark red.

See Also:
Constant Field Values

LGREEN

public static final int LGREEN
Describes the color light green.

See Also:
Constant Field Values

DGREEN

public static final int DGREEN
Describes the color dark green.

See Also:
Constant Field Values

LBLUE

public static final int LBLUE
Describes the color light blue.

See Also:
Constant Field Values

DBLUE

public static final int DBLUE
Describes the color dark blue.

See Also:
Constant Field Values

LAYERT1

public static final int LAYERT1
Describes transparent layer 1.

See Also:
Constant Field Values

LAYERT2

public static final int LAYERT2
Describes transparent layer 2.

See Also:
Constant Field Values

LAYERT3

public static final int LAYERT3
Describes transparent layer 3.

See Also:
Constant Field Values

LAYERT4

public static final int LAYERT4
Describes transparent layer 4.

See Also:
Constant Field Values

LAYERT5

public static final int LAYERT5
Describes transparent layer 5.

See Also:
Constant Field Values

LAYERT6

public static final int LAYERT6
Describes transparent layer 6.

See Also:
Constant Field Values

LAYERT7

public static final int LAYERT7
Describes transparent layer 7.

See Also:
Constant Field Values

LAYERT8

public static final int LAYERT8
Describes transparent layer 8.

See Also:
Constant Field Values

LAYERT9

public static final int LAYERT9
Describes transparent layer 9.

See Also:
Constant Field Values

LAYERT10

public static final int LAYERT10
Describes transparent layer 10.

See Also:
Constant Field Values

LAYERT11

public static final int LAYERT11
Describes transparent layer 11.

See Also:
Constant Field Values

LAYERT12

public static final int LAYERT12
Describes transparent layer 12.

See Also:
Constant Field Values

TRANSPARENT_1

public static final int TRANSPARENT_1
defines the 1st transparent layer.

See Also:
Constant Field Values

TRANSPARENT_2

public static final int TRANSPARENT_2
defines the 2nd transparent layer.

See Also:
Constant Field Values

TRANSPARENT_3

public static final int TRANSPARENT_3
defines the 3rd transparent layer.

See Also:
Constant Field Values

TRANSPARENT_4

public static final int TRANSPARENT_4
defines the 4th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_5

public static final int TRANSPARENT_5
defines the 5th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_6

public static final int TRANSPARENT_6
defines the 6th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_7

public static final int TRANSPARENT_7
defines the 7th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_8

public static final int TRANSPARENT_8
defines the 8th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_9

public static final int TRANSPARENT_9
defines the 9th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_10

public static final int TRANSPARENT_10
defines the 10th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_11

public static final int TRANSPARENT_11
defines the 11th transparent layer.

See Also:
Constant Field Values

TRANSPARENT_12

public static final int TRANSPARENT_12
defines the 12th transparent layer.

See Also:
Constant Field Values
Constructor Detail

EGraphics

public EGraphics(boolean displayPatterned,
                 boolean printPatterned,
                 EGraphics.Outline outlineWhenPatterned,
                 int transparentLayer,
                 int red,
                 int green,
                 int blue,
                 double opacity,
                 boolean foreground,
                 int[] pattern)
Method to create a graphics object.

Parameters:
displayPatterned - true if drawn with a pattern on the display.
printPatterned - true if drawn with a pattern on a printer.
outlineWhenPatterned - the outline texture to use when patterned.
transparentLayer - the transparent layer number (0 for none).
red - the red component of this EGraphics.
green - the green component of this EGraphics.
blue - the blue component of this EGraphics.
opacity - the opacity of this EGraphics (1 for opaque, 0 for transparent).
foreground - the foreground factor of this EGraphics (1 for to be in foreground).
pattern - the 16x16 stipple pattern of this EGraphics (16 integers).

EGraphics

public EGraphics(boolean displayPatterned,
                 boolean printPatterned,
                 EGraphics.Outline outlineWhenPatterned,
                 int transparentLayer,
                 int red,
                 int green,
                 int blue,
                 double opacity,
                 boolean foreground,
                 int[] pattern,
                 EGraphics.J3DTransparencyOption transparencyMode,
                 double transparencyFactor)
Method to create a graphics object.

Parameters:
displayPatterned - true if drawn with a pattern on the display.
printPatterned - true if drawn with a pattern on a printer.
outlineWhenPatterned - the outline texture to use when patterned.
transparentLayer - the transparent layer number (0 for none).
red - the red component of this EGraphics.
green - the green component of this EGraphics.
blue - the blue component of this EGraphics.
opacity - the opacity of this EGraphics (1 for opaque, 0 for transparent).
foreground - the foreground factor of this EGraphics (1 for to be in foreground).
pattern - the 16x16 stipple pattern of this EGraphics (16 integers).
transparencyMode - 3D transparency mode
transparencyFactor - 3D transparency factor
Method Detail

isPatternedOnDisplay

public boolean isPatternedOnDisplay()
Method describes how this EGraphics appears on a display. This EGraphics can be drawn as a solid fill or as a pattern.

Returns:
true to draw this EGraphics patterned on a display. False to draw this EGraphics as a solid fill on a display.

withPatternedOnDisplay

public EGraphics withPatternedOnDisplay(boolean p)
Method returns EGraphics which differs from this EGraphics by appearance on a display. This EGraphics can be drawn as a solid fill or as a pattern.

Parameters:
p - true to draw this EGraphics patterned on a display. False to draw this EGraphics as a solid fill on a display.
Returns:
EGraphics with specified appearance on a display

isPatternedOnPrinter

public boolean isPatternedOnPrinter()
Method describes how this EGraphics appears on a printer. This EGraphics can be drawn as a solid fill or as a pattern.

Returns:
true to draw this EGraphics patterned on a printer. False to draw this EGraphics as a solid fill on a printer.

withPatternedOnPrinter

public EGraphics withPatternedOnPrinter(boolean p)
Method returns EGraphics which differs from this EGraphics by appearance on a printer. This EGraphics can be drawn as a solid fill or as a pattern.

Parameters:
p - true to draw this EGraphics patterned on a printer. False to draw this EGraphics as a solid fill on a printer.
Returns:
EGraphics with specified appearance on a printer.

getOutlined

public EGraphics.Outline getOutlined()
Method to tell the type of outline pattern. When the EGraphics is drawn as a pattern, the outline can be defined more clearly by drawing a line around the edge.

Returns:
the type of outline pattern.

withOutlined

public EGraphics withOutlined(EGraphics.Outline o)
Method returns EGraphics which differs from this EGraphics by Outline pattern When the EGraphics is drawn as a pattern, the outline can be defined more clearly by drawing a line around the edge.

Parameters:
o - the outline pattern.
Returns:
EGraphics with specifed outline pattern

getTransparentLayer

public int getTransparentLayer()
Method to return the transparent layer number associated with this EGraphics.

Returns:
the transparent layer number associated with this EGraphics. A value of zero means that this EGraphics is not drawn transparently. Instead, use the "getColor()" method to get its solid color.

withTransparentLayer

public EGraphics withTransparentLayer(int transparentLayer)
Method returns EGraphics which differs from this EGraphics by transparent Layer.

Parameters:
transparentLayer - the transparent layer number associated with this EGraphics. A value of zero means that this EGraphics is not drawn transparently. Then, use the "setColor()" method to set its solid color.
Returns:
EGraphcos with specifed transparentLayer

getPattern

public int[] getPattern()
Method to get the stipple pattern of this EGraphics. The stipple pattern is a 16 x 16 pattern that is stored in 16 integers.

Returns:
the stipple pattern of this EGraphics.

getReversedPattern

public int[] getReversedPattern()
Method to get the reversed stipple pattern of this EGraphics. The reversed stipple pattern is a 16 x 32 pattern that is stored in 16 integers.

Returns:
the stipple pattern of this EGraphics.

getPatternString

public java.lang.String getPatternString()
Method to get the String representation of the stipple pattern of this EGraphics.

Returns:
the String representation the stipple pattern of this EGraphics.

withPattern

public EGraphics withPattern(int[] pattern)
Method returns EGraphics which differs from this EGraphics by stipple pattern. The stipple pattern is a 16 x 16 pattern that is stored in 16 integers.

Parameters:
pattern - the stipple pattern of this EGraphics.
Returns:
EGraphics with specified stipple pattern.

withPattern

public EGraphics withPattern(java.lang.String patternStr)
Method returns EGraphics which differs from this EGraphics by stipple pattern. The stipple pattern is a 16 x 16 pattern that is stored in 16 integers.

Parameters:
patternStr - text representation of the stipple pattern of this EGraphics.
Returns:
EGraphics with specified stipple pattern.

getOpacity

public double getOpacity()
Method to get the opacity of this EGraphics. Opacity runs from 0 (transparent) to 1 (opaque).

Returns:
the opacity of this EGraphics.

withOpacity

public EGraphics withOpacity(double opacity)
Method returns EGraphics which differs from this EGraphics by opacity. Opacity runs from 0 (transparent) to 1 (opaque).

Parameters:
opacity - the opacity of this EGraphics.
Returns:
EGraphics with specified opacity.

getForeground

public boolean getForeground()
Method to get whether this EGraphics should be drawn in the foreground. The foreground is the main "mix" of layers, such as metals and polysilicons. The background is typically used by implant and well layers.

Returns:
the whether this EGraphics should be drawn in the foreground.

withForeground

public EGraphics withForeground(boolean f)
Method returns EGraphics which differs from this EGraphics that it should be drawn in the foreground. The foreground is the main "mix" of layers, such as metals and polysilicons. The background is typically used by implant and well layers.

Parameters:
f - true if this EGraphics should be drawn in the foreground.
Returns:
EGraphics with specified foreground

getAlphaColor

public java.awt.Color getAlphaColor()
Method to return the color associated with this EGraphics. Alpha component is determined by opacity

Returns:
the color associated with this EGraphics.

getColor

public java.awt.Color getColor()
Method to return the color associated with this EGraphics. Alpha comonent is 255.

Returns:
the color associated with this EGraphics.

getColor

public java.awt.Color getColor(java.awt.Color[] transparentColors)
Method to return the color associated with this EGraphics considering Colors of transparentLayers.

Parameters:
transparentColors - Colors of transparentLayers.
Returns:
the color associated with this EGraphics.

getRGB

public int getRGB()
Returns the RGB value representing the color associated with this EGraphics. (Bits 16-23 are red, 8-15 are green, 0-7 are blue). Alpha/opacity component is 0

Returns:
the RGB value of the color

withColor

public EGraphics withColor(java.awt.Color color)
Method returns EGraphics which differs from this EGraphics by to the associated color. The alpha component of the color is set to full opacity, alpha component of the argument is igniored.

Parameters:
color - the color to set.
Returns:
EGraphics with specified color.

getColorFromIndex

public static java.awt.Color getColorFromIndex(int colorIndex)
Method to convert a color index into a Color. Color indices are more general than colors, because they can handle transparent layers, C-Electric-style opaque layers, and full color values.

Parameters:
colorIndex - the color index to convert.
Returns:
a Color that describes the index Returns null if the index is a transparent layer.

withColorIndex

public EGraphics withColorIndex(int colorIndex)
Method returns EGraphics which differs from this EGraphics by a "color index". Color indices are more general than colors, because they can handle transparent layers, C-Electric-style opaque layers, and full color values. Artwork nodes and arcs represent individualized color by using color indices.

Parameters:
colorIndex - the color index to set.

makeIndex

public static int makeIndex(java.awt.Color color)
Method to convert a Color to a color index. Color indices are more general than colors, because they can handle transparent layers, C-Electric-style opaque layers, and full color values. Artwork nodes and arcs represent individualized color by using color indices.

Parameters:
color - a Color object
Returns:
the color index that describes that color.

makeIndex

public static int makeIndex(int transparentLayer)
Method to convert a transparent layer to a color index. Color indices are more general than colors, because they can handle transparent layers, C-Electric-style opaque layers, and full color values.

Parameters:
transparentLayer - the transparent layer number.
Returns:
the color index that describes that transparent layer.

findColorIndex

public static int findColorIndex(java.lang.String name)
Method to find the index of a color, given its name.

Parameters:
name - the name of the color.
Returns:
the index of the color.

getColorIndexName

public static java.lang.String getColorIndexName(int colorIndex)
Method to tell the name of the color with a given index. Color indices are more general than colors, because they can handle transparent layers, C-Electric-style opaque layers, and full color values.

Parameters:
colorIndex - the color number.
Returns:
the name of that color.

getColorIndices

public static int[] getColorIndices()
Method to return the array of color indices.

Returns:
an array of the possible color indices.

getTransparentColorIndices

public static int[] getTransparentColorIndices()
Method to return the array of transparent color indices.

Returns:
an array of the possible transparent color indices.

getTransparencyMode

public EGraphics.J3DTransparencyOption getTransparencyMode()
Method to return the transparency mode of this EGraphics for the 3D View. Possible values "NONE, "FASTEST", "NICEST", "BLENDED", "SCREEN_DOOR".

Returns:
the transparency mode of this layer for the 3D view.

withTransparencyMode

public EGraphics withTransparencyMode(EGraphics.J3DTransparencyOption mode)
Method returns EGraphics which differs form this EGraphics by transparency mode. Possible values "NONE, "FASTEST", "NICEST", "BLENDED", "SCREEN_DOOR".

Parameters:
mode - the transparency mode of this layer.

getTransparencyFactor

public double getTransparencyFactor()
Method to return the transparency factor of this EGraphics. Possible values from 0 (opaque) -> 1 (transparent)

Returns:
the transparency factor of this layer for the 3D view.

withTransparencyFactor

public EGraphics withTransparencyFactor(double factor)
Method returns EGraphics which differs from this EGraphics by transparency factor. Layers can have a transparency from 0 (opaque) to 1(transparent).

Parameters:
factor - the transparency factor of this layer.
Returns:
EGraphics with specified transparecy factor.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object