Chart FX for Java 6.5

SoftwareFX.ChartFX
Class UserLegendBox

java.lang.Object
  extended by SoftwareFX.ChartFX.LegendBoxBase
      extended by SoftwareFX.ChartFX.UserLegendBox

public final class UserLegendBox
extends LegendBoxBase

Provides access to the UserLegendBox object.

A legend box is a tool within a chart that contains relevant information to explain what is being depicted in a chart. The user legend box is a chart legend that a developer must configure all legend keys manually. Thus, the user legend box fills the void when a legend is needed, but the series legend and values legends cannot convey the desired information.

The supported members of the UserLegendBox Class allow you to configure and control a legend box any way you feel will benefit the end user of your chart.


Constructor Summary
UserLegendBox()
           
 
Method Summary
 void clear()
          Clears the user legend of all configured settings and values.
 UserLegendBoxItemCollection getItem()
          Allows you to assign attributes directly to a selected user legend box key.
 UserLegendBoxItem getItem(int i)
          Deprecated. You should use getItem() instead.
 TitleDockable getTitles(int n)
          Deprecated. You should use getTitles(int) instead.
 boolean isAutoContourLabels()
          Gets the AutoContourLabels.
 boolean isContinuous()
          Gets the Continuous.
 boolean isEmpty()
          IsEmptyTrue
 boolean isShowMarkers()
          Gets the ShowMarkers.
 void setAutoContourLabels(boolean value)
          Instruct Chart FX to automatically create contour labels for the chart user legend.
 void setContinuous(boolean value)
          Sets the key markers of the user legend box as a single continuous bar with no borders.
 void setEmpty(boolean value)
          A boolean value specifying whether the user legend has been assigned any attributes or not.
 void setShowMarkers(boolean value)
          Allows you to show or hide the markers in the user legend box.
 void sizeToFit()
          Calculates and sets the best-fit size for the UserLegendBox.
 
Methods inherited from class SoftwareFX.ChartFX.LegendBoxBase
getAlignment, getBackColor, getBorderObject, getDocked, getFlags, getFont, getHeight, getHighlight, getTextColor, getTitle, getTitles, getToolBorder, getWidth, invalidate, isAutoSize, isDrawingArea, isVisible, setAlignment, setAutoSize, setBackColor, setBorderObject, setDocked, setDrawingArea, setFlags, setFont, setHeight, setTextColor, setToolBorder, setVisible, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLegendBox

public UserLegendBox()
Method Detail

clear

public void clear()

Clears the user legend of all configured settings and values.

Remarks:
  • Using this method will clear the user legend of any attributes set using the getItem(int) property. The attributes include UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String) and/or UserLegendBoxItem.setMarkerShape(int).

  • To check to see if the user legend has any configured settings or values, you can use the setEmpty(boolean) property.

  • See Also:
    UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setMarkerShape(int), UserLegendBoxItem

    getItem

    public UserLegendBoxItem getItem(int i)
    Deprecated. You should use getItem() instead.

    See Also:
    UserLegendBoxItemCollection

    getItem

    public UserLegendBoxItemCollection getItem()

    Allows you to assign attributes directly to a selected user legend box key.

    Remarks:
  • The Item object is a zero based array which allows you to create and assign attributes to each key that will exist in the user legend box.

  • Every key in the user legend will have an Item index.

  • Please refer to UserLegendBoxItem class for the supported properties.

  • See Also:
    UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setMarkerShape(int), UserLegendBoxItem

    getTitles

    public TitleDockable getTitles(int n)
    Deprecated. You should use getTitles(int) instead.


    isAutoContourLabels

    public boolean isAutoContourLabels()

    Gets the AutoContourLabels. For more detail see setAutoContourLabels(boolean).


    isContinuous

    public boolean isContinuous()

    Gets the Continuous. For more detail see setContinuous(boolean).


    isEmpty

    public boolean isEmpty()
    IsEmptyTrue

    Returns a boolean value specifying whether the user legend has been assigned any attributes or not.

    Remarks:
  • When the return value of this property is True, the user legend has not been assigned any attributes. If False, the user legend has been configured with supported attributes.

  • See Also:
    UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setKeyLabel(java.lang.String), clear(), UserLegendBoxItem

    isShowMarkers

    public boolean isShowMarkers()

    Gets the ShowMarkers. For more detail see setShowMarkers(boolean).


    setAutoContourLabels

    public void setAutoContourLabels(boolean value)

    Instruct Chart FX to automatically create contour labels for the chart user legend.

    Remarks:
  • When set to True, Chart FX will automatically generate contour labels based the chart data when the ChartCore.closeData(int) method is called.

  • You must make the ChartCore.setUserLegendBox(boolean) visible in order to view the contour labels created.

  • Use the ChartCore.setGallery(int) property to set the chart type to Contour.

  • See Also:
    ChartCore.setUserLegendBox(boolean), ChartCore.closeData(int), Chart

    setContinuous

    public void setContinuous(boolean value)

    Sets the key markers of the user legend box as a single continuous bar with no borders.

    Remarks:
  • This property is particularly useful when creating legends for Contour charts. A contour chart uses colors to show the intensity of a value and not the different series. The continuous property helps create a user legend that relays the color and order information clearly.ChartCore.setLegendBox(boolean)ChartCore.setUserLegendBox(boolean)

  • The ShowMarkers property must be set to True in order to see the continuous attribute applied to a user legend.

  • See Also:
    ChartCore.setUserLegendBox(boolean), ChartCore.getUserLegendBoxObj(), setShowMarkers(boolean), UserLegendBoxItem, Chart

    setEmpty

    public void setEmpty(boolean value)

    A boolean value specifying whether the user legend has been assigned any attributes or not.

    Remarks:
  • When the return value of this property is True, the user legend has not been assigned any attributes. If False, the user legend has been configured with supported attributes.

  • See Also:
    UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setKeyLabel(java.lang.String), clear(), UserLegendBoxItem

    setShowMarkers

    public void setShowMarkers(boolean value)

    Allows you to show or hide the markers in the user legend box.

    Remarks:
  • This property can aid in chart readability by associating a legend key with a series color.

  • When you hide the markers by turning this property to False, the configured UserLegendBoxItem.setKeyLabel(java.lang.String) string is displayed.

  • See Also:
    UserLegendBoxItem.setKeyLabel(java.lang.String), setContinuous(boolean), UserLegendBoxItem

    sizeToFit

    public void sizeToFit()

    Calculates and sets the best-fit size for the UserLegendBox.

    Remarks:
  • This method is particularly useful when the AutoSize property is set to False, as it will allow you to recalculate the best-fit size for the UserLegendBox without setting the AutoSize property to True.

  • Overrides:
    sizeToFit in class LegendBoxBase
    See Also:
    LegendBoxBase.setAutoSize(boolean), LegendBox

    http://www.softwarefx.com

    2007 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.