/** * Get a Java Color object for the given red, green, and blue values * as floating point numbers in the range 0-1.0. * @param r the red color component (in the range 0-1.0) * @param g the green color component (in the range 0-1.0) * @param b the blue color component (in the range 0-1.0) * @return a Java Color object */ public static Color getColor(float r, float g, float b) { return getColor(r,g,b,1.0f); }
/** * Get the color code for the given grayscale value. * @param v the grayscale value (in the range 0-255, 0 is * black and 255 is white) * @return the integer color code */ public static int gray(int v) { return rgba(v, v, v, 255); }
/** * Returns a color palette of default size that ranges from one * given color to the other. * @param c1 the initial color in the color map * @param c2 the final color in the color map * @return the color palette */ public static int[] getInterpolatedPalette(int c1, int c2) { return getInterpolatedPalette(DEFAULT_MAP_SIZE, c1, c2); }
/** * Create a new FruchtermanReingoldLayout * @param graph the data field to layout. Must resolve to a Graph instance. * @param maxIter the maximum number of iterations of the algorithm to run */ public FruchtermanReingoldLayout(String graph, int maxIter) { super(graph); m_nodeGroup = PrefuseLib.getGroupName(graph, Graph.NODES); m_edgeGroup = PrefuseLib.getGroupName(graph, Graph.EDGES); this.maxIter = maxIter; }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. * @param length the array range length to sort over */ public static final void sort(int[] a, int[] b, int length) { mergesort(a, b, 0, length - 1); }
/** * Randomly permute the contents of an array. * @param a the array to shuffle * @param r the source of randomness to use */ public static final void shuffle(long[] a, Random r) { shuffle(a, 0, a.length, r); }
/** * Lookup the value mapped to by the given item. * @param item the item to lookup * @return the result of the rule lookup */ protected Object lookup(VisualItem item) { return (m_chain == null ? null : m_chain.get(item)); }
/** * Get a prefuse configuration property. * @param key the name of the property to lookup * @return the property value, or null if the key is not found */ public static String get(String key) { return s_config.getProperty(key); }
/** * Returns a color map of default size that moves from black to * red to yellow to white. * @return the color palette */ public static int[] getHotPalette() { return getHotPalette(DEFAULT_MAP_SIZE); }
/** * Get a square capped, miter joined, non-dashed stroke of the given width. * @param width the requested stroke width * @return the stroke */ public static BasicStroke getStroke(float width) { return getStroke(width,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER); }
/** * Remove all rule mappings from this encoder. */ public void clear() { if ( m_chain != null ) { m_chain.clear(); } }
/** * Get a Java Color object for the given red, green, and blue values. * @param r the red color component (in the range 0-255) * @param g the green color component (in the range 0-255) * @param b the blue color component (in the range 0-255) * @return a Java Color object */ public static Color getColor(int r, int g, int b) { return getColor(r,g,b,255); }
/** * Get the color code for the given grayscale value. * @param v the grayscale value (in the range 0-255, 0 is * black and 255 is white) * @param a the alpha (transparency) value (in the range 0-255) * @return the integer color code */ public static int gray(int v, int a) { return rgba(v, v, v, a); }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. * @param cmp the comparator to use to compare key values */ public static final void sort(Object[] a, int[] b, Comparator cmp) { mergesort(a, b, 0, a.length - 1, cmp); }
/** * Randomly permute the contents of an array. * @param a the array to shuffle * @param r the source of randomness to use */ public static final void shuffle(Object[] a, Random r) { shuffle(a, 0, a.length, r); }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. */ public static final void sort(int[] a, double[] b) { mergesort(a, b, 0, a.length - 1); }
/** * Randomly permute the contents of an array. * @param a the array to shuffle * @param r the source of randomness to use */ public static final void shuffle(double[] a, Random r) { shuffle(a, 0, a.length, r); }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. * @param begin the start index of the range to sort * @param end the end index, exclusive, of the range to sort */ public static final void sort(int[] a, int[] b, int begin, int end) { mergesort(a, b, begin, end - 1); }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. * @param length the length of the range to be sorted */ public static final void sort(double[] a, int[] b, int length) { mergesort(a, b, 0, length - 1); }
/** * Sort two arrays simultaneously, using the sort order of the values * in the first array to determine the sort order for both arrays. * @param a the array to sort by * @param b the array to re-arrange based on the sort order of the * first array. * @param length the length of the range to be sorted */ public static final void sort(float[] a, int[] b, int length) { mergesort(a, b, 0, length - 1); }