Package cz.vutbr.fit.layout.segm
Class AreaStyle
- java.lang.Object
-
- cz.vutbr.fit.layout.segm.AreaStyle
-
public class AreaStyle extends Object
This class represents the complete style of an area for further comparison.- Author:
- burgetr
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatcomputeColorLuminosity(Area area)doublegetAverageColorLuminosity()doublegetAverageFontSize()doublegetAverageFontStyle()doublegetAverageFontWeight()ColorgetBackgroundColor()static booleanhasConsistentStyle(Area root)Checks whether all children of a given area have a consistent visual style (as defined byhasSameStyle(Area, Area)).static booleanhasEqualBackground(Area a1, Area a2)Checks if two areas have the same background colorstatic booleanhasSameStyle(Area a1, Area a2)Compares two visual areas and checks whether they have the same visual style.booleanisSameStyle(AreaStyle other)Compares two styles and decides if it is the same style.voidsetAverageColorLuminosity(float averageColorLuminosity)voidsetAverageFontSize(float averageFontSize)voidsetAverageFontStyle(float averageFontStyle)voidsetAverageFontWeight(float averageFontWeight)voidsetBackgroundColor(Color backgroundColor)
-
-
-
Method Detail
-
getAverageFontSize
public double getAverageFontSize()
-
setAverageFontSize
public void setAverageFontSize(float averageFontSize)
-
getAverageFontWeight
public double getAverageFontWeight()
-
setAverageFontWeight
public void setAverageFontWeight(float averageFontWeight)
-
getAverageFontStyle
public double getAverageFontStyle()
-
setAverageFontStyle
public void setAverageFontStyle(float averageFontStyle)
-
getAverageColorLuminosity
public double getAverageColorLuminosity()
-
setAverageColorLuminosity
public void setAverageColorLuminosity(float averageColorLuminosity)
-
getBackgroundColor
public Color getBackgroundColor()
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
-
isSameStyle
public boolean isSameStyle(AreaStyle other)
Compares two styles and decides if it is the same style. The thresholds of the style are taken from theConfig.- Parameters:
other- the other area to be compared- Returns:
trueif the areas are considered to have the same style
-
hasSameStyle
public static boolean hasSameStyle(Area a1, Area a2)
Compares two visual areas and checks whether they have the same visual style.- Parameters:
a1- the first area to comparea2- the second area to compare- Returns:
truewhen a2 has the same visual style as a1
-
hasEqualBackground
public static boolean hasEqualBackground(Area a1, Area a2)
Checks if two areas have the same background color- Parameters:
a1- the first area to comparea2- the second area to compare- Returns:
trueif the areas are both transparent or they have the same background color declared
-
hasConsistentStyle
public static boolean hasConsistentStyle(Area root)
Checks whether all children of a given area have a consistent visual style (as defined byhasSameStyle(Area, Area)).- Parameters:
root- The area to test.- Returns:
truewhen the area is a leaf area or all the child areas have a consistent visual style.
-
computeColorLuminosity
public float computeColorLuminosity(Area area)
-
-