Documentation of 'org.jplot2d.element.Legend' Java class
Legend
org.jplot2d.element

Interface Legend

    • Method Detail

      • isEnabled

        boolean isEnabled()
        Returns true if this legend is enabled. By default, the legend is enabled.
        Returns:
        the enabled flag.
      • setEnabled

        void setEnabled(boolean enabled)
        Set to true to let this legend to host items. Otherwise the items will be displayed in parent legend. The disabled legend will not show.
        Parameters:
        enabled -
      • getPosition

        LegendPosition getPosition()
        Gets the current position of this legend.
        Returns:
        the position.
      • setPosition

        void setPosition(LegendPosition position)
        Sets the position of this legend. Only when position is LegendPosition.FREE, the legend can be located by setLocation(Point2D), #setHAlign() , #setVAlign().
        Parameters:
        position - the position of this legend.
      • getLocation

        java.awt.geom.Point2D getLocation()
        Gets the location of this legend.
        Specified by:
        getLocation in interface PComponent
        Returns:
        an instance of Point representing the base point of this legend
      • setLocation

        void setLocation(java.awt.geom.Point2D loc)
        Moves this legend to a new location. Setting legend to a new location will change legend position to LegendPosition.FREE
        Specified by:
        setLocation in interface MovableComponent
        Parameters:
        loc - the base point of this legend
      • setLocation

        void setLocation(double x,
                         double y)
        Moves this legend to a new location. Setting legend to a new location will change legend position to LegendPosition.FREE
        Specified by:
        setLocation in interface MovableComponent
        Parameters:
        x - the x-coordinate of the new location
        y - the y-coordinate of the new location
      • getHAlign

        HAlign getHAlign()
        Get the horizontal alignment.
        Returns:
        the horizontal alignment.
      • setHAlign

        void setHAlign(HAlign halign)
        Set the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT. eg, LEFT means the base point is on the left of this legend.

        Notice: This method should be called when the position is LegendPosition.FREE, otherwise the behavior is not defined.

        Parameters:
        halign - horizontal alignment.
      • getVAlign

        VAlign getVAlign()
        Get the vertical alignment.
        Returns:
        the vertical alignment.
      • setVAlign

        void setVAlign(VAlign valign)
        Set the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM. eg, TOP means the base point is on the top of this legend.

        Notice: This method should be called when the position is LegendPosition.FREE, otherwise the behavior is not defined.

        Parameters:
        valign - The vertical alignment.
      • getColumns

        int getColumns()
        Returns the number of columns in the legend item.
        Returns:
        the number of columns
      • setColumns

        void setColumns(int columns)
        Sets the number of columns. This method only take effect when position is LegendPosition.FREE. Otherwise the columns is auto selected.
        Parameters:
        cols - number of columns
      • getRowSpacingFactor

        double getRowSpacingFactor()
        Returns the row spacing factor. The row spacing is factor * row height.
        Returns:
        the row spacing factor
      • setRowSpacingFactor

        void setRowSpacingFactor(double factor)
        Sets the row spacing factor. The row spacing is factor * row height. The default factor is 0.125
        Parameters:
        factor - the row spacing factor
      • isBorderVisible

        boolean isBorderVisible()
        Returns true if the legend border is visible
        Returns:
        true if the legend border is visible
      • setBorderVisible

        void setBorderVisible(boolean visible)
        Sets if the legend border is visible. By default, the legend border is visible.
        Parameters:
        visible - the flag to indicate if the legend border is visible
      • isMovable

        boolean isMovable()
        Description copied from interface: MovableComponent
        Returns true if the component is movable by mouse dragging. Only selectable component can be movable.
        Specified by:
        isMovable in interface MovableComponent
        Returns:
        true if movable
      • setMovable

        void setMovable(boolean movable)
        Description copied from interface: MovableComponent
        Set if the component is movable by mouse dragging.
        Specified by:
        setMovable in interface MovableComponent
        Parameters:
        movable - true if movable
      • getItems

        LegendItem[] getItems()
        Returns all legend items managed by this legend
        Returns:
        items managed by this legend

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.