Class Styled

java.lang.Object
edu.cnu.mdi.graphics.style.Styled
All Implemented Interfaces:
IStyled

public class Styled extends Object implements IStyled
An adapter for the IStyled interface.
Author:
heddle
  • Constructor Details

    • Styled

      public Styled()
      Create with all defaults.
    • Styled

      public Styled(int index)
      Generate a sort of random style
      Parameters:
      index - determines the style. Can be any integer
    • Styled

      public Styled(IStyled other)
  • Method Details

    • copy

      public Styled copy()
    • getFillColor

      public Color getFillColor()
      Get the fill color for the symbols
      Specified by:
      getFillColor in interface IStyled
      Returns:
      the fill color for the symbols
    • setTextColor

      public void setTextColor(Color textColor)
      Set the color used for text.
      Specified by:
      setTextColor in interface IStyled
      Parameters:
      textColor - the text color.
    • getTextColor

      public Color getTextColor()
      Get the color used for text.
      Specified by:
      getTextColor in interface IStyled
      Returns:
      the text color.
    • getBorderColor

      public Color getBorderColor()
      Description copied from interface: IStyled
      Get the color used for symbol borders.
      Specified by:
      getBorderColor in interface IStyled
      Returns:
      the symbol border color.
    • getLineColor

      public Color getLineColor()
      Description copied from interface: IStyled
      Get the color used for the primary line (e.g. an item's outline, a curve's fit line, or a connector's stroke, depending on the implementer).
      Specified by:
      getLineColor in interface IStyled
      Returns:
      the line color.
    • getLineStyle

      public LineStyle getLineStyle()
      Description copied from interface: IStyled
      Get the style used for drawing the primary line (see IStyled.getLineColor()).
      Specified by:
      getLineStyle in interface IStyled
      Returns:
      the primary line style.
    • getLineWidth

      public float getLineWidth()
      Description copied from interface: IStyled
      Get the line width for drawing the primary line.
      Specified by:
      getLineWidth in interface IStyled
      Returns:
      the primary line width in pixels.
    • getSymbolType

      public SymbolType getSymbolType()
      Description copied from interface: IStyled
      Get the symbol used for drawing points.
      Specified by:
      getSymbolType in interface IStyled
      Returns:
      the symbol used for drawing points.
    • setFillColor

      public void setFillColor(Color fillColor)
      Description copied from interface: IStyled
      Set the color used for fill the interior area.
      Specified by:
      setFillColor in interface IStyled
      Parameters:
      fillColor - the fill color.
    • setBorderColor

      public void setBorderColor(Color lineColor)
      Description copied from interface: IStyled
      Set the color used for symbol borders.
      Specified by:
      setBorderColor in interface IStyled
      Parameters:
      lineColor - the border color.
    • setLineColor

      public void setLineColor(Color lineColor)
      Description copied from interface: IStyled
      Set the color used for the primary line (see IStyled.getLineColor()).
      Specified by:
      setLineColor in interface IStyled
      Parameters:
      lineColor - the line color.
    • setLineStyle

      public void setLineStyle(LineStyle lineStyle)
      Set the line style
      Specified by:
      setLineStyle in interface IStyled
      Parameters:
      lineStyle - the new line style
    • setLineWidth

      public void setLineWidth(float lineWidth)
      Set the line width. Negative values are clamped to zero.
      Specified by:
      setLineWidth in interface IStyled
      Parameters:
      lineWidth - the new line width
      Throws:
      IllegalArgumentException - if lineWidth is not finite (NaN or infinite)
    • setSymbolType

      public void setSymbolType(SymbolType symbolType)
      Set the symbol type.

      A null argument falls back to SymbolType.NOSYMBOL, not this object's own default (SymbolType.SQUARE, used only for a freshly-constructed Styled) — so passing null here is not equivalent to never having set a symbol type.

      Specified by:
      setSymbolType in interface IStyled
      Parameters:
      symbolType - the new symbol type, or null to select SymbolType.NOSYMBOL
    • getSymbolSize

      public int getSymbolSize()
      Get the symbol size (full width) in pixels.
      Specified by:
      getSymbolSize in interface IStyled
      Returns:
      the symbol size (full width) in pixels.
    • setSymbolSize

      public void setSymbolSize(int symbolSize)
      Set symbol size (full width) in pixels.
      Specified by:
      setSymbolSize in interface IStyled
      Parameters:
      symbolSize - symbol size (full width) in pixels.
    • getAuxLineColor

      public Color getAuxLineColor()
      Description copied from interface: IStyled
      Get the color used for auxiliary lines.
      Specified by:
      getAuxLineColor in interface IStyled
      Returns:
      the auxiliary line color.
    • setAuxLineColor

      public void setAuxLineColor(Color auxColor)
      Description copied from interface: IStyled
      Set the color used for auxiliary lines.
      Specified by:
      setAuxLineColor in interface IStyled
      Parameters:
      auxColor - the auxiliary line color.
    • getAuxLineStyle

      public LineStyle getAuxLineStyle()
      Description copied from interface: IStyled
      Get the style used for drawing auxiliary lines.
      Specified by:
      getAuxLineStyle in interface IStyled
      Returns:
      the auxiliary line style.
    • setAuxLineStyle

      public void setAuxLineStyle(LineStyle lineStyle)
      Description copied from interface: IStyled
      Set the style used for drawing auxiliary lines.
      Specified by:
      setAuxLineStyle in interface IStyled
      Parameters:
      lineStyle - the auxiliary line style.
    • getAuxLineWidth

      public float getAuxLineWidth()
      Description copied from interface: IStyled
      Get the line width for drawing auxiliary lines.
      Specified by:
      getAuxLineWidth in interface IStyled
      Returns:
      the auxiliary line width in pixels.
    • setAuxLineWidth

      public void setAuxLineWidth(float lineWidth)
      Set the auxiliary line width. Negative values are clamped to zero.
      Specified by:
      setAuxLineWidth in interface IStyled
      Parameters:
      lineWidth - the new auxiliary line width
      Throws:
      IllegalArgumentException - if lineWidth is not finite (NaN or infinite)