Package com.biglybt.ui.swt.components
Class Legend
java.lang.Object
com.biglybt.ui.swt.components.Legend
TODO: have a callback when color changes
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.swt.widgets.Composite
createLegendComposite
(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys) Create a legend containing a modifiable color box and descriptionstatic org.eclipse.swt.widgets.Composite
createLegendComposite
(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, boolean horizontal) static org.eclipse.swt.widgets.Composite
createLegendComposite
(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, Object layoutData) static org.eclipse.swt.widgets.Composite
createLegendComposite
(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, String[] key_texts, Object layoutData, boolean horizontal) Create a legend containing a modifiable color box and descriptionstatic org.eclipse.swt.widgets.Composite
createLegendComposite
(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, String[] key_texts, Object layoutData, boolean horizontal, Legend.LegendListener listener) static org.eclipse.swt.graphics.Color
getLegendColor
(String key, String[] keys, org.eclipse.swt.graphics.Color[] defs) private static org.eclipse.swt.graphics.Color
getLegendColor
(String key, org.eclipse.swt.graphics.Color def) private static void
handleHover
(Legend.LegendListener listener, boolean entry, int index, int[] state)
-
Constructor Details
-
Legend
public Legend()
-
-
Method Details
-
createLegendComposite
public static org.eclipse.swt.widgets.Composite createLegendComposite(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys) Create a legend containing a modifiable color box and description- Parameters:
panel
- Where to add legend toblockColors
- array of colors for each legend entry. This array WILL BE modified if the user changes the colorkeys
- array of keys for each legend entry- Returns:
- The composite containing the legend
-
createLegendComposite
public static org.eclipse.swt.widgets.Composite createLegendComposite(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, boolean horizontal) -
createLegendComposite
-
createLegendComposite
public static org.eclipse.swt.widgets.Composite createLegendComposite(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, String[] key_texts, Object layoutData, boolean horizontal) Create a legend containing a modifiable color box and description- Parameters:
panel
- Where to add legend toblockColors
- array of colors for each legend entry. This array WILL BE modified if the user changes the colorkeys
- array of keys for each legend entrylayoutData
- How to layout the legend (ie. GridData, LayoutData, etc)- Returns:
- The composite containing the legend
-
getLegendColor
-
getLegendColor
private static org.eclipse.swt.graphics.Color getLegendColor(String key, org.eclipse.swt.graphics.Color def) -
createLegendComposite
public static org.eclipse.swt.widgets.Composite createLegendComposite(org.eclipse.swt.widgets.Composite panel, org.eclipse.swt.graphics.Color[] blockColors, String[] keys, String[] key_texts, Object layoutData, boolean horizontal, Legend.LegendListener listener) -
handleHover
private static void handleHover(Legend.LegendListener listener, boolean entry, int index, int[] state)
-