Author: mes
Date: 2010-02-11 17:24:45 -0800 (Thu, 11 Feb 2010)
New Revision: 19309
Modified:
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/GraphRenderer.java
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/NodeDetails.java
Log:
fixed bug 1827, cleaned up some deprecated code, and fixed a couple of warnings
Modified:
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/GraphRenderer.java
===================================================================
---
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/GraphRenderer.java
2010-02-12 00:58:38 UTC (rev 19308)
+++
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/GraphRenderer.java
2010-02-12 01:24:45 UTC (rev 19309)
@@ -860,9 +860,9 @@
final float srcOffset;
if (srcArrow == GraphGraphics.ARROW_DISC)
- srcOffset = (float) (0.5d * srcArrowSize);
+ srcOffset = 0.5f * srcArrowSize;
else if (srcArrow == GraphGraphics.ARROW_TEE)
- srcOffset = (float) srcArrowSize;
+ srcOffset = srcArrowSize;
else
srcOffset = 0.0f;
@@ -921,9 +921,9 @@
final float trgOffset;
if (trgArrow == GraphGraphics.ARROW_DISC)
- trgOffset = (float) (0.5d * trgArrowSize);
+ trgOffset = 0.5f * trgArrowSize;
else if (trgArrow == GraphGraphics.ARROW_TEE)
- trgOffset = (float) trgArrowSize;
+ trgOffset = trgArrowSize;
else
trgOffset = 0.0f;
@@ -1158,6 +1158,8 @@
// Take care of custom graphic rendering.
if ((lodBits & LOD_CUSTOM_GRAPHICS) != 0) {
+
+ // draw any nested networks first
final TexturePaint nestedNetworkPaint =
nodeDetails.getNestedNetworkTexturePaint(node);
if (nestedNetworkPaint != null) {
doubleBuff1[0] = floatBuff1[0];
@@ -1168,18 +1170,19 @@
grafx.drawCustomGraphicFull(nestedNetworkPaint.getAnchorRect(),
(float)doubleBuff2[0], (float)doubleBuff2[1], nestedNetworkPaint);
}
+ // draw custom graphics on top of nested networks
// don't allow our custom graphics to mutate while we
iterate over them:
synchronized (nodeDetails.customGraphicsLock(node)) {
// This iterator will return CustomGraphics in
rendering order:
- Iterator<CustomGraphic> dNodeIt =
nodeDetails.customGraphics (node);
+ Iterator<CustomGraphic> dNodeIt =
nodeDetails.customGraphics(node);
CustomGraphic cg = null;
// The graphic index used to retrieve non
custom graphic info corresponds to the zero-based
// index of the CustomGraphic returned by the
iterator:
int graphicInx = 0;
while (dNodeIt.hasNext()) {
cg = dNodeIt.next();
- final float offsetVectorX =
nodeDetails.labelOffsetVectorX(node, graphicInx);
- final float offsetVectorY =
nodeDetails.labelOffsetVectorY(node, graphicInx);
+ final float offsetVectorX =
nodeDetails.graphicOffsetVectorX(node, graphicInx);
+ final float offsetVectorY =
nodeDetails.graphicOffsetVectorY(node, graphicInx);
doubleBuff1[0] = floatBuff1[0];
doubleBuff1[1] = floatBuff1[1];
doubleBuff1[2] = floatBuff1[2];
Modified:
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/NodeDetails.java
===================================================================
---
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/NodeDetails.java
2010-02-12 00:58:38 UTC (rev 19308)
+++
corelibs/trunk/render.stateful/src/cytoscape/render/stateful/NodeDetails.java
2010-02-12 01:24:45 UTC (rev 19309)
@@ -365,80 +365,6 @@
}
/**
- * Returns the number of custom graphics that this node has. By
default this
- * method returns zero. A custom graphic extends the concept of node
label
- * to include any arbitrary filled shape.
- * @deprecated Switch to using the CustomGraphics way of manipulating
custom graphics.
- * For details, see deprecation note under
- * {...@link CustomGraphic#CustomGraphic CustomGraphic}.
- * Once switched, then
- * use {...@link #customGraphicCount(int)
customGraphicCount()}.
-
- */
- @Deprecated public int graphicCount(final int node) {
- return 0;
- }
-
- /**
- * Returns a custom graphic's shape. This shape will be filled by the
- * rendering engine. By default this method always returns null. This
- * method is only called by the rendering engine if graphicCount(node)
- * returns a value greater than zero. It is an error to return null if
- * this method is called by the rendering engine.
- * @param graphicInx a value in the range [0, graphicCount(node)-1]
- * indicating which node graphic in question.
- * @deprecated Switch to using the CustomGraphics way of manipulating
custom graphics.
- * For details, see deprecation note under
- * {...@link CustomGraphic#CustomGraphic CustomGraphic}.
- * Once switched, then
- * use {...@link
cytoscape.render.stateful.CustomGraphic#getShape() CustomGraphic.getShape()}.
- */
- @Deprecated public Shape graphicShape(final int node, final int
graphicInx) {
- return null;
- }
-
- /**
- * Returns the fill paint of a custom graphic. By default this
- * method always returns null. This method is only called by the
rendering
- * engine if graphicCount(node) returns a value greater than zero. It
is
- * an error to return null if this method is called by the rendering
engine.
- * @param graphicInx a value in the range [0, graphicCount(node)-1]
- * indicating which node graphic in question.
- * @deprecated Switch to using the CustomGraphics way of manipulating
custom graphics.
- * For details, see deprecation note under
- * {...@link CustomGraphic#CustomGraphic CustomGraphic}.
- * Once switched, then
- * use {...@link
cytoscape.render.stateful.CustomGraphic#getPaint() CustomGraphic.getPaint()}.
- */
- @Deprecated public Paint graphicPaint(final int node, final int
graphicInx) {
- return null;
- }
-
- /**
- * By returning one of the ANCHOR_* constants, specifies
- * where on the node's extents rectangle the graphic anchor point lies.
- * The filled shape is rendered at a location which is equal to this
- * anchor point plus the offset vector.<p>
- * By default this method always returns ANCHOR_CENTER.
- * This method is only called by the rendering engine if
graphicCount(node)
- * returns a value greater than zero.
- * @param graphicInx a value in the range [0, graphicCount(node)-1]
- * indicating which node graphic in question.
- * @see #ANCHOR_CENTER
- * @see #graphicOffsetVectorX(int, int)
- * @see #graphicOffsetVectorY(int, int)
- * @deprecated Switch to using the CustomGraphics way of manipulating
custom graphics.
- * For details, see deprecation note under
- * {...@link CustomGraphic#CustomGraphic CustomGraphic}.
- * Once switched, then
- * use {...@link
cytoscape.render.stateful.CustomGraphic#getAnchor() CustomGraphic.getAnchor()}.
- */
- @Deprecated
- public byte graphicNodeAnchor(final int node, final int graphicInx) {
- return ANCHOR_CENTER;
- }
-
- /**
* Specifies the X component of the vector that separates the location
of
* a rendered graphic from the node's anchor point for that graphic.
* By default this method always returns zero. This method is only
called
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.