|
||||||||||
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.CellImageButtonPainter<X,Y>
public class CellImageButtonPainter<X extends java.lang.Number,Y extends java.lang.Number>
Paints an image in the cell. Get cell indexes when given coordinates are inside the cell image. Toggle image
Field Summary |
---|
Constructor Summary | |
---|---|
CellImageButtonPainter(java.lang.String name,
Image buttonImage)
Creates push button behavior using the given image as the button. |
|
CellImageButtonPainter(java.lang.String name,
Image trueImage,
Image falseImage)
Creates toggle button behavior and displaying trueImage when getToggleState(Number, Number) returns Boolean.TRUE ,
falseImage when Boolean.FALSE
and nothing when it returns null . |
Method Summary | |
---|---|
java.lang.Boolean |
getToggleState(X indexX,
Y indexY)
Returns a three state toggle status of the given cell with the following consequences: null - no image displayed true - trueImage displayed false - falseImage displayed |
boolean |
isOverImage(int x,
int y)
Returns true if coordinates are over the image of drawn by this painter, or false otherwise. |
void |
setToggleImages(Image trueImage,
Image falseImage)
|
void |
setupSpatial(X indexX,
Y indexY)
Overrides the default method setting the image related to toggle state. |
Methods inherited from class pl.netanel.swt.matrix.Painter |
---|
align, clean, clipText, computeSize, computeTextSize, dispose, getData, getImageAt, getName, getScope, getZone, hasTreeLinesVisible, init, isEnabled, isTreeEnabled, paint, setData, setEnabled, setNodeImages, setTreeLinesVisible, setTreeVisible, setup, trackPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CellImageButtonPainter(java.lang.String name, Image trueImage, Image falseImage)
getToggleState(Number, Number)
returns Boolean.TRUE
,
falseImage
when Boolean.FALSE
and nothing when it returns null
.
name
- name of the paintertrueImage
- image to display when the toggle is set to truefalseImage
- image to display when the toggle is set to falsepublic CellImageButtonPainter(java.lang.String name, Image buttonImage)
name
- name of the painterbuttonImage
- image to emulate the buttonMethod Detail |
---|
public void setToggleImages(Image trueImage, Image falseImage)
public java.lang.Boolean getToggleState(X indexX, Y indexY)
indexX
- indexY
-
public void setupSpatial(X indexX, Y indexY)
setupSpatial
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 boolean isOverImage(int x, int y)
Axis.getMouseItem()
)
x
- x coordinate relative to the displayy
- y coordinate relative to the display
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |