com.sun.electric.tool.user
Class Highlight2

java.lang.Object
  extended by com.sun.electric.tool.user.Highlight2
All Implemented Interfaces:
java.lang.Cloneable

public abstract class Highlight2
extends java.lang.Object
implements java.lang.Cloneable

Super class for all types of highlighting.


Field Summary
static java.awt.BasicStroke boldLine
          for drawing dashed lines
protected  Cell cell
          The Cell containing the selection.
static java.awt.BasicStroke dashedLine
          for drawing dashed lines
static java.awt.BasicStroke dottedLine
          for drawing dotted lines
static java.awt.BasicStroke solidLine
          for drawing solid lines
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String describe()
          Describe the Highlight
static void drawLine(java.awt.Graphics g, EditWindow wnd, int x1, int y1, int x2, int y2)
          Implementing clipping here speeds things up a lot if there are many large highlights off-screen
static void drawOutlineFromPoints(EditWindow wnd, java.awt.Graphics g, java.awt.geom.Point2D[] points, int offX, int offY, boolean opened, boolean thickLine)
          Method to draw an array of points as highlighting.
 Cell getCell()
           
 ElectricObject getElectricObject()
          Method to return the ElectricObject associated with this Highlight object.
 Geometric getGeometric()
          Method to return the Geometric object that is in this Highlight.
 java.lang.String getInfo()
           
static NodeInst getInfoCommand(java.util.List<Highlight2> list, int[] counts)
          Method to load an array of counts with the number of highlighted objects in a list.
static Poly getNodeInstOutline(NodeInst ni)
          Gets a poly that describes the Highlight for the NodeInst.
 java.lang.Object getObject()
           
 int getPoint()
           
 Variable.Key getVarKey()
           
 boolean isHighlightEOBJ()
           
 boolean isHighlightText()
           
 boolean nodeMovesWithText()
          Method to tell whether this Highlight is text that stays with its node.
 void setPoint(int p)
           
 void showHighlight(EditWindow wnd, java.awt.Graphics g, int highOffX, int highOffY, boolean onlyHighlight, java.awt.Color mainColor, java.awt.Stroke primaryStroke, boolean setConnected)
          Method to display this Highlight in a window.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

solidLine

public static final java.awt.BasicStroke solidLine
for drawing solid lines


dottedLine

public static final java.awt.BasicStroke dottedLine
for drawing dotted lines


dashedLine

public static final java.awt.BasicStroke dashedLine
for drawing dashed lines


boldLine

public static final java.awt.BasicStroke boldLine
for drawing dashed lines


cell

protected Cell cell
The Cell containing the selection.

Method Detail

getCell

public Cell getCell()

isHighlightEOBJ

public boolean isHighlightEOBJ()

isHighlightText

public boolean isHighlightText()

getObject

public java.lang.Object getObject()

getVarKey

public Variable.Key getVarKey()

setPoint

public void setPoint(int p)

getPoint

public int getPoint()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

nodeMovesWithText

public boolean nodeMovesWithText()
Method to tell whether this Highlight is text that stays with its node. The two possibilities are (1) text on invisible pins (2) export names, when the option to move exports with their labels is requested.

Returns:
true if this Highlight is text that should move with its node.

showHighlight

public void showHighlight(EditWindow wnd,
                          java.awt.Graphics g,
                          int highOffX,
                          int highOffY,
                          boolean onlyHighlight,
                          java.awt.Color mainColor,
                          java.awt.Stroke primaryStroke,
                          boolean setConnected)
Method to display this Highlight in a window.

Parameters:
wnd - the window in which to draw this highlight.
g - the Graphics associated with the window.

getGeometric

public Geometric getGeometric()
Method to return the Geometric object that is in this Highlight. If the highlight is a PortInst, an Export, or annotation text, its base NodeInst is returned.

Returns:
the Geometric object that is in this Highlight. Returns null if this Highlight is not on a Geometric.

getElectricObject

public ElectricObject getElectricObject()
Method to return the ElectricObject associated with this Highlight object.

Returns:
the ElectricObject associated with this Highlight object.

getInfo

public java.lang.String getInfo()

getInfoCommand

public static NodeInst getInfoCommand(java.util.List<Highlight2> list,
                                      int[] counts)
Method to load an array of counts with the number of highlighted objects in a list. arc = 0, node = 1, export = 2, text = 3, graphics = 4

Parameters:
list - the list of highlighted objects.
counts - the array of counts to set.
Returns:
a NodeInst, if it is in the list.

drawOutlineFromPoints

public static void drawOutlineFromPoints(EditWindow wnd,
                                         java.awt.Graphics g,
                                         java.awt.geom.Point2D[] points,
                                         int offX,
                                         int offY,
                                         boolean opened,
                                         boolean thickLine)
Method to draw an array of points as highlighting.

Parameters:
wnd - the window in which drawing is happening.
g - the Graphics for the window.
points - the array of points being drawn.
offX - the X offset of the drawing.
offY - the Y offset of the drawing.
opened - true if the points are drawn "opened".
thickLine -

describe

public java.lang.String describe()
Describe the Highlight

Returns:
a string describing the highlight

getNodeInstOutline

public static Poly getNodeInstOutline(NodeInst ni)
Gets a poly that describes the Highlight for the NodeInst.

Parameters:
ni - the nodeinst to get a poly that will be used to highlight it
Returns:
a poly outlining the nodeInst.

drawLine

public static void drawLine(java.awt.Graphics g,
                            EditWindow wnd,
                            int x1,
                            int y1,
                            int x2,
                            int y2)
Implementing clipping here speeds things up a lot if there are many large highlights off-screen