Package edu.cnu.mdi.graphics.style
Class Styled
java.lang.Object
edu.cnu.mdi.graphics.style.Styled
- All Implemented Interfaces:
IStyled
An adapter for the IStyled interface.
- Author:
- heddle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Get the color used for auxiliary lines.Get the style used for drawing auxiliary lines.floatGet the line width for drawing auxiliary lines.Get the color used for symbol borders.Get the fill color for the symbolsGet the color used for the primary line (e.g.Get the style used for drawing the primary line (seeIStyled.getLineColor()).floatGet the line width for drawing the primary line.intGet the symbol size (full width) in pixels.Get the symbol used for drawing points.Get the color used for text.voidsetAuxLineColor(Color auxColor) Set the color used for auxiliary lines.voidsetAuxLineStyle(LineStyle lineStyle) Set the style used for drawing auxiliary lines.voidsetAuxLineWidth(float lineWidth) Set the auxiliary line width.voidsetBorderColor(Color lineColor) Set the color used for symbol borders.voidsetFillColor(Color fillColor) Set the color used for fill the interior area.voidsetLineColor(Color lineColor) Set the color used for the primary line (seeIStyled.getLineColor()).voidsetLineStyle(LineStyle lineStyle) Set the line stylevoidsetLineWidth(float lineWidth) Set the line width.voidsetSymbolSize(int symbolSize) Set symbol size (full width) in pixels.voidsetSymbolType(SymbolType symbolType) Set the symbol type.voidsetTextColor(Color textColor) Set the color used for text.
-
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
-
-
Method Details
-
copy
-
getFillColor
Get the fill color for the symbols- Specified by:
getFillColorin interfaceIStyled- Returns:
- the fill color for the symbols
-
setTextColor
Set the color used for text.- Specified by:
setTextColorin interfaceIStyled- Parameters:
textColor- the text color.
-
getTextColor
Get the color used for text.- Specified by:
getTextColorin interfaceIStyled- Returns:
- the text color.
-
getBorderColor
Description copied from interface:IStyledGet the color used for symbol borders.- Specified by:
getBorderColorin interfaceIStyled- Returns:
- the symbol border color.
-
getLineColor
Description copied from interface:IStyledGet 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:
getLineColorin interfaceIStyled- Returns:
- the line color.
-
getLineStyle
Description copied from interface:IStyledGet the style used for drawing the primary line (seeIStyled.getLineColor()).- Specified by:
getLineStylein interfaceIStyled- Returns:
- the primary line style.
-
getLineWidth
public float getLineWidth()Description copied from interface:IStyledGet the line width for drawing the primary line.- Specified by:
getLineWidthin interfaceIStyled- Returns:
- the primary line width in pixels.
-
getSymbolType
Description copied from interface:IStyledGet the symbol used for drawing points.- Specified by:
getSymbolTypein interfaceIStyled- Returns:
- the symbol used for drawing points.
-
setFillColor
Description copied from interface:IStyledSet the color used for fill the interior area.- Specified by:
setFillColorin interfaceIStyled- Parameters:
fillColor- the fill color.
-
setBorderColor
Description copied from interface:IStyledSet the color used for symbol borders.- Specified by:
setBorderColorin interfaceIStyled- Parameters:
lineColor- the border color.
-
setLineColor
Description copied from interface:IStyledSet the color used for the primary line (seeIStyled.getLineColor()).- Specified by:
setLineColorin interfaceIStyled- Parameters:
lineColor- the line color.
-
setLineStyle
Set the line style- Specified by:
setLineStylein interfaceIStyled- Parameters:
lineStyle- the new line style
-
setLineWidth
public void setLineWidth(float lineWidth) Set the line width. Negative values are clamped to zero.- Specified by:
setLineWidthin interfaceIStyled- Parameters:
lineWidth- the new line width- Throws:
IllegalArgumentException- iflineWidthis not finite (NaN or infinite)
-
setSymbolType
Set the symbol type.A
nullargument falls back toSymbolType.NOSYMBOL, not this object's own default (SymbolType.SQUARE, used only for a freshly-constructedStyled) — so passingnullhere is not equivalent to never having set a symbol type.- Specified by:
setSymbolTypein interfaceIStyled- Parameters:
symbolType- the new symbol type, ornullto selectSymbolType.NOSYMBOL
-
getSymbolSize
public int getSymbolSize()Get the symbol size (full width) in pixels.- Specified by:
getSymbolSizein interfaceIStyled- Returns:
- the symbol size (full width) in pixels.
-
setSymbolSize
public void setSymbolSize(int symbolSize) Set symbol size (full width) in pixels.- Specified by:
setSymbolSizein interfaceIStyled- Parameters:
symbolSize- symbol size (full width) in pixels.
-
getAuxLineColor
Description copied from interface:IStyledGet the color used for auxiliary lines.- Specified by:
getAuxLineColorin interfaceIStyled- Returns:
- the auxiliary line color.
-
setAuxLineColor
Description copied from interface:IStyledSet the color used for auxiliary lines.- Specified by:
setAuxLineColorin interfaceIStyled- Parameters:
auxColor- the auxiliary line color.
-
getAuxLineStyle
Description copied from interface:IStyledGet the style used for drawing auxiliary lines.- Specified by:
getAuxLineStylein interfaceIStyled- Returns:
- the auxiliary line style.
-
setAuxLineStyle
Description copied from interface:IStyledSet the style used for drawing auxiliary lines.- Specified by:
setAuxLineStylein interfaceIStyled- Parameters:
lineStyle- the auxiliary line style.
-
getAuxLineWidth
public float getAuxLineWidth()Description copied from interface:IStyledGet the line width for drawing auxiliary lines.- Specified by:
getAuxLineWidthin interfaceIStyled- 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:
setAuxLineWidthin interfaceIStyled- Parameters:
lineWidth- the new auxiliary line width- Throws:
IllegalArgumentException- iflineWidthis not finite (NaN or infinite)
-