|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.user.Highlighter
public class Highlighter
Class for per-window highlighting information.
Field Summary | |
---|---|
static int |
EXACTSELECTDISTANCE
the max pixel distance that's acceptable selection |
static int |
MOUSEOVER_HIGHLIGHTER
the mouse over highlighter type |
static int |
RULER_HIGHLIGHTER
the "measurement" highlighter type |
static int |
SELECT_HIGHLIGHTER
the selection highlighter type |
Constructor Summary | |
---|---|
Highlighter(int type,
WindowFrame wf)
Create a new Highlighter object |
Method Summary | |
---|---|
Highlight2 |
addArea(java.awt.geom.Rectangle2D area,
Cell cell)
Method to add an area to the list of highlighted objects. |
Highlight2 |
addElectricObject(ElectricObject eobj,
Cell cell)
Method to add an ElectricObject to the list of highlighted objects. |
Highlight2 |
addElectricObject(ElectricObject eobj,
Cell cell,
boolean highlightConnected)
Method to add an ElectricObject to the list of highlighted objects. |
Highlight2 |
addElectricObject(ElectricObject eobj,
Cell cell,
boolean highlightConnected,
java.awt.Color col)
Method to add an ElectricObject to the list of highlighted objects. |
Highlight2 |
addElectricObject(ElectricObject eobj,
Cell cell,
java.awt.Color col)
Method to add an ElectricObject to the list of highlighted objects. |
void |
addHighlight(Highlight2 h)
Add a Highlight |
static void |
addHighlightListener(HighlightListener l)
Add a Highlight listener |
Highlight2 |
addLine(java.awt.geom.Point2D start,
java.awt.geom.Point2D end,
Cell cell)
Method to add a line to the list of highlighted objects. |
Highlight2 |
addLine(java.awt.geom.Point2D start,
java.awt.geom.Point2D end,
Cell cell,
boolean thick)
Method to add a line to the list of highlighted objects. |
Highlight2 |
addMessage(Cell cell,
java.lang.String message,
java.awt.geom.Point2D loc)
Method to add a message display to the list of highlighted objects. |
void |
addNetwork(Network net,
Cell cell)
Method to add a network to the list of highlighted objects. |
Highlight2 |
addObject(java.lang.Object obj,
Cell cell)
Method to generic Object. |
Highlight2 |
addPoly(Poly poly,
Cell cell,
java.awt.Color color)
Method to add a Poly to the list of highlighted objects |
Highlight2 |
addText(ElectricObject eobj,
Cell cell,
Variable.Key varKey)
Method to add a text selection to the list of highlighted objects. |
Highlight2 |
addThickLine(java.awt.geom.Point2D start,
java.awt.geom.Point2D end,
Cell cell)
Method to add a line to the list of highlighted objects. |
static Highlight2 |
checkOutObject(Geometric geom,
boolean findPort,
boolean findPoint,
boolean findSpecial,
java.awt.geom.Rectangle2D bounds,
EditWindow wnd,
double directHitDist,
boolean areaMustEnclose)
Method to determine whether an object is in a bounds. |
void |
clear()
Method to clear the list of all highlighted objects in |
void |
copyState(Highlighter highlighter)
Inherits the last selected object from the specified highlighter. |
void |
databaseChanged(DatabaseChangeEvent e)
Invoked in the java AWT Event thread when the database state changes. |
void |
delete()
Destructor |
static java.awt.geom.Point2D[] |
describeHighlightText(EditWindow wnd,
ElectricObject eObj,
Variable.Key varKey)
Method to describe an object/variable-key pair as a set of points to draw. |
static double |
distToArc(java.awt.geom.Rectangle2D bounds,
ArcInst ai,
EditWindow wnd)
Method to return the distance from a bounds to an ArcInst. |
static double |
distToNode(java.awt.geom.Rectangle2D bounds,
NodeInst ni,
EditWindow wnd)
Method to return the distance from a bound to a NodeInst. |
void |
ensureHighlightingSeen()
Method to ensure that the highlighting is visible. |
static java.util.List<Highlight2> |
findAllInArea(Highlighter highlighter,
Cell cell,
boolean exclusively,
boolean another,
boolean findPort,
boolean findPoint,
boolean findSpecial,
boolean findText,
java.awt.geom.Rectangle2D bounds,
EditWindow wnd)
Method to search a Cell for all objects at a point. |
Highlight2 |
findObject(java.awt.geom.Point2D pt,
EditWindow wnd,
boolean exclusively,
boolean another,
boolean invert,
boolean findPort,
boolean findPoint,
boolean findSpecial,
boolean findText)
Method to handle a click in a window and select the appropriate objects. |
void |
finished()
Method to indicate that changes to highlighting are finished. |
void |
gainedFocus()
Called when the Highlighter owner has gained focus, and the current highlighter switches to this. |
java.util.List<ArcInst> |
getHighlightedArcs()
Method to return a List of all highlighted ArcInsts. |
java.awt.geom.Rectangle2D |
getHighlightedArea(EditWindow wnd)
Method to return the bounds of the highlighted objects. |
java.util.List<Geometric> |
getHighlightedEObjs(boolean wantNodes,
boolean wantArcs)
Method to return a List of all highlighted Geometrics. |
java.util.Set<Network> |
getHighlightedNetworks()
Method to return a set of the currently selected networks. |
java.util.List<NodeInst> |
getHighlightedNodes()
Method to return a List of all highlighted NodeInsts. |
java.util.List<DisplayedText> |
getHighlightedText(boolean unique)
Method to return a List of all highlighted text. |
java.awt.geom.Point2D |
getHighlightOffset()
Method to return the screen offset for the display of highlighting |
java.util.List<Highlight2> |
getHighlights()
Method to return a list that is a copy of the list of current highlights. |
int |
getNumHighlights()
Method to return the number of highlighted objects. |
ElectricObject |
getOneElectricObject(java.lang.Class type)
Method to return the only highlighted object. |
Highlight2 |
getOneHighlight()
Method to return the only highlight that encompases an object in Cell cell. |
static Highlight2 |
getSimiliarHighlight(java.util.List<Highlight2> highlights,
Highlight2 exampleHigh)
Chooses a single Highlight from the list of Highlights 'highlights' that is most similar to Highlight 'exampleHigh'. |
WindowFrame |
getWindowFrame()
Method to return the WindowFrame associated with this Highlighter. |
Highlight2 |
overHighlighted(EditWindow wnd,
int x,
int y)
Method to tell whether a point is over this Highlight. |
void |
popHighlight()
Method to pop the current highlight list from the stack. |
void |
pushHighlight()
Method to push the current highlight list onto a stack. |
void |
remove(Highlight2 h)
Removes a Highlight object from the current set of highlights. |
static void |
removeHighlightListener(HighlightListener l)
Remove a Highlight listener |
void |
selectArea(EditWindow wnd,
double minSelX,
double maxSelX,
double minSelY,
double maxSelY,
boolean invertSelection,
boolean findSpecial)
Method to add everything in an area to the selection. |
void |
setHighlightList(java.util.List<Highlight2> newHighlights)
Method to load a list of Highlights into the highlighting. |
void |
setHighlightListGeneral(java.util.List<Highlight2> newHighlights)
Method to load a list of Highlights into the highlighting. |
void |
setHighlightOffset(int offX,
int offY)
Method to set a screen offset for the display of highlighting. |
void |
showHighlights(EditWindow wnd,
java.awt.Graphics g)
Shows highlights for the current EditWindow |
void |
showNetworks(Cell cell)
This is the show network command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SELECT_HIGHLIGHTER
public static final int MOUSEOVER_HIGHLIGHTER
public static final int RULER_HIGHLIGHTER
public static final int EXACTSELECTDISTANCE
Constructor Detail |
---|
public Highlighter(int type, WindowFrame wf)
type
- Method Detail |
---|
public void delete()
public Highlight2 addElectricObject(ElectricObject eobj, Cell cell)
eobj
- the ElectricObject to add to the list of highlighted objects.cell
- the Cell in which the ElectricObject resides.
public Highlight2 addElectricObject(ElectricObject eobj, Cell cell, boolean highlightConnected)
eobj
- the ElectricObject to add to the list of highlighted objects.cell
- the Cell in which the ElectricObject resides.highlightConnected
- if true, highlight all objects that are in some way connected
to this object. If false, do not. This is used by addNetwork to prevent extra
things from being highlighted later that are not connected to the network.
public Highlight2 addElectricObject(ElectricObject eobj, Cell cell, java.awt.Color col)
eobj
- the ElectricObject to add to the list of highlighted objects.cell
- the Cell in which the ElectricObject resides.
public Highlight2 addElectricObject(ElectricObject eobj, Cell cell, boolean highlightConnected, java.awt.Color col)
eobj
- the ElectricObject to add to the list of highlighted objects.cell
- the Cell in which the ElectricObject resides.highlightConnected
- if true, highlight all objects that are in some way connected
to this object. If false, do not. This is used by addNetwork to prevent extra
things from being highlighted later that are not connected to the network.
public Highlight2 addText(ElectricObject eobj, Cell cell, Variable.Key varKey)
cell
- the Cell in which this area resides.varKey
- the Variable.Key associated with the text (text is then a visual of that variable).
public Highlight2 addMessage(Cell cell, java.lang.String message, java.awt.geom.Point2D loc)
cell
- the Cell in which this area resides.message
- the String to display.loc
- the location of the string (in database units).
public Highlight2 addArea(java.awt.geom.Rectangle2D area, Cell cell)
area
- the Rectangular area to add to the list of highlighted objects.cell
- the Cell in which this area resides.
public Highlight2 addObject(java.lang.Object obj, Cell cell)
obj
- object to add.cell
- the Cell in which this object resides.
public Highlight2 addLine(java.awt.geom.Point2D start, java.awt.geom.Point2D end, Cell cell)
start
- the start point of the line to add to the list of highlighted objects.end
- the end point of the line to add to the list of highlighted objects.cell
- the Cell in which this line resides.
public Highlight2 addLine(java.awt.geom.Point2D start, java.awt.geom.Point2D end, Cell cell, boolean thick)
start
- the start point of the line to add to the list of highlighted objects.end
- the end point of the line to add to the list of highlighted objects.cell
- the Cell in which this line resides.thick
- true for a thick line.
public Highlight2 addThickLine(java.awt.geom.Point2D start, java.awt.geom.Point2D end, Cell cell)
start
- the start point of the line to add to the list of highlighted objects.end
- the end point of the line to add to the list of highlighted objects.cell
- the Cell in which this line resides.
public Highlight2 addPoly(Poly poly, Cell cell, java.awt.Color color)
poly
- the poly to addcell
- the cell in which to display the polycolor
- the color to draw the poly with (if null, uses default)
public void addNetwork(Network net, Cell cell)
net
- the network to highlight.cell
- the Cell in which this line resides.public void showNetworks(Cell cell)
cell
- the cell in which to create the highlightspublic void addHighlight(Highlight2 h)
public void clear()
public void finished()
public void ensureHighlightingSeen()
public void copyState(Highlighter highlighter)
highlighter
- public void showHighlights(EditWindow wnd, java.awt.Graphics g)
wnd
- g
- public WindowFrame getWindowFrame()
public static void addHighlightListener(HighlightListener l)
public static void removeHighlightListener(HighlightListener l)
public void gainedFocus()
public void pushHighlight()
public void popHighlight()
public void remove(Highlight2 h)
h
- the Highlight to removepublic int getNumHighlights()
public java.util.List<Highlight2> getHighlights()
public void setHighlightListGeneral(java.util.List<Highlight2> newHighlights)
newHighlights
- a List of Highlight objects.public void setHighlightList(java.util.List<Highlight2> newHighlights)
newHighlights
- a List of Highlight objects.public java.util.List<Geometric> getHighlightedEObjs(boolean wantNodes, boolean wantArcs)
wantNodes
- true if NodeInsts should be included in the list.wantArcs
- true if ArcInsts should be included in the list.
public java.util.List<NodeInst> getHighlightedNodes()
public java.util.List<ArcInst> getHighlightedArcs()
public java.util.Set<Network> getHighlightedNetworks()
public java.util.List<DisplayedText> getHighlightedText(boolean unique)
unique
- true to request that the text objects be unique,
and not attached to another object that is highlighted.
For example, if a node and an export on that node are selected,
the export text will not be included if "unique" is true.
public java.awt.geom.Rectangle2D getHighlightedArea(EditWindow wnd)
wnd
- the window in which to get bounds.
public Highlight2 getOneHighlight()
public ElectricObject getOneElectricObject(java.lang.Class type)
public void setHighlightOffset(int offX, int offY)
offX
- the X offset (in pixels) of the highlighting.offY
- the Y offset (in pixels) of the highlighting.public java.awt.geom.Point2D getHighlightOffset()
public void selectArea(EditWindow wnd, double minSelX, double maxSelX, double minSelY, double maxSelY, boolean invertSelection, boolean findSpecial)
wnd
- the window being examined.minSelX
- the low X coordinate of the area in database units.maxSelX
- the high X coordinate of the area in database units.minSelY
- the low Y coordinate of the area in database units.maxSelY
- the high Y coordinate of the area in database units.invertSelection
- is true to invert the selection (remove what is already highlighted and add what is new).findSpecial
- is true to find hard-to-select objects.public Highlight2 overHighlighted(EditWindow wnd, int x, int y)
wnd
- the window being examined.x
- the X screen coordinate of the point.y
- the Y screen coordinate of the point.
public static java.awt.geom.Point2D[] describeHighlightText(EditWindow wnd, ElectricObject eObj, Variable.Key varKey)
wnd
- the EditWindow in which the object/variable-key is displayed.eObj
- the object.varKey
- the variable-key.
public Highlight2 findObject(java.awt.geom.Point2D pt, EditWindow wnd, boolean exclusively, boolean another, boolean invert, boolean findPort, boolean findPoint, boolean findSpecial, boolean findText)
pt
- the coordinates of the click (in database units).wnd
- the window being examined.exclusively
- true if the currently selected object must remain selected.
This happens during "outline edit" when the node doesn't change, just the point on it.another
- true to find another object under the point (when there are multiple ones).invert
- true to invert selection (add if not selected, remove if already selected).findPort
- true to also show the closest port on a selected node.findPoint
- true to also show the closest point on a selected outline node.findSpecial
- true to select hard-to-find objects.findText
- true to select text objects.
The name of an unexpanded cell instance is always hard-to-select.
Other objects are set this way by the user (although the cell-center is usually set this way).public static java.util.List<Highlight2> findAllInArea(Highlighter highlighter, Cell cell, boolean exclusively, boolean another, boolean findPort, boolean findPoint, boolean findSpecial, boolean findText, java.awt.geom.Rectangle2D bounds, EditWindow wnd)
cell
- the cell to search.exclusively
- true if the currently selected object must remain selected.
This happens during "outline edit" when the node doesn't change, just the point on it.another
- true to find another object under the point (when there are multiple ones).findPort
- true to also show the closest port on a selected node.findPoint
- true to also show the closest point on a selected outline node.findSpecial
- true to select hard-to-find objects.findText
- true to select text objects.
The name of an unexpanded cell instance is always hard-to-select.
Other objects are set this way by the user (although the cell-center is usually set this way).bounds
- the area of the search (in database units).wnd
- the window being examined (null to ignore window scaling).
public static Highlight2 checkOutObject(Geometric geom, boolean findPort, boolean findPoint, boolean findSpecial, java.awt.geom.Rectangle2D bounds, EditWindow wnd, double directHitDist, boolean areaMustEnclose)
geom
- the Geometric being tested for selection.findPort
- true if a port should be selected with a NodeInst.findPoint
- true if a point should be selected with an outline NodeInst.findSpecial
- true if hard-to-select and other special selection is being done.bounds
- the selected area or point.wnd
- the window being examined (null to ignore window scaling).directHitDist
- the slop area to forgive when searching (a few pixels in screen space, transformed to database units).areaMustEnclose
- true if the object must be completely inside of the selection area.
public static Highlight2 getSimiliarHighlight(java.util.List<Highlight2> highlights, Highlight2 exampleHigh)
highlights
- a list of Highlight ObjectsexampleHigh
- the Highlight that serves as an example of what type
of Highlight should be retrieved from the highlights list.public static double distToNode(java.awt.geom.Rectangle2D bounds, NodeInst ni, EditWindow wnd)
bounds
- the bounds in question.ni
- the NodeInst.wnd
- the window being examined (null to ignore text/window scaling).
public static double distToArc(java.awt.geom.Rectangle2D bounds, ArcInst ai, EditWindow wnd)
bounds
- the bounds in question.ai
- the ArcInst.wnd
- the window being examined.
public void databaseChanged(DatabaseChangeEvent e)
DatabaseChangeListener
databaseChanged
in interface DatabaseChangeListener
e
- database change event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |