Documentation of 'org.jplot2d.element.impl.LegendImpl' Java class
LegendImpl
org.jplot2d.element.impl

Class LegendImpl

    • Constructor Detail

      • LegendImpl

        public LegendImpl()
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Element
        Returns the id string of this element
        Specified by:
        getId in interface Element
        Returns:
        the id string
      • getInvokeStepFormParent

        public InvokeStep getInvokeStepFormParent()
        Description copied from interface: ElementEx
        Return the invoke step to get this object from its parent.
        Specified by:
        getInvokeStepFormParent in interface ElementEx
        Returns:
        the invoke step
      • canContribute

        public boolean canContribute()
        Description copied from interface: ComponentEx
        Returns true if this component can contribute visible parts to plot rendering artifact when this component is visible. Subcomponents are not considered.
        Specified by:
        canContribute in interface ComponentEx
        Overrides:
        canContribute in class ComponentImpl
        Returns:
        the indicator
      • setVisible

        public void setVisible(boolean visible)
        Description copied from interface: PComponent
        Shows or hides this component depending on the value of parameter b.
        Specified by:
        setVisible in interface PComponent
        Overrides:
        setVisible in class ComponentImpl
        Parameters:
        visible - if true, shows this component; otherwise, hides this component
        See Also:
        PComponent.isVisible()
      • thisEffectiveColorChanged

        public void thisEffectiveColorChanged()
        Description copied from interface: ComponentEx
        Called when setColor() or parentEffectiveColorChanged() change the effective color of this component.
        Specified by:
        thisEffectiveColorChanged in interface ComponentEx
      • thisEffectiveFontChanged

        public void thisEffectiveFontChanged()
        Description copied from interface: ComponentEx
        Called when setFontXxx() or parentEffectiveFontChanged() change the effective font of this component.
        Specified by:
        thisEffectiveFontChanged in interface ComponentEx
      • getSize

        public java.awt.geom.Dimension2D getSize()
        Description copied from interface: PComponent
        Returns the paper size of this component.
        Specified by:
        getSize in interface PComponent
        Returns:
      • getBounds

        public java.awt.geom.Rectangle2D getBounds()
        Description copied from interface: PComponent
        Returns the paper bounds relative to its location. The units of bounds is pt (1/72 inch)
        Specified by:
        getBounds in interface PComponent
        Overrides:
        getBounds in class ComponentImpl
        Returns:
        the paper bounds of this component.
      • getLocation

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

        public void setLocation(java.awt.geom.Point2D loc)
        Description copied from interface: Legend
        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 Legend
        Specified by:
        setLocation in interface MovableComponent
        Parameters:
        loc - the base point of this legend
      • setLocation

        public void setLocation(double locX,
                                double locY)
        Description copied from interface: Legend
        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 Legend
        Specified by:
        setLocation in interface MovableComponent
        Parameters:
        locX - the x-coordinate of the new location
        locY - the y-coordinate of the new location
      • directLocation

        public void directLocation(double locX,
                                   double locY)
        Description copied from interface: LegendEx
        Sets the location without setting the position to Position.FREE
        Specified by:
        directLocation in interface LegendEx
      • getPosition

        public LegendPosition getPosition()
        Description copied from interface: Legend
        Gets the current position of this legend.
        Specified by:
        getPosition in interface Legend
        Returns:
        the position.
      • getHAlign

        public HAlign getHAlign()
        Description copied from interface: Legend
        Get the horizontal alignment.
        Specified by:
        getHAlign in interface Legend
        Returns:
        the horizontal alignment.
      • setHAlign

        public void setHAlign(HAlign halign)
        Description copied from interface: Legend
        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.

        Specified by:
        setHAlign in interface Legend
        Parameters:
        halign - horizontal alignment.
      • getVAlign

        public VAlign getVAlign()
        Description copied from interface: Legend
        Get the vertical alignment.
        Specified by:
        getVAlign in interface Legend
        Returns:
        the vertical alignment.
      • setVAlign

        public void setVAlign(VAlign valign)
        Description copied from interface: Legend
        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.

        Specified by:
        setVAlign in interface Legend
        Parameters:
        valign - The vertical alignment.
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: Legend
        Returns true if this legend is enabled. By default, the legend is enabled.
        Specified by:
        isEnabled in interface Legend
        Returns:
        the enabled flag.
      • setEnabled

        public void setEnabled(boolean enabled)
        Description copied from interface: Legend
        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.
        Specified by:
        setEnabled in interface Legend
      • putItemsToEnabledLegend

        public void putItemsToEnabledLegend()
        Description copied from interface: LegendEx
        Put all items in this disabled legend to enabled upper legend
        Specified by:
        putItemsToEnabledLegend in interface LegendEx
      • getColumns

        public int getColumns()
        Description copied from interface: Legend
        Returns the number of columns in the legend item.
        Specified by:
        getColumns in interface Legend
        Returns:
        the number of columns
      • setColumns

        public void setColumns(int columns)
        Description copied from interface: Legend
        Sets the number of columns. This method only take effect when position is LegendPosition.FREE. Otherwise the columns is auto selected.
        Specified by:
        setColumns in interface Legend
      • getRowSpacingFactor

        public double getRowSpacingFactor()
        Description copied from interface: Legend
        Returns the row spacing factor. The row spacing is factor * row height.
        Specified by:
        getRowSpacingFactor in interface Legend
        Returns:
        the row spacing factor
      • setRowSpacingFactor

        public void setRowSpacingFactor(double factor)
        Description copied from interface: Legend
        Sets the row spacing factor. The row spacing is factor * row height. The default factor is 0.125
        Specified by:
        setRowSpacingFactor in interface Legend
        Parameters:
        factor - the row spacing factor
      • isBorderVisible

        public boolean isBorderVisible()
        Description copied from interface: Legend
        Returns true if the legend border is visible
        Specified by:
        isBorderVisible in interface Legend
        Returns:
        true if the legend border is visible
      • setBorderVisible

        public void setBorderVisible(boolean visible)
        Description copied from interface: Legend
        Sets if the legend border is visible. By default, the legend border is visible.
        Specified by:
        setBorderVisible in interface Legend
        Parameters:
        visible - the flag to indicate if the legend border is visible
      • getItems

        public LegendItemEx[] getItems()
        Description copied from interface: LegendEx
        Returns all legend items managed by this legend
        Specified by:
        getItems in interface LegendEx
        Specified by:
        getItems in interface Legend
        Returns:
        items managed by this legend
      • addLegendItem

        public void addLegendItem(LegendItemEx item)
        Description copied from interface: LegendEx
        Add the given item to this legend. If this legend is disabled, the item should be added to its upper level legend. This method will set the legend property of added legend item to the actual hosting legend.
        Specified by:
        addLegendItem in interface LegendEx
        Parameters:
        item - the legend item to be added
      • removeLegendItem

        public void removeLegendItem(LegendItemEx item)
        Description copied from interface: LegendEx
        Remove the given item from this legend. If this legend is disabled, the item should be removed from its upper level legend.
        Specified by:
        removeLegendItem in interface LegendEx
        Parameters:
        item - the legend item to be removed
      • itemVisibilityChanged

        public void itemVisibilityChanged(LegendItemImpl item)
        Description copied from interface: LegendEx
        Called by a legend item to notify this legend that the item's visibility is changed. An item is shown when both visibility and contributivity are true.
        Specified by:
        itemVisibilityChanged in interface LegendEx
      • itemContribitivityChanged

        public void itemContribitivityChanged(LegendItemImpl item)
        Description copied from interface: LegendEx
        Called by a legend item to notify that the item's contributivity is changed. An item is shown when both visibility and contributivity are true.
        Specified by:
        itemContribitivityChanged in interface LegendEx
      • itemSizeChanged

        public void itemSizeChanged(LegendItemEx item)
        Description copied from interface: LegendEx
        Called by a visible legend item to notify this legend that the item's size is changed.
        Specified by:
        itemSizeChanged in interface LegendEx
      • copyFrom

        public void copyFrom(ElementEx src)
        Description copied from interface: ElementEx
        Copies all properties from given src to this element. Notice properties of sub-elements are not copied over.
        Specified by:
        copyFrom in interface ElementEx
        Overrides:
        copyFrom in class ComponentImpl
        Parameters:
        src - the src
      • getThickness

        public double getThickness()
        Description copied from interface: LegendEx
        Returns the thickness of this legend. When position is on top or bottom, thickness is its height. When position is on left or right, thickness is its width.
        Specified by:
        getThickness in interface LegendEx
        Returns:
        the thickness of this legend
      • calcSize

        public void calcSize()
        Description copied from interface: LegendEx
        Calculate size of this legend and re-layout legend items. This method is always called by plot when committing changes.
        Specified by:
        calcSize in interface LegendEx
      • draw

        public void draw(java.awt.Graphics2D graphics)
        Description copied from interface: ComponentEx
        Draw this component only. All its children is not drawn.
        Specified by:
        draw in interface ComponentEx
        Parameters:
        graphics - to the Graphics2D drawing. The transformation of this component is not applied.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.