|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.base.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 FormField Summary | |
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(java.lang.String name)
Construct a new layer with the given name. |
|
Layer(java.lang.String name,
java.lang.String type)
Construct a new layer with the given name and type. |
Method Summary | |
void |
add(org.tigris.gef.presentation.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(org.tigris.gef.presentation.Fig f)
|
void |
bringInFrontOf(org.tigris.gef.presentation.Fig f1,
org.tigris.gef.presentation.Fig f2)
|
void |
bringToFront(org.tigris.gef.presentation.Fig f)
|
java.awt.Rectangle |
calcDrawingArea()
|
java.lang.Object |
clone()
|
void |
damageAll()
A Fig in this Layer has changed state and needs to be redrawn. |
void |
deleted(org.tigris.gef.presentation.Fig f)
A Fig in this Layer has been deleted. |
java.util.Enumeration |
elements()
|
java.util.Enumeration |
elementsIn(java.awt.Rectangle r)
Reply an enumeration of all the Figs in this Layer that intersect given Rectangle. |
java.util.List |
getContents()
Get the figs that make up this layer. |
abstract java.util.Collection |
getContents(java.util.Collection edges)
Get the figs that make up this layer. |
java.util.List |
getContentsEdgesOnly()
USED BY SVG.tee |
java.util.List |
getContentsNoEdges()
USED BY SVG.tee |
java.util.List |
getEditors()
Return the list of Editors that are showing this Layer. |
boolean |
getGrayed()
|
boolean |
getHidden()
|
boolean |
getLocked()
|
java.lang.String |
getName()
Get and set methods |
boolean |
getOnMenu()
|
java.lang.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. |
double |
getScale()
|
org.tigris.gef.presentation.Fig |
hit(java.awt.Rectangle r)
|
boolean |
isAlwaysOnTop()
|
java.util.Enumeration |
nodesIn(java.awt.Rectangle r)
Reply an enumeration of all the FigNodes in this Layer that intersect given Rectangle. |
void |
paint(java.awt.Graphics g)
Paint this Layer on the given Graphics. |
void |
paint(java.awt.Graphics g,
org.tigris.gef.presentation.FigPainter painter)
Paint this Layer on the given Graphics using the given FigPainter. |
abstract void |
paintContents(java.awt.Graphics g)
Abstract method to paint the contents of this layer, subclasses must define this. |
void |
paintContents(java.awt.Graphics g,
org.tigris.gef.presentation.FigPainter painter)
Method to paint the contents of this layer using a given painter. |
void |
paintGrayContents(java.awt.Graphics g)
Paint the contents in a dimmed, demphasized way. |
void |
postLoad()
|
void |
postSave()
|
void |
preSave()
|
abstract org.tigris.gef.presentation.Fig |
presentationFor(java.lang.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(java.awt.Graphics g)
Draw the Layer on a PrintGraphics. |
void |
refreshEditors()
Ask all Editors to completely redraw their display. |
void |
remove(org.tigris.gef.presentation.Fig f)
|
void |
removeAll()
|
void |
removeEditor(Editor ed)
|
void |
reorder(org.tigris.gef.presentation.Fig f,
int function)
|
void |
sendBackward(org.tigris.gef.presentation.Fig f)
|
void |
sendToBack(org.tigris.gef.presentation.Fig f)
Most Layers will contain things in back to front order, so I define empty reordering functions here. |
void |
setAlwaysOnTop(boolean onTop)
|
void |
setGrayed(boolean b)
|
void |
setHidden(boolean b)
|
void |
setLocked(boolean b)
|
void |
setName(java.lang.String n)
|
void |
setOnMenu(boolean b)
|
void |
setPerspectiveType(java.lang.String t)
|
void |
setScale(double scale)
|
java.lang.String |
toString()
Reply a string useful for debugging |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean _onMenu
Constructor Detail |
public Layer()
public Layer(java.lang.String name)
public Layer(java.lang.String name, java.lang.String type)
Method Detail |
public java.lang.Object clone()
public java.lang.String toString()
public java.lang.String getName()
public void setName(java.lang.String n)
public void setHidden(boolean b)
public boolean getHidden()
public void setGrayed(boolean b)
public boolean getGrayed()
public void setLocked(boolean b)
public boolean getLocked()
public void setAlwaysOnTop(boolean onTop)
public boolean isAlwaysOnTop()
public void setScale(double scale)
public double getScale()
public void setOnMenu(boolean b)
public boolean getOnMenu()
public abstract java.util.Collection getContents(java.util.Collection edges)
edges
- the collection in which to place the edges or null
if a new collection should be created
public java.util.List getContents()
public java.util.List getContentsNoEdges()
public java.util.List getContentsEdgesOnly()
public java.util.List getEditors()
public void add(org.tigris.gef.presentation.Fig f)
LayerDiagram
public void remove(org.tigris.gef.presentation.Fig f)
public void removeAll()
public java.util.Enumeration elements()
public org.tigris.gef.presentation.Fig hit(java.awt.Rectangle r)
public java.util.Enumeration elementsIn(java.awt.Rectangle r)
public java.util.Enumeration nodesIn(java.awt.Rectangle r)
public abstract org.tigris.gef.presentation.Fig presentationFor(java.lang.Object obj)
public java.lang.String getPerspectiveType()
public void setPerspectiveType(java.lang.String t)
public void sendToBack(org.tigris.gef.presentation.Fig f)
public void bringForward(org.tigris.gef.presentation.Fig f)
public void sendBackward(org.tigris.gef.presentation.Fig f)
public void bringToFront(org.tigris.gef.presentation.Fig f)
public void bringInFrontOf(org.tigris.gef.presentation.Fig f1, org.tigris.gef.presentation.Fig f2)
public void reorder(org.tigris.gef.presentation.Fig f, int function)
public void print(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
public void paint(java.awt.Graphics g, org.tigris.gef.presentation.FigPainter painter)
public void paintContents(java.awt.Graphics g, org.tigris.gef.presentation.FigPainter painter)
public abstract void paintContents(java.awt.Graphics g)
public void paintGrayContents(java.awt.Graphics g)
public java.awt.Rectangle calcDrawingArea()
public void damageAll()
public void deleted(org.tigris.gef.presentation.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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |