tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / GraphNode.java
index 03b617bbbed462da49fac18e6b81db418323a212..34c79c1cf4239a32d210bd76cc3cc383e443ce7c 100755 (executable)
@@ -1,16 +1,15 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- * 
+ * Copyright (c) 2005, 2012 IBM Corporation, Ericsson
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *
+ * Contributors:
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.core;
 
 import java.util.ArrayList;
@@ -24,10 +23,11 @@ import java.util.Map;
 import org.eclipse.linuxtools.internal.tmf.ui.TmfUiTracer;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.SDViewPref;
 
 /**
  * The base class used for all UML2 graph nodes displayed in the Sequence Diagram SDWidget.
- * 
+ *
  * @author sveyrier
  * @version 1.0
  */
@@ -57,7 +57,7 @@ public abstract class GraphNode {
      */
     protected boolean fFocused = false;
     /**
-     * Flag to indicate whether node has children or not. 
+     * Flag to indicate whether node has children or not.
      */
     protected boolean fHasChilden = false;
     /**
@@ -92,7 +92,7 @@ public abstract class GraphNode {
     // ------------------------------------------------------------------------
     // Methods
     // ------------------------------------------------------------------------
-    
+
     /**
      * Reset the internal index of the first visible GraphNode for each ordered GraphNode lists
      */
@@ -110,7 +110,7 @@ public abstract class GraphNode {
 
     /**
      * Add a GraphNode into the receiver
-     * 
+     *
      * @param nodeToAdd the node to add
      */
     public void addNode(GraphNode nodeToAdd) {
@@ -133,29 +133,29 @@ public abstract class GraphNode {
             fNodes.put(nodeToAdd.getArrayId(), new ArrayList<GraphNode>(1));
             fIndexes.put(nodeToAdd.getArrayId(), Integer.valueOf(0));
             fForwardNodes.put(nodeToAdd.getArrayId(), new ArrayList<GraphNode>(1));
-            fForwardSort.put(nodeToAdd.getArrayId(), Boolean.valueOf(false));
+            fForwardSort.put(nodeToAdd.getArrayId(), Boolean.FALSE);
             if (nodeToAdd.getBackComparator() != null) {
                 fBackwardNodes.put(nodeToAdd.getArrayId(), new ArrayList<GraphNode>(1));
-                fBackwardSort.put(nodeToAdd.getArrayId(), Boolean.valueOf(false));
+                fBackwardSort.put(nodeToAdd.getArrayId(), Boolean.FALSE);
             }
         }
 
-        List<GraphNode> fNodeList = (List<GraphNode>) fForwardNodes.get(nodeToAdd.getArrayId());
+        List<GraphNode> fNodeList = fForwardNodes.get(nodeToAdd.getArrayId());
         List<GraphNode> bNodeList = null;
         if (fBackwardNodes != null) {
-            bNodeList = (List<GraphNode>) fBackwardNodes.get(nodeToAdd.getArrayId());
+            bNodeList = fBackwardNodes.get(nodeToAdd.getArrayId());
         }
         if (fNodeList != null && fNodeList.size() > 0) {
             // check if the nodes are added y ordered
             // if not, tag the list to sort it later (during draw)
-            GraphNode node = (GraphNode) fNodeList.get(fNodeList.size() - 1);
+            GraphNode node = fNodeList.get(fNodeList.size() - 1);
             Comparator<GraphNode> fcomp = nodeToAdd.getComparator();
             Comparator<GraphNode> bcomp = nodeToAdd.getBackComparator();
             if ((fcomp != null) && (fcomp.compare(node, nodeToAdd) > 0)) {
-                fForwardSort.put(nodeToAdd.getArrayId(), Boolean.valueOf(true));
+                fForwardSort.put(nodeToAdd.getArrayId(), Boolean.TRUE);
             }
             if ((bcomp != null) && (bcomp.compare(node, nodeToAdd) > 0)) {
-                fBackwardSort.put(nodeToAdd.getArrayId(), Boolean.valueOf(true));
+                fBackwardSort.put(nodeToAdd.getArrayId(), Boolean.TRUE);
             }
         }
 
@@ -166,7 +166,7 @@ public abstract class GraphNode {
         fNodeList.add(nodeToAdd);
         fNodes.put(nodeToAdd.getArrayId(), fNodeList);
         fForwardNodes.put(nodeToAdd.getArrayId(), fNodeList);
-        if (nodeToAdd.getBackComparator() != null) {
+        if ((bNodeList != null) && (nodeToAdd.getBackComparator() != null)) {
             bNodeList.add(nodeToAdd);
             fBackwardNodes.put(nodeToAdd.getArrayId(), bNodeList);
         }
@@ -175,7 +175,7 @@ public abstract class GraphNode {
     /**
      * Set the graph node name.<br>
      * It is the name display in the view to label the graph node.
-     * 
+     *
      * @param nodeName the name to set
      */
     public void setName(String nodeName) {
@@ -185,7 +185,7 @@ public abstract class GraphNode {
     /**
      * Returns the graph node name.<br>
      * It is the name display in the view to label the graph node.
-     * 
+     *
      * @return the graph node name
      */
     public String getName() {
@@ -196,7 +196,7 @@ public abstract class GraphNode {
      * Tags the the graph node has selected.<br>
      * WARNING: This method is only used to draw the graph node using the system selection colors. <br>
      * To use the complete SDViewer selection mechanism (selection management, notification, etc..) see SDWidget class
-     * 
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#addSelection(GraphNode)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#removeSelection(GraphNode)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#clearSelection()
@@ -210,7 +210,7 @@ public abstract class GraphNode {
      * Tags the the graph node as focused.<br>
      * WARNING: This method is only used to draw the graph node using the system focus style. <br>
      * To use the complete SDViewer focus mechanism see SDWidget class
-     * 
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#addSelection(GraphNode)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#removeSelection(GraphNode)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget#clearSelection()
@@ -223,7 +223,7 @@ public abstract class GraphNode {
     /**
      * Returns true if the graph node is selected, false otherwise.<br>
      * The returned value is used to highlight the graph node in the View.
-     * 
+     *
      * @return true if selected, false otherwise
      */
     public boolean isSelected() {
@@ -233,75 +233,83 @@ public abstract class GraphNode {
     /**
      * Returns true if the graph node is focused, false otherwise.<br>
      * The returned value is used to highlight the graph node in the View.
-     * 
-     * @return true if focued, false otherwise
+     *
+     * @return true if focused, false otherwise
      */
     public boolean hasFocus() {
         return fFocused;
     }
 
     /**
-     * Returns true if the graph node contains the point given in parameter, return false otherwise.
-     * 
-     * @param x the x coordinate of the point to test containment <br>
-     *            y the y coordinate of the point to test containment
+     * Returns true if the graph node contains the point given in parameter,
+     * return false otherwise.
+     *
+     * @param x
+     *            the x coordinate of the point to test containment
+     * @param y
+     *            the y coordinate of the point to test containment
      * @return true if contained, false otherwise
      */
     abstract public boolean contains(int x, int y);
 
     /**
      * Returns the x coordinate of the graph node
-     * 
+     *
      * @return the x coordinate
      */
     abstract public int getX();
 
     /**
      * Returns the y coordinate of the graph node
-     * 
+     *
      * @return the y coordinate
      */
     abstract public int getY();
 
     /**
      * Returns the graph node height
-     * 
+     *
      * @return the graph node height
      */
     abstract public int getHeight();
 
     /**
      * Returns the graph node width
-     * 
+     *
      * @return the graph node width
      */
     abstract public int getWidth();
 
     /**
      * Draws the graph node in the given context
-     * 
+     *
      * @param context the graphical context to draw in
      */
     abstract protected void draw(IGC context);
 
     /**
-     * Returns the GraphNode visibility for the given visible area. Wrong visibility calculation, may strongly impact
-     * drawing performance
-     * 
+     * Returns the GraphNode visibility for the given visible area. Wrong
+     * visibility calculation, may strongly impact drawing performance
+     *
      * @param x
+     *            The X coordinate
      * @param y
+     *            The Y coordinate
      * @param width
+     *            The width of the area
      * @param height
-     * @return true if visible false otherwise
+     *            The height of the area
+     * @return true if visible, false otherwise
      */
     public boolean isVisible(int x, int y, int width, int height) {
         return true;
     }
 
     /**
-     * Return a comparator to sort the GraphNode of the same type This comparator is used to order the GraphNode array
-     * of the given node type. (see getArrayId).
-     * 
+     * Return a comparator to sort the GraphNode of the same type This
+     * comparator is used to order the GraphNode array of the given node type.
+     * (see getArrayId).
+     *
      * @return the comparator
      */
     public Comparator<GraphNode> getComparator() {
@@ -309,8 +317,9 @@ public abstract class GraphNode {
     }
 
     /**
-     * If needed, return a different comparator to backward scan the GraphNode array
-     * 
+     * If needed, return a different comparator to backward scan the GraphNode
+     * array
+     *
      * @return the backward comparator or null if not needed
      */
     public Comparator<GraphNode> getBackComparator() {
@@ -319,8 +328,9 @@ public abstract class GraphNode {
 
     /**
      * Compare two graphNodes
-     * 
-     * @param node the node to compare to
+     *
+     * @param node
+     *            the node to compare to
      * @return true if equal false otherwise
      */
     public boolean isSameAs(GraphNode node) {
@@ -330,14 +340,14 @@ public abstract class GraphNode {
     /**
      * Return the node type for all class instances. This id is used to store the same nodes kind in the same ordered
      * array.
-     * 
+     *
      * @return the node type identifier
      */
     abstract public String getArrayId();
 
     /**
      * Return true if the distance from the GraphNode to the given point is positive
-     * 
+     *
      * @param x the point x coordinate
      * @param y the point y coordinate
      * @return true if positive false otherwise
@@ -349,7 +359,7 @@ public abstract class GraphNode {
     /**
      * Returns the graph node which contains the point given in parameter WARNING: Only graph nodes in the current
      * visible area can be returned
-     * 
+     *
      * @param x the x coordinate of the point to test
      * @param y the y coordinate of the point to test
      * @return the graph node containing the point given in parameter, null otherwise
@@ -365,8 +375,8 @@ public abstract class GraphNode {
         GraphNode node = null;
         while (it.hasNext()) {
             Object nodeType = it.next();
-            List<GraphNode> list = (List<GraphNode>) fNodes.get(nodeType);
-            int index = ((Integer) fIndexes.get(nodeType)).intValue();
+            List<GraphNode> list = fNodes.get(nodeType);
+            int index = fIndexes.get(nodeType).intValue();
             node = getNodeFromListAt(x, y, list, index);
             if (toReturn == null) {
                 toReturn = node;
@@ -419,12 +429,12 @@ public abstract class GraphNode {
         Iterator<String> it = fNodes.keySet().iterator();
         while (it.hasNext()) {
             Object nodeType = it.next();
-            List<GraphNode> nodesList = (List<GraphNode>) fNodes.get(nodeType);
+            List<GraphNode> nodesList = fNodes.get(nodeType);
             if (nodesList == null || nodesList.isEmpty()) {
                 return null;
             }
             for (int i = 0; i < nodesList.size(); i++) {
-                GraphNode node = (GraphNode) nodesList.get(i);
+                GraphNode node = nodesList.get(i);
                 int nw = node.getWidth();
                 int nh = node.getHeight();
                 int nx = node.getX();
@@ -446,7 +456,7 @@ public abstract class GraphNode {
      * Returns the graph node which contains the point given in parameter for the given graph node list and starting the
      * iteration at the given index<br>
      * WARNING: Only graph nodes with smaller coordinates than the current visible area can be returned.<br>
-     * 
+     *
      * @param x the x coordinate of the point to test
      * @param y the y coordinate of the point to test
      * @param list the list to search in
@@ -458,7 +468,7 @@ public abstract class GraphNode {
             return null;
         }
         for (int i = fromIndex; i < list.size(); i++) {
-            GraphNode node = (GraphNode) list.get(i);
+            GraphNode node = list.get(i);
             if (node.contains(x, y)) {
                 return node;
             }
@@ -468,7 +478,7 @@ public abstract class GraphNode {
 
     /**
      * Returns the start event occurrence attached to this graphNode.
-     * 
+     *
      * @return the start event occurrence attached to the graphNode
      */
     public int getStartOccurrence() {
@@ -477,7 +487,7 @@ public abstract class GraphNode {
 
     /**
      * Returns the end event occurrence attached to this graphNode
-     * 
+     *
      * @return the start event occurrence attached to the graphNode
      */
     public int getEndOccurrence() {
@@ -487,7 +497,7 @@ public abstract class GraphNode {
     /**
      * Computes the index of the first visible GraphNode for each ordered graph node lists depending on the visible area
      * given in parameter
-     * 
+     *
      * @param x visible area top left corner x coordinate
      * @param y visible area top left corner y coordinate
      * @param width visible area width
@@ -506,12 +516,12 @@ public abstract class GraphNode {
         while (it.hasNext()) {
             String nodeType = it.next();
             int direction = 1;
-            int drawIndex = ((Integer) fIndexes.get(nodeType)).intValue();
+            int drawIndex = fIndexes.get(nodeType).intValue();
             /*
              * if (x==0) { drawIndex = 0; indexes.put(nodeType,new Integer(drawIndex)); }
              */
-            if ((fNodes.get(nodeType) != null) && (((List<GraphNode>) fNodes.get(nodeType)).size() > 1)) {
-                if (((GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(drawIndex)).positiveDistanceToPoint(x, y)) {
+            if ((fNodes.get(nodeType) != null) && (fNodes.get(nodeType).size() > 1)) {
+                if (fNodes.get(nodeType).get(drawIndex).positiveDistanceToPoint(x, y)) {
                     direction = -1;
                 }
 
@@ -520,23 +530,24 @@ public abstract class GraphNode {
                 }
 
                 if ((direction == -1) && (fBackwardNodes.get(nodeType) != null)) {
-                    GraphNode currentNode = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(drawIndex);
-                    drawIndex = Arrays.binarySearch(((List<GraphNode>) fBackwardNodes.get(nodeType)).toArray(new GraphNode[0]), ((List<GraphNode>) fNodes.get(nodeType)).get(drawIndex), currentNode.getBackComparator());
-                    fNodes.put(nodeType, (List<GraphNode>) fBackwardNodes.get(nodeType));
+                    GraphNode currentNode = fNodes.get(nodeType).get(drawIndex);
+                    drawIndex = Arrays.binarySearch(fBackwardNodes.get(nodeType).toArray(new GraphNode[fBackwardNodes.get(nodeType).size()]),
+                            fNodes.get(nodeType).get(drawIndex), currentNode.getBackComparator());
+                    fNodes.put(nodeType, fBackwardNodes.get(nodeType));
                     if (drawIndex < 0) {
                         drawIndex = 0;
                         direction = 1;
                     } else {
-                        fNodes.put(nodeType, (List<GraphNode>) fBackwardNodes.get(nodeType));
+                        fNodes.put(nodeType, fBackwardNodes.get(nodeType));
                     }
                 }
                 GraphNode prev = null;
 
-                for (int i = drawIndex; i < ((List<GraphNode>) fNodes.get(nodeType)).size() && i >= 0; i = i + direction) {
+                for (int i = drawIndex; i < fNodes.get(nodeType).size() && i >= 0; i = i + direction) {
                     drawIndex = i;
                     fIndexes.put(nodeType, Integer.valueOf(i));
 
-                    GraphNode currentNode = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(i);
+                    GraphNode currentNode = fNodes.get(nodeType).get(i);
 
                     if (prev == null) {
                         prev = currentNode;
@@ -550,15 +561,15 @@ public abstract class GraphNode {
                         sort = fBackwardSort;
                     }
 
-                    if (i < ((List<GraphNode>) fNodes.get(nodeType)).size() - 1) {
-                        GraphNode next = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(i + 1);
+                    if (i < fNodes.get(nodeType).size() - 1) {
+                        GraphNode next = fNodes.get(nodeType).get(i + 1);
 
                         if ((comp != null) && (comp.compare(currentNode, next) > 0)) {
-                            sort.put(nodeType, Boolean.valueOf(true));
+                            sort.put(nodeType, Boolean.TRUE);
                         }
                     }
                     if (direction == 1) {
-                        if (((GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(i)).positiveDistanceToPoint(x, y)) {
+                        if (fNodes.get(nodeType).get(i).positiveDistanceToPoint(x, y)) {
                             break;
                         }
                     } else {
@@ -582,10 +593,10 @@ public abstract class GraphNode {
                 fNodes.put(nodeType, fForwardNodes.get(nodeType));
                 if ((fBackwardNodes.get(nodeType) != null) && (direction == -1)) {
                     // nodes.put(nodeType,fnodes.get(nodeType));
-                    int index = ((Integer) fIndexes.get(nodeType)).intValue();
-                    List<GraphNode> list = (List<GraphNode>) fNodes.get(nodeType);
-                    List<GraphNode> backList = (List<GraphNode>) fBackwardNodes.get(nodeType);
-                    GraphNode currentNode = (GraphNode) (backList.get(index));
+                    int index = fIndexes.get(nodeType).intValue();
+                    List<GraphNode> list = fNodes.get(nodeType);
+                    List<GraphNode> backList = fBackwardNodes.get(nodeType);
+                    GraphNode currentNode = (backList.get(index));
                     if (index > 0) {
                         index = Arrays.binarySearch(list.toArray(new GraphNode[list.size()]), backList.get(index), currentNode.getComparator());
                         if (index < 0) {
@@ -595,8 +606,8 @@ public abstract class GraphNode {
                     }
                 }
 
-                for (int i = drawIndex; i < ((List<GraphNode>) fNodes.get(nodeType)).size() && i >= 0; i++) {
-                    GraphNode toDraw = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(i);
+                for (int i = drawIndex; i < fNodes.get(nodeType).size() && i >= 0; i++) {
+                    GraphNode toDraw = fNodes.get(nodeType).get(i);
                     toDraw.updateIndex(x, y, width, height);
                     if (!toDraw.isVisible(x, y, width, height)) {
                         break;
@@ -604,7 +615,7 @@ public abstract class GraphNode {
                 }
             }
             if (TmfUiTracer.isIndexTraced()) {
-                TmfUiTracer.traceIndex("First drawn " + nodeType + " index = " + drawIndex + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$          
+                TmfUiTracer.traceIndex("First drawn " + nodeType + " index = " + drawIndex + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                 TmfUiTracer.traceIndex(nodeType + " found in " + 0 + " iterations\n"); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
@@ -618,7 +629,7 @@ public abstract class GraphNode {
      * Draws the children nodes on the given context.<br>
      * This method start width GraphNodes ordering if needed.<br>
      * After, depending on the visible area, only visible GraphNodes are drawn.<br>
-     * 
+     *
      * @param context the context to draw to
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#draw(IGC)
      */
@@ -631,12 +642,12 @@ public abstract class GraphNode {
         Iterator<String> it = fForwardSort.keySet().iterator();
         while (it.hasNext()) {
             String nodeType = it.next();
-            boolean sort = ((Boolean) fForwardSort.get(nodeType)).booleanValue();
+            boolean sort = fForwardSort.get(nodeType).booleanValue();
             if (sort) {
-                GraphNode[] temp = ((List<GraphNode>) fForwardNodes.get(nodeType)).toArray(new GraphNode[((List<GraphNode>)fForwardNodes.get(nodeType)).size()]);
-                GraphNode node = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(0);
+                GraphNode[] temp = fForwardNodes.get(nodeType).toArray(new GraphNode[fForwardNodes.get(nodeType).size()]);
+                GraphNode node = fNodes.get(nodeType).get(0);
                 Arrays.sort(temp, node.getComparator());
-                fForwardSort.put(nodeType, Boolean.valueOf(false));
+                fForwardSort.put(nodeType, Boolean.FALSE);
                 fNodes.put(nodeType, Arrays.asList(temp));
                 fForwardNodes.put(nodeType, Arrays.asList(temp));
                 if (TmfUiTracer.isSortingTraced()) {
@@ -648,12 +659,12 @@ public abstract class GraphNode {
         Iterator<String> it2 = fBackwardSort.keySet().iterator();
         while (it2.hasNext()) {
             String nodeType = it2.next();
-            boolean sort = ((Boolean) fBackwardSort.get(nodeType)).booleanValue();
+            boolean sort = fBackwardSort.get(nodeType).booleanValue();
             if (sort) {
-                GraphNode[] temp = ((List<GraphNode>) fBackwardNodes.get(nodeType)).toArray(new GraphNode[((List<GraphNode>) fBackwardNodes.get(nodeType)).size()]);
-                GraphNode node = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(0);
+                GraphNode[] temp = fBackwardNodes.get(nodeType).toArray(new GraphNode[fBackwardNodes.get(nodeType).size()]);
+                GraphNode node = fNodes.get(nodeType).get(0);
                 Arrays.sort(temp, node.getBackComparator());
-                fBackwardSort.put(nodeType, Boolean.valueOf(false));
+                fBackwardSort.put(nodeType, Boolean.FALSE);
                 fBackwardNodes.put(nodeType, Arrays.asList(temp));
                 if (TmfUiTracer.isSortingTraced()) {
                     TmfUiTracer.traceSorting(nodeType + " back array sorted\n"); //$NON-NLS-1$
@@ -675,10 +686,10 @@ public abstract class GraphNode {
         while (it3.hasNext()) {
             count = 0;
             Object nodeType = it3.next();
-            GraphNode node = (GraphNode) ((List<GraphNode>) fNodes.get(nodeType)).get(0);
-            context.setFont(Frame.getUserPref().getFont(node.fPrefId));
-            int index = ((Integer) fIndexes.get(nodeType)).intValue();
-            count = drawNodes(context, (List<GraphNode>) fNodes.get(nodeType), index, arrayStep);
+            GraphNode node = fNodes.get(nodeType).get(0);
+            context.setFont(SDViewPref.getInstance().getFont(node.fPrefId));
+            int index = fIndexes.get(nodeType).intValue();
+            count = drawNodes(context, fNodes.get(nodeType), index, arrayStep);
             if (TmfUiTracer.isDisplayTraced()) {
                 TmfUiTracer.traceDisplay(count + " " + nodeType + " drawn, starting from index " + index + "\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             }
@@ -691,7 +702,7 @@ public abstract class GraphNode {
 
     /**
      * Draw the GraphNode stored in the given list, starting at index startIndex with the given step
-     * 
+     *
      * @param context the context to draw to
      * @param list the GraphNodes list
      * @param startIndex the start index
@@ -709,15 +720,15 @@ public abstract class GraphNode {
             return 0;
         }
 
-        GraphNode node = (GraphNode) list.get(0);
-        context.setFont(Frame.getUserPref().getFont(node.fPrefId));
+        GraphNode node = list.get(0);
+        context.setFont(SDViewPref.getInstance().getFont(node.fPrefId));
         Comparator<GraphNode> comparator = node.getComparator();
         for (int i = startIndex; i < list.size(); i = i + step) {
-            GraphNode toDraw = (GraphNode) list.get(i);
+            GraphNode toDraw = list.get(i);
             if (i < list.size() - 1) {
-                GraphNode next = (GraphNode) list.get(i + 1);
+                GraphNode next = list.get(i + 1);
                 if ((comparator != null) && (comparator.compare(toDraw, next) > 0)) {
-                    fForwardSort.put(next.getArrayId(), Boolean.valueOf(true));
+                    fForwardSort.put(next.getArrayId(), Boolean.TRUE);
                 }
             }
             int cx = context.getContentsX();
@@ -731,7 +742,7 @@ public abstract class GraphNode {
             // ***Common*** nodes visibility
             if ((!toDraw.isSameAs(last) || toDraw.isSelected()) && (toDraw.isVisible(context.getContentsX(), context.getContentsY(), context.getVisibleWidth(), context.getVisibleHeight()))) {
                 nodesCount++;
-                
+
                 toDraw.draw(context);
                 if (hasFocus()) {
                     toDraw.drawFocus(context);
@@ -744,7 +755,9 @@ public abstract class GraphNode {
 
     /**
      * Draws the focus within the graphical context.
+     *
      * @param context
+     *            The context
      */
     public void drawFocus(IGC context) {
         context.drawFocus(getX(), getY(), getWidth(), getHeight());
@@ -752,7 +765,7 @@ public abstract class GraphNode {
 
     /**
      * Determine if the given point (px,py) is contained in the rectangle (x,y,width,height)
-     * 
+     *
      * @param x the rectangle x coordinate
      * @param y the rectangle y coordinate
      * @param width the rectangle width
This page took 0.03283 seconds and 5 git commands to generate.