public class CellImageButtonPainter<X extends java.lang.Number,Y extends java.lang.Number> extends Painter<X,Y>
collapsedImage, expanded, expandedImage, frozenX, frozenY, gc, hasChildren, image, isSelected, NAME_BACKGORUND, NAME_CELLS, NAME_DRAG_ITEM_X, NAME_DRAG_ITEM_Y, NAME_EMBEDDED_CONTROLS, NAME_EMULATED_CONTROLS, NAME_FOCUS_CELL, NAME_FREEZE_HEAD_LINE_X, NAME_FREEZE_HEAD_LINE_Y, NAME_FREEZE_TAIL_LINE_X, NAME_FREEZE_TAIL_LINE_Y, NAME_FROZEN_HEAD_HEAD, NAME_FROZEN_HEAD_NONE, NAME_FROZEN_HEAD_TAIL, NAME_FROZEN_NONE_HEAD, NAME_FROZEN_NONE_NONE, NAME_FROZEN_NONE_TAIL, NAME_FROZEN_TAIL_HEAD, NAME_FROZEN_TAIL_NONE, NAME_FROZEN_TAIL_TAIL, NAME_LINES_X, NAME_LINES_Y, nodeImageSize, SCOPE_CELLS, SCOPE_CELLS_ITEM_X, SCOPE_CELLS_ITEM_Y, SCOPE_CELLS_X, SCOPE_CELLS_Y, SCOPE_ENTIRE, SCOPE_LINES_X, SCOPE_LINES_Y, selectionHighlight, style, text, textLayout, textSize
Constructor and Description |
---|
CellImageButtonPainter(java.lang.String name,
org.eclipse.swt.graphics.Image buttonImage)
Creates push button behavior using the given image as the button.
|
CellImageButtonPainter(java.lang.String name,
org.eclipse.swt.graphics.Image trueImage,
org.eclipse.swt.graphics.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 . |
Modifier and Type | Method and Description |
---|---|
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(org.eclipse.swt.graphics.Image trueImage,
org.eclipse.swt.graphics.Image falseImage) |
void |
setupSpatial(X indexX,
Y indexY)
Overrides the default method setting the image related to toggle state.
|
align, clean, clipText, computeSize, dispose, getData, getName, getScope, getZone, hasTreeLinesVisible, init, isEnabled, isTreeEnabled, paint, setData, setEnabled, setNodeImages, setTreeLinesVisible, setTreeVisible, setup
public CellImageButtonPainter(java.lang.String name, org.eclipse.swt.graphics.Image trueImage, org.eclipse.swt.graphics.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, org.eclipse.swt.graphics.Image buttonImage)
name
- name of the paintertrueImage
- image to emulate the buttonpublic void setToggleImages(org.eclipse.swt.graphics.Image trueImage, org.eclipse.swt.graphics.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 displayCopyright © 2011 netanel.pl. All Rights Reserved.