Esempio n. 1
0
 /**
  * Returns a <code>Color</code> which would be used as the node color under normal circumstances
  * (e.g. node is not selected)
  *
  * @param p Contains various display properties for the node in question.
  * @return <code>Color</code> to be used as display color.
  */
 private Color guessColor(NodeRenderingProperty p) {
   if (p.overriddenColor != null) {
     return p.overriddenColor;
   } else {
     @SuppressWarnings("unchecked")
     NodeColorData vals = (NodeColorData) p.pluginStore.get(this);
     float voltagePercent = (float) (vals.importance / maxImportance);
     float degreePercent = ((float) vals.degree) / maxDegree;
     return nodeColors.getColor(p.node, cm, voltagePercent, degreePercent);
   }
 }