Author: kono
Date: 2012-08-10 11:08:26 -0700 (Fri, 10 Aug 2012)
New Revision: 30158
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
Log:
Code clean up only. No functional changes.
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
2012-08-10 17:41:41 UTC (rev 30157)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
2012-08-10 18:08:26 UTC (rev 30158)
@@ -49,8 +49,6 @@
import org.cytoscape.graph.render.stateful.NodeDetails;
import org.cytoscape.model.CyNode;
import org.cytoscape.view.model.View;
-import org.cytoscape.view.presentation.property.NodeShapeVisualProperty;
-import org.cytoscape.view.presentation.property.values.NodeShape;
/*
@@ -59,12 +57,11 @@
*/
class DNodeDetails extends NodeDetails {
- private static final byte DEF_NODE_SHAPE =
DNodeShape.getDShape(NodeShapeVisualProperty.RECTANGLE).getNativeShape();
+ // Parent Network View
+ private final DGraphView dGraphView;
+ private final Object m_deletedEntry = new Object();
- private final DGraphView m_view;
-
- final Object m_deletedEntry = new Object();
-
+ // Mapped Values
Map<CyNode,Object> m_colorsLowDetail = new WeakHashMap<CyNode,Object>();
Map<CyNode,Object> m_selectedColorsLowDetail = new
WeakHashMap<CyNode,Object>();
@@ -100,15 +97,12 @@
private Color m_selectedColorLowDetailDefault;
private Paint m_unselectedPaintDefault;
private Paint m_selectedPaintDefault;
-
private DNodeShape m_shapeDefault;
private Float m_borderWidthDefault;
private Paint m_borderPaintDefault;
private Integer m_labelCountDefault;
-
private String m_labelTextDefault;
private String m_tooltipTextDefault;
-
private Font m_labelFontDefault;
private Paint m_labelPaintDefault;
private Byte m_labelTextAnchorDefault;
@@ -118,12 +112,11 @@
private Byte m_labelJustifyDefault;
private Double m_labelWidthDefault;
-
private boolean isCleared;
-
-
+
+
DNodeDetails(final DGraphView view) {
- this.m_view = view;
+ this.dGraphView = view;
}
void clear() {
@@ -132,7 +125,6 @@
m_colorsLowDetail = new WeakHashMap<CyNode,Object>();
m_selectedColorsLowDetail = new WeakHashMap<CyNode,Object>();
-
m_shapes = new WeakHashMap<CyNode, Byte>();
m_unselectedPaints = new WeakHashMap<CyNode, Paint>();
m_borderWidths = new WeakHashMap<CyNode, Float>();
@@ -143,26 +135,23 @@
m_labelFonts = new WeakHashMap<CyNode, Font>();
m_labelPaints = new WeakHashMap<CyNode, Paint>();
m_labelWidths = new WeakHashMap<CyNode, Double>();
-
m_labelTextAnchors = new WeakHashMap<CyNode, Integer>();
m_labelNodeAnchors = new WeakHashMap<CyNode, Integer>();
m_labelJustifys = new WeakHashMap<CyNode, Integer>();
m_labelOffsetXs = new WeakHashMap<CyNode, Double>();
m_labelOffsetYs = new WeakHashMap<CyNode, Double>();
m_width = new WeakHashMap<CyNode, Double>();
-
m_selectedPaints = new WeakHashMap<CyNode, Paint>();
-
m_customGraphics = new WeakHashMap<CyNode,
List<CustomGraphic>>();
-
// Clear all Custom Graphics
- for(final View<CyNode> nv: m_view.getNodeViews())
+ for(final View<CyNode> nv: dGraphView.getNodeViews())
((DNodeView) nv).removeAllCustomGraphics();
isCleared = true;
}
+
void unregisterNode(final CyNode nodeIdx) {
final Object o = m_colorsLowDetail.get(nodeIdx);
if ((o != null) && (o != m_deletedEntry))
@@ -183,16 +172,12 @@
m_labelOffsetXs.remove(nodeIdx);
m_labelOffsetYs.remove(nodeIdx);
m_selectedPaints.remove(nodeIdx);
-
m_tooltipTexts.remove(nodeIdx);
selected.remove(nodeIdx);
-
m_labelCounts.remove(nodeIdx);
-
m_labelTexts.remove(nodeIdx);
m_labelFonts.remove(nodeIdx);
m_labelPaints.remove(nodeIdx);
-
}
@@ -242,7 +227,7 @@
public Paint selectedPaint(CyNode node) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_SELECTED_PAINT))
return
dnv.getVisualProperty(DVisualLexicon.NODE_SELECTED_PAINT);
@@ -292,15 +277,18 @@
* Note: this will be used for BOTH unselected and selected.
*/
public Paint unselectedPaint(final CyNode node) {
- final Paint o = m_unselectedPaints.get(node);
+ final Paint unselectedNodeFillPaint =
m_unselectedPaints.get(node);
- if (o == null)
+ if (unselectedNodeFillPaint == null) {
+ // Mapped Value does not exist. Use default
if (m_unselectedPaintDefault == null)
return super.fillPaint(node);
- else
+ else {
return m_unselectedPaintDefault;
-
- return o;
+ }
+ } else {
+ return unselectedNodeFillPaint;
+ }
}
void setUnselectedPaintDefault(Paint p) {
@@ -322,11 +310,13 @@
isCleared = false;
}
+
+ /**
+ * This returns actual Color object to the low-level renderer.
+ */
@Override
public Paint fillPaint(final CyNode node) {
- boolean isSelected = selected.contains(node);
-
- if (isSelected)
+ if (selected.contains(node))
return selectedPaint(node);
else
return unselectedPaint(node);
@@ -343,7 +333,7 @@
@Override
public float borderWidth(final CyNode node) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_BORDER_WIDTH))
return
dnv.getVisualProperty(DVisualLexicon.NODE_BORDER_WIDTH).floatValue();
@@ -377,7 +367,7 @@
@Override
public Paint borderPaint(final CyNode node) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if(dnv == null)
return DVisualLexicon.NODE_BORDER_PAINT.getDefault();
@@ -443,7 +433,7 @@
@Override
public String labelText(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL))
return dnv.getVisualProperty(DVisualLexicon.NODE_LABEL);
@@ -480,7 +470,7 @@
public String tooltipText(final CyNode node) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_TOOLTIP))
return
dnv.getVisualProperty(DVisualLexicon.NODE_TOOLTIP);
@@ -517,7 +507,7 @@
@Override
public Font labelFont(CyNode node, int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
Integer size = null;
Font fontFace = null;
@@ -574,7 +564,7 @@
@Override
public Paint labelPaint(CyNode node, int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_COLOR))
return
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_COLOR);
@@ -611,14 +601,14 @@
@Override
public int customGraphicCount(final CyNode node) {
- final DNodeView dnv = (DNodeView) m_view.getDNodeView(node);
+ final DNodeView dnv = (DNodeView)
dGraphView.getDNodeView(node);
return dnv.getNumCustomGraphics();
}
@Override
public Iterator<CustomGraphic> customGraphics (final CyNode node) {
- final DNodeView dnv = (DNodeView) m_view.getDNodeView(node);
+ final DNodeView dnv = (DNodeView) dGraphView.getDNodeView(node);
return dnv.customGraphicIterator();
}
@@ -627,7 +617,7 @@
@Override
public byte labelTextAnchor(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
final ObjectPosition lp =
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
final Position anchor = lp.getAnchor();
@@ -661,7 +651,7 @@
@Override
public byte labelNodeAnchor(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
final ObjectPosition lp =
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
final Position anchor = lp.getTargetAnchor();
@@ -695,7 +685,7 @@
@Override
public float labelOffsetVectorX(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
final ObjectPosition lp =
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
return (float) lp.getOffsetX();
@@ -728,7 +718,7 @@
@Override
public float labelOffsetVectorY(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
final ObjectPosition lp =
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
return (float) lp.getOffsetY();
@@ -762,7 +752,7 @@
@Override
public byte labelJustify(final CyNode node, final int labelInx) {
// Check bypass
- final DNodeView dnv = m_view.getDNodeView(node);
+ final DNodeView dnv = dGraphView.getDNodeView(node);
if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
final ObjectPosition lp =
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
final Justification justify = lp.getJustify();
@@ -825,7 +815,7 @@
@Override
public TexturePaint getNestedNetworkTexturePaint(final CyNode node) {
- final DNodeView dNodeView = (DNodeView)
m_view.getDNodeView(node);
+ final DNodeView dNodeView = (DNodeView)
dGraphView.getDNodeView(node);
return dNodeView.getNestedNetworkTexturePaint();
}
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
2012-08-10 17:41:41 UTC (rev 30157)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
2012-08-10 18:08:26 UTC (rev 30158)
@@ -24,10 +24,9 @@
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ */
package org.cytoscape.graph.render.stateful;
-
import org.cytoscape.graph.render.immed.GraphGraphics;
import org.cytoscape.model.CyNode;
@@ -40,14 +39,14 @@
import java.util.Iterator;
import java.util.Map;
-
/**
- * Defines visual properties of a node modulo the node size and location
- * Even though this class is not declared abstract, in most situations it
- * makes sense to override at least some of its methods in order to gain
- * control over node visual properties.<p>
- * To understand the significance of each method's return value, it makes
- * sense to become familiar with the API cytoscape.render.immed.GraphGraphics.
+ * Defines visual properties of a node modulo the node size and location Even
+ * though this class is not declared abstract, in most situations it makes
sense
+ * to override at least some of its methods in order to gain control over node
+ * visual properties.
+ * <p>
+ * To understand the significance of each method's return value, it makes sense
+ * to become familiar with the API cytoscape.render.immed.GraphGraphics.
*/
public class NodeDetails {
/**
@@ -56,92 +55,91 @@
public static final byte ANCHOR_CENTER = 0;
/**
- * Specifies that an anchor point lies on the north edge of a
- * bounding box, halfway between the east and west edges.
+ * Specifies that an anchor point lies on the north edge of a bounding
box,
+ * halfway between the east and west edges.
*/
public static final byte ANCHOR_NORTH = 1;
/**
- * Specifies that an anchor point lies on the northeast corner of
- * a bounding box.
+ * Specifies that an anchor point lies on the northeast corner of a
bounding
+ * box.
*/
public static final byte ANCHOR_NORTHEAST = 2;
/**
- * Specifies that an anchor point lies on the east edge of a
- * bounding box, halfway between the north and south edges.
+ * Specifies that an anchor point lies on the east edge of a bounding
box,
+ * halfway between the north and south edges.
*/
public static final byte ANCHOR_EAST = 3;
/**
- * Specifies that an anchor point lies on the southeast corner of
- * a bounding box.
+ * Specifies that an anchor point lies on the southeast corner of a
bounding
+ * box.
*/
public static final byte ANCHOR_SOUTHEAST = 4;
/**
- * Specifies that an anchor point lies on the south edge of a
- * bounding box, halfway between the east and west edges.
+ * Specifies that an anchor point lies on the south edge of a bounding
box,
+ * halfway between the east and west edges.
*/
public static final byte ANCHOR_SOUTH = 5;
/**
- * Specifies that an anchor point lies on the southwest corner of a
- * bounding box.
+ * Specifies that an anchor point lies on the southwest corner of a
bounding
+ * box.
*/
public static final byte ANCHOR_SOUTHWEST = 6;
/**
- * Specifies that an anchor point lies on the west edge of a
- * bounding box, halfway between the north and south edges.
+ * Specifies that an anchor point lies on the west edge of a bounding
box,
+ * halfway between the north and south edges.
*/
public static final byte ANCHOR_WEST = 7;
/**
- * Specifies that an anchor point lies on the northwest corner of a
- * bounding box.
+ * Specifies that an anchor point lies on the northwest corner of a
bounding
+ * box.
*/
public static final byte ANCHOR_NORTHWEST = 8;
- /**
- * Used for range checking the anchor values.
- */
- // Seems like these values should really be an enum...:
- public static final byte MAX_ANCHOR_VAL = 8;
+ /**
+ * Used for range checking the anchor values.
+ */
+ // Seems like these values should really be an enum...:
+ public static final byte MAX_ANCHOR_VAL = 8;
/**
- * Specifies that the lines in a multi-line node label should each have
- * a center point with similar X coordinate.
+ * Specifies that the lines in a multi-line node label should each have
a
+ * center point with similar X coordinate.
*/
public static final byte LABEL_WRAP_JUSTIFY_CENTER = 64;
/**
- * Specifies that the lines of a multi-line node label should each have
- * a leftmost point with similar X coordinate.
+ * Specifies that the lines of a multi-line node label should each have
a
+ * leftmost point with similar X coordinate.
*/
public static final byte LABEL_WRAP_JUSTIFY_LEFT = 65;
/**
- * Specifies that the lines of a multi-line node label should each have
- * a rightmost point with similar X coordinate.
+ * Specifies that the lines of a multi-line node label should each have
a
+ * rightmost point with similar X coordinate.
*/
public static final byte LABEL_WRAP_JUSTIFY_RIGHT = 66;
/**
- * Hashmap which records selected state of nodes - information used
- * by GraphRenderer.renderGraph() to render selected nodes on top of
- * unselected nodes.
+ * Hashmap which records selected state of nodes - information used by
+ * GraphRenderer.renderGraph() to render selected nodes on top of
unselected
+ * nodes.
*/
Map<Integer, Boolean> selectedMap = new HashMap<Integer, Boolean>();
-
/**
- * Returns the color of node in low detail rendering mode.
- * By default this method returns Color.red. It is an error to return
- * null in this method.<p>
+ * Returns the color of node in low detail rendering mode. By default
this
+ * method returns Color.red. It is an error to return null in this
method.
+ * <p>
* In low detail rendering mode, this is the only method from this class
- * that is looked at. The rest of the methods in this class define
visual
- * properties that are used in full detail rendering mode. In low
detail
+ * that is looked at. The rest of the methods in this class define
visual
+ * properties that are used in full detail rendering mode. In low detail
* rendering mode translucent colors are not supported whereas in full
* detail rendering mode they are.
*/
@@ -152,8 +150,7 @@
/**
* Returns a GraphGraphics.SHAPE_* constant (or a custom node shape
that an
* instance of GraphGraphics understands); this defines the shape that
this
- * node takes.
- * By default this method returns GraphGraphics.SHAPE_RECTANGLE.
+ * node takes. By default this method returns
GraphGraphics.SHAPE_RECTANGLE.
* Take note of certain constraints specified in
* GraphGraphics.drawNodeFull() that pertain to rounded rectangles.
*/
@@ -162,16 +159,16 @@
}
/**
- * Returns the paint of the interior of the node shape. By default this
- * method returns Color.red. It is an error to return null in this
method.
+ * Returns the paint of the interior of the node shape. By default this
+ * method returns Color.red. It is an error to return null in this
method.
*/
public Paint fillPaint(final CyNode node) {
return Color.red;
}
/**
- * Returns the border width of the node shape. By default this method
- * returns zero. Take note of certain constraints specified in
+ * Returns the border width of the node shape. By default this method
+ * returns zero. Take note of certain constraints specified in
* GraphGraphics.drawNodeFull().
*/
public float borderWidth(final CyNode node) {
@@ -179,17 +176,17 @@
}
/**
- * Returns the paint of the border of the node shape. By default this
method
- * returns null. This return value is ignored if borderWidth(node)
- * returns zero; it is an error to return null if borderWidth(node)
returns
- * a value greater than zero.
+ * Returns the paint of the border of the node shape. By default this
method
+ * returns null. This return value is ignored if borderWidth(node)
returns
+ * zero; it is an error to return null if borderWidth(node) returns a
value
+ * greater than zero.
*/
public Paint borderPaint(final CyNode node) {
return Color.DARK_GRAY;
}
/**
- * Returns the number of labels that this node has. By default this
method
+ * Returns the number of labels that this node has. By default this
method
* returns zero.
*/
public int labelCount(final CyNode node) {
@@ -197,27 +194,31 @@
}
/**
- * Returns a label's text. By default this method
- * always returns null. This method is only called by the rendering
engine
- * if labelCount(node) returns a value greater than zero. It is an
error
- * to return null if this method is called by the rendering engine.<p>
- * To specify multiple lines of text in a node label, simply insert the
- * '\n' character between lines of text.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * Returns a label's text. By default this method always returns null.
This
+ * method is only called by the rendering engine if labelCount(node)
returns
+ * a value greater than zero. It is an error to return null if this
method
+ * is called by the rendering engine.
+ * <p>
+ * To specify multiple lines of text in a node label, simply insert the
'\n'
+ * character between lines of text.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
*/
public String labelText(final CyNode node, final int labelInx) {
return null;
}
/**
- * Returns the font to use when rendering this label.
- * By default this method always returns null. This method is only
called
- * by the rendering engine if labelCount(node) returns a value greater
than
- * zero. It is an error to return null if this method is called by the
- * rendering engine.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * Returns the font to use when rendering this label. By default this
method
+ * always returns null. This method is only called by the rendering
engine
+ * if labelCount(node) returns a value greater than zero. It is an
error to
+ * return null if this method is called by the rendering engine.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
*/
public Font labelFont(final CyNode node, final int labelInx) {
return null;
@@ -225,45 +226,49 @@
/**
* Returns an additional scaling factor that is to be applied to the
font
- * used to render this label; this scaling factor, applied to the point
- * size of the font returned by labelFont(node, labelInx), yields a new
- * virtual font that is used to render the text label.
- * By default this method always returns 1.0. This method is only
called
- * by the rendering engine if labelCount(node) returns a value greater
than
- * zero.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * used to render this label; this scaling factor, applied to the point
size
+ * of the font returned by labelFont(node, labelInx), yields a new
virtual
+ * font that is used to render the text label. By default this method
always
+ * returns 1.0. This method is only called by the rendering engine if
+ * labelCount(node) returns a value greater than zero.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
*/
public double labelScaleFactor(final CyNode node, final int labelInx) {
return 1.0d;
}
/**
- * Returns the paint of a text label. By default this method
- * always returns null. This method is only called by the rendering
engine
- * if labelCount(node) returns a value greater than zero. It is an
error to
+ * Returns the paint of a text label. By default this method always
returns
+ * null. This method is only called by the rendering engine if
+ * labelCount(node) returns a value greater than zero. It is an error to
* return null if this method is called by the rendering engine.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
*/
public Paint labelPaint(final CyNode node, final int labelInx) {
return Color.DARK_GRAY;
}
/**
- * By returning one of the ANCHOR_* constants, specifies
- * where on a text label's logical bounds box an anchor point lies.
This
- * <i>text anchor point</i> together with the
- * node anchor point and label offset vector
- * determines where, relative to the node, the text's logical bounds
- * box is to be placed. The text's logical bounds box is placed such
that
- * the label offset vector plus the node anchor point equals the text
anchor
- * point.<p>
- * By default this method always returns ANCHOR_CENTER.
- * This method is only called by the rendering engine if
labelCount(node)
- * returns a value greater than zero.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * By returning one of the ANCHOR_* constants, specifies where on a text
+ * label's logical bounds box an anchor point lies. This <i>text anchor
+ * point</i> together with the node anchor point and label offset vector
+ * determines where, relative to the node, the text's logical bounds
box is
+ * to be placed. The text's logical bounds box is placed such that the
label
+ * offset vector plus the node anchor point equals the text anchor
point.
+ * <p>
+ * By default this method always returns ANCHOR_CENTER. This method is
only
+ * called by the rendering engine if labelCount(node) returns a value
+ * greater than zero.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
* @see #ANCHOR_CENTER
* @see #labelNodeAnchor(int, int)
* @see #labelOffsetVectorX(int, int)
@@ -274,18 +279,20 @@
}
/**
- * By returning one of the ANCHOR_* constants, specifies
- * where on the node's extents rectangle an anchor point lies. This
- * <i>node anchor point</i> together with the text anchor point and
label
- * offset vector determines where, relative to the node, the text's
logical
- * bounds box is to be placed. The text's logical bounds box is placed
- * such that the label offset vector plus the node anchor point equals
the
- * text anchor point.<p>
- * By default this method always returns ANCHOR_CENTER.
- * This method is only called by the rendering engine if
labelCount(node)
- * returns a value greater than zero.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * By returning one of the ANCHOR_* constants, specifies where on the
node's
+ * extents rectangle an anchor point lies. This <i>node anchor point</i>
+ * together with the text anchor point and label offset vector
determines
+ * where, relative to the node, the text's logical bounds box is to be
+ * placed. The text's logical bounds box is placed such that the label
+ * offset vector plus the node anchor point equals the text anchor
point.
+ * <p>
+ * By default this method always returns ANCHOR_CENTER. This method is
only
+ * called by the rendering engine if labelCount(node) returns a value
+ * greater than zero.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
* @see #ANCHOR_CENTER
* @see #labelTextAnchor(int, int)
* @see #labelOffsetVectorX(int, int)
@@ -297,17 +304,19 @@
/**
* Specifies the X component of the vector that separates a text anchor
- * point from a node anchor point.
- * This <i>label offset vector</i> together with the text anchor point
and
- * node anchor point determines where, relative to the node, the text's
- * logical bounds box is to be placed. The text's logical bounds box is
- * placed such that the label offset vector plus the node anchor point
- * equals the text anchor point.<p>
- * By default this method always returns zero.
- * This method is only called by the rendering engine if
labelCount(node)
- * returns a value greater than zero.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * point from a node anchor point. This <i>label offset vector</i>
together
+ * with the text anchor point and node anchor point determines where,
+ * relative to the node, the text's logical bounds box is to be placed.
The
+ * text's logical bounds box is placed such that the label offset vector
+ * plus the node anchor point equals the text anchor point.
+ * <p>
+ * By default this method always returns zero. This method is only
called by
+ * the rendering engine if labelCount(node) returns a value greater than
+ * zero.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
* @see #labelOffsetVectorY(int, int)
* @see #labelTextAnchor(int, int)
* @see #labelNodeAnchor(int, int)
@@ -318,17 +327,19 @@
/**
* Specifies the Y component of the vector that separates a text anchor
- * point from a node anchor point.
- * This <i>label offset vector</i> together with the text anchor point
and
- * node anchor point determines where, relative to the node, the text's
- * logical bounds box is to be placed. The text's logical bounds box is
- * placed such that the label offset vector plus the node anchor point
- * equals the text anchor point.<p>
- * By default this method always returns zero.
- * This method is only called by the rendering engine if
labelCount(node)
- * returns a value greater than zero.
- * @param labelInx a value in the range [0, labelCount(node)-1]
indicating
- * which node label in question.
+ * point from a node anchor point. This <i>label offset vector</i>
together
+ * with the text anchor point and node anchor point determines where,
+ * relative to the node, the text's logical bounds box is to be placed.
The
+ * text's logical bounds box is placed such that the label offset vector
+ * plus the node anchor point equals the text anchor point.
+ * <p>
+ * By default this method always returns zero. This method is only
called by
+ * the rendering engine if labelCount(node) returns a value greater than
+ * zero.
+ *
+ * @param labelInx
+ * a value in the range [0, labelCount(node)-1] indicating
which
+ * node label in question.
* @see #labelOffsetVectorX(int, int)
* @see #labelTextAnchor(int, int)
* @see #labelNodeAnchor(int, int)
@@ -338,14 +349,15 @@
}
/**
- * By returning one of the LABEL_WRAP_JUSTIFY_* constants, determines
- * how to justify a node label spanning multiple lines. The choice
made here
- * does not affect the size of the logical bounding box of a node
label's
- * text. The lines of text are justified within that logical bounding
- * box.<p>
- * By default this method always returns LABEL_WRAP_JUSTIFY_CENTER.
- * This return value is ignored if labelText(node, labelInx) returns a
text
+ * By returning one of the LABEL_WRAP_JUSTIFY_* constants, determines
how to
+ * justify a node label spanning multiple lines. The choice made here
does
+ * not affect the size of the logical bounding box of a node label's
text.
+ * The lines of text are justified within that logical bounding box.
+ * <p>
+ * By default this method always returns LABEL_WRAP_JUSTIFY_CENTER. This
+ * return value is ignored if labelText(node, labelInx) returns a text
* string that does not span multiple lines.
+ *
* @see #LABEL_WRAP_JUSTIFY_CENTER
*/
public byte labelJustify(final CyNode node, final int labelInx) {
@@ -353,13 +365,15 @@
}
/**
- * 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
- * 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.
+ * 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
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 #graphicOffsetVectorY(int, int)
* @see #graphicNodeAnchor(int, int)
*/
@@ -368,13 +382,15 @@
}
/**
- * Specifies the Y 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
- * 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.
+ * Specifies the Y 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
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 #graphicOffsetVectorX(int, int)
* @see #graphicNodeAnchor(int, int)
*/
@@ -382,13 +398,12 @@
return 0.0f;
}
-
/**
- * A thread-safe method returning the number of custom graphics
- * associated with a given Node. If none are associated, zero is
- * returned.
- * NOTE: This method should be abstract, but since it isn't, any real
use should override this
- * method in a subclass.
+ * A thread-safe method returning the number of custom graphics
associated
+ * with a given Node. If none are associated, zero is returned. NOTE:
This
+ * method should be abstract, but since it isn't, any real use should
+ * override this method in a subclass.
+ *
* @see #customGraphics(int)
* @since Cytoscape 2.6
*/
@@ -397,24 +412,33 @@
}
/**
- * Return a non-null, read-only Iterator over all CustomGraphics
contained in this Node.
- * The Iterator will return each CustomGraphic in draw order.
- * The Iterator cannot be used to modify the underlying set of
CustomGraphics.
- * NOTE: This method should be abstract, but since it isn't, any real
use should override this
- * method in a subclass.
- * @return The CustomGraphics Iterator. If no CustomGraphics are
- * associated with this Node, an empty Iterator is returned.
- * @throws UnsupportedOperationException if an attempt is made to use
the Iterator's remove() method.
+ * Return a non-null, read-only Iterator over all CustomGraphics
contained
+ * in this Node. The Iterator will return each CustomGraphic in draw
order.
+ * The Iterator cannot be used to modify the underlying set of
+ * CustomGraphics. NOTE: This method should be abstract, but since it
isn't,
+ * any real use should override this method in a subclass.
+ *
+ * @return The CustomGraphics Iterator. If no CustomGraphics are
associated
+ * with this Node, an empty Iterator is returned.
+ * @throws UnsupportedOperationException
+ * if an attempt is made to use the Iterator's remove()
method.
* @since Cytoscape 2.6
* @see #customGraphicsLock(int)
*/
// Should probably be getCustomGraphics(), but all the methods
// seem to have this form.
- public Iterator<CustomGraphic> customGraphics (final CyNode node) {
+ public Iterator<CustomGraphic> customGraphics(final CyNode node) {
return new Iterator<CustomGraphic>() {
- private Iterator<CustomGraphic> _iterator = new
ArrayList<CustomGraphic>(0).iterator();
- public boolean hasNext() {return _iterator.hasNext();}
- public CustomGraphic next() {return _iterator.next();}
+ private Iterator<CustomGraphic> _iterator = new
ArrayList<CustomGraphic>(0).iterator();
+
+ public boolean hasNext() {
+ return _iterator.hasNext();
+ }
+
+ public CustomGraphic next() {
+ return _iterator.next();
+ }
+
public void remove() {
throw new UnsupportedOperationException();
}
@@ -422,10 +446,11 @@
}
/**
- * Return the object used for synchronizing custom graphics operations
for a given Node.
- * This is used in conjunction with the customGraphics() Iterator to
allow iteration over
- * the custom graphics without fear of the underlying CustomGraphics
mutating.
- * For example:
+ * Return the object used for synchronizing custom graphics operations
for a
+ * given Node. This is used in conjunction with the customGraphics()
+ * Iterator to allow iteration over the custom graphics without fear of
the
+ * underlying CustomGraphics mutating. For example:
+ *
* <PRE>
* NodeDetails nd = ...;
* synchronized (nd.customGraphicsLock(node)) {
@@ -437,8 +462,10 @@
* }
* }
* </PRE>
- * NOTE: This method should be abstract, but since it isn't, any real
use should override this
- * method in a subclass.
+ *
+ * NOTE: This method should be abstract, but since it isn't, any real
use
+ * should override this method in a subclass.
+ *
* @since Cytoscape 2.6
*/
public Object customGraphicsLock(final CyNode node) {
@@ -447,22 +474,23 @@
/**
* Used to set selected state of given node.
- *
- * @param node Integer
- * @param selected Boolean
+ *
+ * @param node
+ * Integer
+ * @param selected
+ * Boolean
*/
public void setSelected(Integer node, Boolean selected) {
selectedMap.put(node, selected);
}
/**
- * Used to get selected state of given node.
- * If node does not exist in map, false is returned.
- *
- * Used in GraphRenderer.renderGraph() to
- * provide rendering of selected nodes above
- * unselected nodes.
+ * Used to get selected state of given node. If node does not exist in
map,
+ * false is returned.
*
+ * Used in GraphRenderer.renderGraph() to provide rendering of selected
+ * nodes above unselected nodes.
+ *
* @return boolean
*/
public boolean getSelected(Integer node) {
@@ -473,16 +501,17 @@
}
/**
- * Returns the label width of the node. By default this method
- * returns 100. Take note of certain constraints specified in
+ * Returns the label width of the node. By default this method returns
100.
+ * Take note of certain constraints specified in
* GraphGraphics.drawNodeFull().
*/
public double labelWidth(final CyNode node) {
return 100.0;
}
-
+
/**
- * Child class should ovrride this method to render correct Nexted
Network Image.
+ * Child class should ovrride this method to render correct Nexted
Network
+ * Image.
*
* @param node
* @return
--
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.