|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--uci.gef.Layer
A Layer is like a drawing layer in high-end drawing applications (e.g., MacDraw Pro). A Layer is like a sheet of clear plastic that can contain part of the picture being drawn and multiple layers are put on top of each other to make the overall picture. Different layers can be hidden, locked, or grayed out independently. In GEF the Layer class is more abstract than described above. LayerDiagram is a subclass of Layer that does what is described above. Other subclasses of Layer can provide functionality. For example the background drawing grid is a subclass of Layer that computes its display rather than displaying what is stored in a data structure. Generalizing the concept of a layer to handle grids and other computed display features gives more power and allows the framework to be extended in building various applications. For example an application that needs polar coordinates might use LayerPolar, and an application that used a world map might implement LayerMap. But since layers can be composed, the user could put a grid in front of or behind the map.
This approach to implementing drawing editors is similar to that described in a published paper: "Using the Multi-Layer Model for Building Interactive Graphical Applications" Fekete, et al. UIST'96. pp. 109-117. GEF might be improved by making it more like the system described in that paper: basically by moving some of the XXXManage functionality into Layers, or merging Layers and Modes.
LayerDiagram,
LayerPerspective,
LayerGrid,
LayerPolar, Serialized Form| Field Summary | |
Vector |
_editors
A Vector of the Editors that are displaying this Layer. |
protected boolean |
_onMenu
Should the user be able to hide, lock, or gray this layer? Needs-More-Work. |
| Constructor Summary | |
Layer()
Construct a new Layer. |
|
Layer(String name)
Construct a new layer with the given name. |
|
Layer(String name,
String type)
Construct a new layer with the given name and type. |
|
| Method Summary | |
void |
add(Fig f)
Most Layers contain Fig, so I have empty implementations of add, remove, removeAll, elements, and hit. |
void |
addEditor(Editor ed)
Add an Editor to the list of Editors showing this Layer. |
void |
adjust()
Allow the user to edit the properties of this layer (not the properties of the contents of this layer). |
void |
bringForward(Fig f)
|
void |
bringInFrontOf(Fig f1,
Fig f2)
|
void |
bringToFront(Fig f)
|
void |
damaged(Fig f)
A Fig in this Layer has changed state and needs to be redrawn. |
void |
deleted(Fig f)
A Fig in this Layer has been deleted. |
Enumeration |
elements()
|
Enumeration |
elementsIn(Rectangle r)
Reply an enumeration of all the Figs in this Layer that intersect given Rectangle. |
boolean |
fetHidden()
|
Layer |
findLayerNamed(String aName)
If this layer has the given name then return 'this', else null |
abstract Vector |
getContents()
|
Vector |
getContentsEdgesOnly()
|
Vector |
getContentsNoEdges()
|
Vector |
getEditors()
Return the Vector of Editors that are showing this Layer. |
boolean |
getGrayed()
|
boolean |
getLocked()
|
String |
getName()
Get and set methods |
boolean |
getOnMenu()
|
String |
getPerspectiveType()
Return a string that can be used to make some Layers show nodes in one way and other Layers show the same nodes in a different way. |
Fig |
hit(Rectangle r)
|
Enumeration |
nodesIn(Rectangle r)
Reply an enumeration of all the FigNodes in this Layer that intersect given Rectangle. |
void |
paint(Graphics g)
Paint this Layer on the given Graphics. |
abstract void |
paintContents(Graphics g)
Abactract method to paint the contents of this layer, subclasses must define this. |
void |
paintGrayContents(Graphics g)
Paint the contents in a dimmed, demphasized way. |
void |
postLoad()
|
void |
postSave()
|
void |
preSave()
|
abstract Fig |
presentationFor(Object obj)
Given an object from the net-level model (e.g., NetNode or NetPort), reply the graphical depiction of that object in this layer, if there is one. |
void |
print(Graphics g)
Draw the Layer on a PrintGraphics. |
void |
refreshEditors()
Ask all Editors to completely redraw their display. |
void |
remove(Fig f)
|
void |
removeAll()
|
void |
removeEditor(Editor ed)
|
void |
reorder(Fig f,
int function)
|
void |
sendBackward(Fig f)
|
void |
sendToBack(Fig f)
Most Layers will contain things in back to front order, so I define empty reordering functions here. |
void |
setGrayed(boolean b)
|
void |
setHidden(boolean b)
|
void |
setLocked(boolean b)
|
void |
setName(String n)
|
void |
setOnMenu(boolean b)
|
void |
setPerspectiveType(String t)
|
String |
toString()
Reply a string useful for debugging |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected boolean _onMenu
public transient Vector _editors
| Constructor Detail |
public Layer()
public Layer(String name)
public Layer(String name,
String type)
| Method Detail |
public String toString()
public Layer findLayerNamed(String aName)
public String getName()
public void setName(String n)
public void setHidden(boolean b)
public boolean fetHidden()
public void setGrayed(boolean b)
public boolean getGrayed()
public void setLocked(boolean b)
public boolean getLocked()
public void setOnMenu(boolean b)
public boolean getOnMenu()
public abstract Vector getContents()
public Vector getContentsNoEdges()
public Vector getContentsEdgesOnly()
public Vector getEditors()
public void add(Fig f)
LayerDiagrampublic void remove(Fig f)
public void removeAll()
public Enumeration elements()
public Fig hit(Rectangle r)
public Enumeration elementsIn(Rectangle r)
public Enumeration nodesIn(Rectangle r)
public abstract Fig presentationFor(Object obj)
public String getPerspectiveType()
public void setPerspectiveType(String t)
public void sendToBack(Fig f)
public void bringForward(Fig f)
public void sendBackward(Fig f)
public void bringToFront(Fig f)
public void bringInFrontOf(Fig f1,
Fig f2)
public void reorder(Fig f,
int function)
public void print(Graphics g)
public void paint(Graphics g)
public abstract void paintContents(Graphics g)
public void paintGrayContents(Graphics g)
public void damaged(Fig f)
public void deleted(Fig f)
public void refreshEditors()
public void addEditor(Editor ed)
public void removeEditor(Editor ed)
public void preSave()
public void postSave()
public void postLoad()
public void adjust()
LayerGrid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||