public class ColormapWidget extends AbstractFlowWidget implements java.io.Serializable
ARROW_LENGHT, blackColor, clickareaBackgroundColor, clickareaBackgroundColorDragging, draggingEntry, flowHeight, flowWidth, handleColorTwo, leftWidth, linkageColor, POSITION_HALF_HEIGTH, POSITION_HEIGTH, rightWidth, topHeight
Constructor and Description |
---|
ColormapWidget(Composite parent,
int style,
int flowHeight,
int flowWidth,
boolean changeable)
Constructor setting the size of the flow drawing.
Note: this is NOT the total space for the widget itself, it is just the size of the flow drawing space without the value space at the left and the object space at the right. |
Modifier and Type | Method and Description |
---|---|
java.util.List<ColorData> |
getEntries()
List of
ColorData objects, each one representing a flow entry. |
protected java.lang.String |
getFlowEntryName() |
protected void |
handleObjectClick(IFlowEntry entry)
Opens a dialog used for editing the
FlowEntry object. |
protected java.lang.Double |
handlePositionClick(IFlowEntry entry)
Calls the
FlowEntryValueDialog . |
protected IFlowEntry |
newInitialFlowEntry() |
Rectangle |
paintEntryObject(GC gc,
IFlowEntry entry,
Point lineHook,
int heightPosition)
Paints the
FlowEntry object. |
protected void |
paintFlowArea(GC graphics)
Paints the complete flow area
|
void |
setEntries(java.util.List<ColorData> list) |
addFlowEntry, calcPreferredSize, computeSize, createMenuItem, doAddEntry, doDeleteEntry, getFlowHeight, getFlowList, getFlowWidth, getInternalBorderColor, getInternalBorderWidth, getLeftWidth, getRightWidth, hasEntries, init, mouseDoubleClick, mouseDown, mouseMove, mouseUp, paintControl, registerCallback, setFlowHeight, setFlowWidth, setInternalBorderColor, setInternalBorderWidth, setLeftWidth, setRightWidth, setSizeUpdater
public ColormapWidget(Composite parent, int style, int flowHeight, int flowWidth, boolean changeable)
flowHeight
- the hight in pixel of the fow drawing areaflowWidth
- The with in pixel of the flow drawing areaflowHeight
- The height of the color flow bar in pixelflowWidth
- The width of the color flow bar in pixelchangeable
- true
to enable the mouse listeners,
false
to have the widget in a read-only mode.protected void paintFlowArea(GC graphics)
AbstractFlowWidget
paintFlowArea
in class AbstractFlowWidget
graphics
- The GC
to be used for the drawing.public Rectangle paintEntryObject(GC gc, IFlowEntry entry, Point lineHook, int heightPosition)
AbstractFlowWidget
FlowEntry
object. This has to be done at the right of
the flow drawing area, as the left side is occupied by the FlowEntry
value drawing.paintEntryObject
in class AbstractFlowWidget
gc
- The GC
to be used for the drawingentry
- The FlowEntry
who's object is to be drawn.lineHook
- a Point
identifying the last pixel of the
entries lineheightPosition
- The y coordinate the last FlowEntry
object
painting has been done.Rectangle
identifying the palace beeing sensible for
user clicks. Clicking into this area results in showing the object editing dialog.protected java.lang.Double handlePositionClick(IFlowEntry entry)
FlowEntryValueDialog
.handlePositionClick
in class AbstractFlowWidget
entry
- The IFlowEntry
who's position is to be changed.NULL
if the user cancels the dialog.protected void handleObjectClick(IFlowEntry entry)
AbstractFlowWidget
FlowEntry
object.handleObjectClick
in class AbstractFlowWidget
entry
- The FlowEntry
to be edited.protected java.lang.String getFlowEntryName()
getFlowEntryName
in class AbstractFlowWidget
FlowEntry
implementation.protected IFlowEntry newInitialFlowEntry()
newInitialFlowEntry
in class AbstractFlowWidget
FlowEntry
.public void setEntries(java.util.List<ColorData> list)
setEntries
in class AbstractFlowWidget
list
- A list of object beeing used as map initializer.public java.util.List<ColorData> getEntries()
ColorData
objects, each one representing a flow entry.getEntries
in class AbstractFlowWidget
AbstractFlowWidget.getEntries()