Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17700/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Added feedback when locked to an edge.
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -d -r1.218 -r1.219
*** View.java 26 Jun 2007 02:04:17 -0000 1.218
--- View.java 27 Jun 2007 00:33:53 -0000 1.219
***************
*** 353,356 ****
--- 353,359 ----
/** Maps entities to a color */
private Map colorMap;
+
+ /** Maps edges to a set of attributes */
+ private Map<Edge, EdgeAttributes> edgeStyleMap;
/** Contains invisible entities during drawing */
***************
*** 380,385 ****
private boolean debug = false;
-
- private Edge lockingEdge;
static {
--- 383,386 ----
***************
*** 492,495 ****
--- 493,497 ----
tempVertices = new HashSet<Vertex>();
colorMap = new HashMap();
+ edgeStyleMap = new HashMap();
glObjects3D = new HashSet<GlObject>();
widgets = new LinkedList<Widget>();
***************
*** 997,1001 ****
}
}
-
{
Iterator it = glObjects3D.iterator();
--- 999,1002 ----
***************
*** 1547,1550 ****
--- 1548,1553 ----
style.setStipple(true);
style.setDrawVertices(true);
+ } else if (edgeStyleMap.get(current) != null) {
+ style = edgeStyleMap.get(current);
} else {
float[] individualColor = (float[])colorMap.get(current);
***************
*** 3047,3051 ****
*/
public void changeColor(Entity e, float[] color) {
! colorMap.put(e, color);
}
--- 3050,3054 ----
*/
public void changeColor(Entity e, float[] color) {
! colorMap.put(e, color);
}
***************
*** 3056,3061 ****
--- 3059,3081 ----
public void clearColor(Entity e) {
colorMap.remove(e);
+ }
+
+ /**
+ * Sets a new style for a given edge
+ * @param e the edge
+ * @param attributes the attributes for the edge's style
+ */
+ public void changeEdgeStyle(Edge e, EdgeAttributes attributes) {
+ edgeStyleMap.put(e, attributes);
}
+ /**
+ * Clears the custom style of an edge
+ * @param e the edge
+ */
+ public void clearStyle(Edge e) {
+ edgeStyleMap.remove(e);
+ }
+
/** {@inheritDoc} */
public Vertex toModelCoords(double x, double y) {
***************
*** 3350,3360 ****
}
}
-
- /**
- * Sets the current locking edge
- * @param lockingEdge the new locking edge
- */
- public void setLockingEdge(Edge lockingEdge) {
- this.lockingEdge = lockingEdge;
- }
}
--- 3370,3372 ----
|