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 float
computeColorLuminosity(Area area)
double
getAverageColorLuminosity()
double
getAverageFontSize()
double
getAverageFontStyle()
double
getAverageFontWeight()
Color
getBackgroundColor()
static boolean
hasConsistentStyle(Area root)
Checks whether all children of a given area have a consistent visual style (as defined byhasSameStyle(Area, Area)
).static boolean
hasEqualBackground(Area a1, Area a2)
Checks if two areas have the same background colorstatic boolean
hasSameStyle(Area a1, Area a2)
Compares two visual areas and checks whether they have the same visual style.boolean
isSameStyle(AreaStyle other)
Compares two styles and decides if it is the same style.void
setAverageColorLuminosity(float averageColorLuminosity)
void
setAverageFontSize(float averageFontSize)
void
setAverageFontStyle(float averageFontStyle)
void
setAverageFontWeight(float averageFontWeight)
void
setBackgroundColor(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:
true
if 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:
true
when 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:
true
if 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:
true
when the area is a leaf area or all the child areas have a consistent visual style.
-
computeColorLuminosity
public float computeColorLuminosity(Area area)
-
-