Package jexer.effect
Class GradientCellTransform
- java.lang.Object
-
- jexer.effect.GradientCellTransform
-
- All Implemented Interfaces:
CellTransform
public class GradientCellTransform extends java.lang.Object implements CellTransform
GradientCellTransform smoothly changes foreground and/or background color in a rectangular region.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGradientCellTransform.LayerLayer(s) to apply the gradient effect to.
-
Constructor Summary
Constructors Constructor Description GradientCellTransform(GradientCellTransform.Layer layer, java.awt.Color topLeft, java.awt.Color topRight, java.awt.Color bottomLeft, java.awt.Color bottomRight)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyTransform(Backend backend, Cell cell, int x, int y, TWidget widget)Perform some kind of change to a cell, based on its location relative to a widget or the entire screen.voidprepareTransform(Backend backend, TWidget widget)This method is called once before applyTransform() is called on every cell of the widget or screen, providing an opportunity to reduce computations in applyTransform().
-
-
-
Constructor Detail
-
GradientCellTransform
public GradientCellTransform(GradientCellTransform.Layer layer, java.awt.Color topLeft, java.awt.Color topRight, java.awt.Color bottomLeft, java.awt.Color bottomRight)
Public constructor.- Parameters:
layer- layer to apply gradient effect totopLeft- color at the top-left cornertopRight- color at the top-right cornerbottomLeft- color at the bottom-left cornerbottomRight- color at the bottom-right corner
-
-
Method Detail
-
prepareTransform
public void prepareTransform(Backend backend, TWidget widget)
This method is called once before applyTransform() is called on every cell of the widget or screen, providing an opportunity to reduce computations in applyTransform().- Specified by:
prepareTransformin interfaceCellTransform- Parameters:
backend- the backend that will be passed to applyTransform()widget- the widget that will be passed to applyTransform()
-
applyTransform
public void applyTransform(Backend backend, Cell cell, int x, int y, TWidget widget)
Perform some kind of change to a cell, based on its location relative to a widget or the entire screen.- Specified by:
applyTransformin interfaceCellTransform- Parameters:
backend- the backend that can obtain the correct foreground or background color of the cellcell- the cell to alterx- column of the cell. 0 is the left-most column.y- row of the cell. 0 is the top-most row.widget- the widget this cell is on, or null if the transform is relative to the entire screen
-
-