|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.netanel.swt.matrix.Painter<X,Y>
pl.netanel.swt.matrix.reloaded.ButtonCellBehavior<X,Y>
Y
- indexing type for vertical axisX
- indexing type for horizontal axispublic class ButtonCellBehavior<X extends java.lang.Number,Y extends java.lang.Number>
Adds (or replaces) a painter named "button cells" that emulates a raised button shape.
When the cell is clicked the look of the cell becomes flat. Only 2 pixel wide edge of cells is painted so the majority of the output of the underlying Painter.NAME_CELLS painter remains visible. Colors used are SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW, SWT.COLOR_WIDGET_LIGHT_SHADOW and SWT.COLOR_WIDGET_NORMAL_SHADOW. Cells in the zone become not selectable. Usage example:new ButtonCellPainter(matrix.getColumnHeader());
Field Summary |
---|
Constructor Summary | |
---|---|
ButtonCellBehavior(Zone<X,Y> zone)
|
Method Summary | |
---|---|
void |
clean()
Restores the default GC settings modified by modified by in Painter.init()
or Painter.paint(int, int, int, int) . |
void |
handleEvent(Event e)
|
protected boolean |
init()
Allows graphic optimization by performing operation that can be taken out of the cell painting loop. |
protected boolean |
isPushed(X indexX,
Y indexY)
Returns true if the cell at the specified location is in pushed state, or false otherwise. |
static void |
main(java.lang.String[] args)
|
void |
paint(int x,
int y,
int width,
int height)
Draws on the canvas within the given boundaries according to the given indexes. |
protected void |
paintIdle(int x,
int y,
int width,
int height)
Paints the cell when it is in the idle (not pushed) state. |
protected void |
paintPushed(int x,
int y,
int width,
int height)
Paints the cell when it is in the pushed state. |
void |
setup(X indexX,
Y indexY)
Configures the painter properties according to the given indexes. |
Methods inherited from class pl.netanel.swt.matrix.Painter |
---|
align, clipText, computeSize, computeTextSize, dispose, getData, getImageAt, getName, getScope, getZone, hasTreeLinesVisible, isEnabled, isTreeEnabled, setData, setEnabled, setNodeImages, setTreeLinesVisible, setTreeVisible, setupSpatial, trackPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ButtonCellBehavior(Zone<X,Y> zone)
Method Detail |
---|
public void handleEvent(Event e)
protected boolean init()
Painter
Painter.paint(int, int, int, int)
and Painter.clean()
methods will not be executed.
init
in class Painter<X extends java.lang.Number,Y extends java.lang.Number>
clean()
public void setup(X indexX, Y indexY)
Painter
Painter.setupSpatial(Number, Number)
and determines if the cell is selected, therefore when overridden should
call super.setup
.
setup
in class Painter<X extends java.lang.Number,Y extends java.lang.Number>
indexX
- cell index on the horizontal axisindexY
- cell index on the vertical axispublic void paint(int x, int y, int width, int height)
Painter
paint
in class Painter<X extends java.lang.Number,Y extends java.lang.Number>
x
- the x coordinate of the painting boundariesy
- the y coordinate of the painting boundarieswidth
- the width of the painting boundariesheight
- the height of the painting boundariesprotected boolean isPushed(X indexX, Y indexY)
indexX
- index of a section item in the horizontal axisindexY
- index of a section item in the vertical axis.
protected void paintPushed(int x, int y, int width, int height)
x
- the x coordinate of the painting boundariesy
- the y coordinate of the painting boundarieswidth
- the width of the painting boundariesheight
- the height of the painting boundariesprotected void paintIdle(int x, int y, int width, int height)
x
- the x coordinate of the painting boundariesy
- the y coordinate of the painting boundarieswidth
- the width of the painting boundariesheight
- the height of the painting boundariespublic void clean()
Painter
GC
settings modified by modified by in Painter.init()
or Painter.paint(int, int, int, int)
.
clean
in class Painter<X extends java.lang.Number,Y extends java.lang.Number>
init()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |